Good morning everybody. Today we begin, I want to introduce to you Professor Harish Fulleria. He's going to be dealing with issues of water treatment, water quality. Please welcome Professor Harish Fulleria. Thank you. Thank you, Professor Sadhi. Good morning, everyone. So this is the day eight. And I hope that you're enjoying the lectures by different faculty here. So today I'm going to introduce you the sub-module, the module on water pollution and start with water quality. And so I am assistant professor in the Center for Environmental Science and Engineering. And basically this module is kind of organized in terms of basically having some introduction to water pollution and issues. And then basically going into the water quality parameters, what are those which should be monitored, how do we monitor them. And then we'll go into the drinking water quality treatment, then wastewater treatment.  So to start with I would like to ask you to spend maybe three minutes on this documented trailer by Irina Salina, which was basically a documentary made in 2008. And this basically depicts or kind of put together the conflicts related with water issues. It mentions about the greed issues from industry as well as actually the crisis of water because of the increasing population pressure. And at the same time offers advice and guidance from many experts. So I would like to basically open this link for you and please spend some time on this. And we will resume from there. So we just watched this small theoretical trailer of this movie, which probably you might have got that. It's a little bit the tone is against the industry, like how it is privatizing the water. And basically this bottling industry, which is more than $400 billion worldwide. But at the same time this is like concurrent issue. And actually we all want to have drinkable water. And when we are concerned about the water quality, we more likely choose if we can afford the water which is we think is safe enough to drink. That's why we go for the bottled water. But the idea here was that we should take a pause and think about whether this is the right choice individually as a nation or as a partner in the world community. Before we begin, I think it's important to mention a couple of definitions. I am sure that all of you are very much aware about them. But I think it is important that for the undergraduate students who we are teaching, even though they have environmental studies in their secondary school as well as in the senior secondary program, but it is important that we have these distinctions made at the very beginning of when we are teaching about pollution or pollutants or contaminants. So a pollutant is defined as any solid liquid or gaseous substance which is present in such concentration that it may be or it can tend to be injurious to the environment or environment also considers the human environment, so basically also to human health. On the other hand, a contaminant may be defined as something which causes deviation from the normal composition of an environment. So basically, if it is deviating from its natural concentration, then it's a contaminant. More likely it is coming from the anthropogenic or our human origin activities than basically what is happening naturally. So a contaminant does not occur in nature but gets introduced by human activity into the environment and thereby it affects the composition of that particular substance in the nature. I would like to acknowledge that much of the material I'm going to present today and maybe also tomorrow is basically taken or adapted from a professional location for these lectures on environmental studies, which is a mandatory course here at IIT Bombay and of course throughout India also for undergraduate students ES200. And so basically, I'm adapting a lot of material from there for the water module here. So after defining this definition, maybe we can quickly have a look at the water cycle. Probably you have seen it already in Professor Nichols lecture on water resources. So he must have introduced the hydrological cycle. The only thing which I have added here is it says modern world water cycle. So if we just talk about water cycle, you see it's basically evaporation of the weppers, then basically getting condensed, precipitating out. And well, they could be evaporated from direct surface water bodies or they can transpire from the plants or so, or even other like sea water bodies. And then they precipitate out as rain and then can go to surface water bodies, can seep into the groundwater and basically eventually end up into the ocean. They can go to the irrigation fields, then the runoff basically could go again with the seepage to the groundwater aquifers and then it can basically further could go to the ocean waters. Now how the modern world water cycle is a little bit different is as you can see here is this water treatment plant is there which provides drinking water. And then here's this sewage treatment plant which basically improves the quality or basically maintains the regulatory standard of the discharged water into the water bodies, whether this is the water which goes to the surface water bodies or for example, directed to marine bodies if they are nearby. So eventually what is happening is this drinking water after the waste, the water treatment plant, the drinking water is supplied to industry, to residential households, to commercial places and then thereby the sewage is generated or industrial effluents are generated and they basically goes to the sewage treatment plant or industrial treatment plants and then after the treatment, they are basically discharged to different water bodies according to the regulations. So in the modern world, the contribution of or the playoff of water treatment as well as sewage treatment is quite important and we must keep that in mind and actually as we will see as we move further and I'm sure you are aware about that, this is the key thing that we deal when we talk about water pollution and treatment. Maybe something about the water uses, so I'm sure this has been also covered but just as a primer. So there is increased population pressure and if you look at the globe, basically if we divide by the high income countries like in North America, to Africa and Asia, what we can see is the per capita water availability is basically decreasing and this is because the population is increasing in all of these places. In general, the water availability is higher in Northern America and Africa because of the reduced population pressure in these places and maybe a little bit more water availability in these places. But what we can clearly see is in all of these places, the per capita water availability is decreasing. It's very interesting, so we are quite aware all of us about the export imports of commodities and as you are probably quite well aware, water is now a commodity and actually there are countries, nations who are importing it. For example, this is a table which presents the dependence of the dependence of some selected countries on the imported surface water. So what you can see is the countries and then the percent of the total flow which originate outside their national borders. So for example, Bangladesh basically have 42% flow which is outside their national border. We as we know our prime minister was just in Bangladesh. They talked about various issues including the land deal and so but it's still Tishtha river is still a bone of contention because it's still Bangladesh basically receives a lot of I mean the surface water from Tishtha river which goes through the West Bengal. And given that the increased pressure on the water resources is going to eventually anyway be even further, this is of course an important issue to deal with. And if you look at the ratio of external water supply to internal supply, you see like this is 0.7. For example, for Bangladesh versus 32 for Egypt. So basically all these places above which are basically Egypt, Hungary, Hungary is in Eastern Europe, Mauritania is also in is Western Africa, Egypt and Gambia in West Africa, Syria is also there in Africa. All of these places they don't have any water resource I mean any surface water body basically they are importing the drinking water from other nations. So with that maybe we can have, we can spend another maybe about seven to eight minutes and basically go through this very interesting video which is basically describing the increasingly scarce resource as the water is becoming and how we are responsible to it. What are we consuming? Where it is going and what we can do about it?  So let's spend about seven, eight minutes on that. Okay, so I hope you realize that this was basically in the context of United States. So while it said that in average American consumes about 160 gallons of water, one gallon of water is about 3.8 liters. If we look at India, the average consumption which is given by the Bureau of Indian Standard in the code of water supply is about 150 to 200 liters per day per head for the population when it is more than 150, 100,000. So of course there are these discrepancies in terms of those who are more affluent and can afford to waste more water but eventually it is going to be an issue, which a global issue which it is. And so all of us have the responsibility to basically take this as a serious issue as we are doing for the other problems as well. So this was the video which mentioned about like how in which activities do we consume the water at the same time mention like how water basically comprise and like for example less than 0.007% of the water is available as the freshwater to be consumed. So just to put it in context, if you look at the water uses as individual household level and again this is basically from the United States basically this is from this book Masters in Hila 2008 introduction to environmental science and engineering. And if you look at household water uses and in liters you can see that the one on the top basically is the standard toilet per flush which is about 10 to 30 liters per household. Then basically if some of the more conscious consumers if they have introduced ultra low volume toilets or basically those where either they have dual system of flushing or basically a better toilet system where lesser water is needed per flush then it basically reduced down almost half to 1.6 gallons or about six liters per household. Then you see like dishwasher is about 50 to 120 liters per load. Water saver dishwasher again a little bit less but still this is quite high compared to for example let's say water when we use it for shower which is still high but far less than that and then obviously for cooking and other purposes it is quite less. Now one of the questions that I would say that we can pose I mean I you all of us can post or students is are they aware consciously about the their water budget? So meaning that in which activities how much water do they consume and if they can basically document that and if this could be given as an assignment to the students and basically depending on where they come from depending on which kind of families they come from, areas, urban rural all those we will see that the different activities that they are going to use water will be different. Now for example it says here for shower head is about 20 to 30 liters. Now this is actually in some in lower case I think is per minute or by the way this is per minute. So now if somebody takes about five to 10 minutes it's about five to 10 times of this which is about 100 to 200 liters per shower. Now there is really a lot because for India for example as I mentioned the average per person you know overall total water supply that is given as a code is basically about 150 to 200 liters. So what could be done basically instead of a shower if somebody takes is conscious and takes a bath with a bucket or so definitely we can save a lot of water. Now this is individual choice. This is something that cannot be mandated. This has to come from our own awareness and I think this is a good platform to basically discuss about it as a group as a community in the classrooms and basically advocate saving water. So that was also the message in the previous video. So this is what I was mentioning. So from the Bureau of Indian Standards the basic requirement of the urban water supply. So basically if it is for communities with a population of over 100,000 with full flushing system then it advises that the water that should be given to them is about 150 to 200 liters per head per day. And also what you see here is out of the 150 to 200 liters per head per day 45 liters per day which is about 25% is basically should be taken for the flushing requirement. So this is one fourth of the total. So when you will basically ask the students or actually check yourself where I am basically consuming water you will realize that actually one of the dominant activity which is consuming a lot of water is actually flushing. So this was basically about some background on the water issues and scarcity and how basically in the world as well as the individual levels how this is basically distributed. Let's look at something from historical point of view how we why basically there is a problem of water I mean drinking water. So if we go back to 1854 there was a cholera outbreak in London which was actually was around this broad street broadway street in London and basically a lot of cholera cases were reported around this which are basically shown in these black dots which may not be quite visible but I mean wherever you see like dark black thing these are basically all these places from where these cases were reported. And this place where this tea kind of thing is basically is here this is where the actual pump from where the people were consuming the water in around this area. So it was actually it is very interesting to know and I am sure that you more or less most of you should be knowing this that before 1854 cholera was assumed to be you know spread by air not by water. It was basically John Snow who demonstrated that basically this broadway pump you know it was a hand pump which was responsible for basically having this cholera outbreak in this area and around this area. And basically the pathogen in that water basically coming from the sewage a contamination from one of the lines which was broken and basically all the people who were consuming water from this or most of the people consuming water from there basically fall ill. While that was not the case with many other people around and taking consuming water from the other you know hand pumps which were not contaminated with this. So this was interesting discovery of course later lot later up in basically 1880s or so John Hook basically segregated the pathogens and basically cultured the microbes responsible for these kind of you know pathogenesis and in the current day basically John Snow this at this broader street there is a cafe which is named John Snow in the memory of you know John Snow's this remarkable work which basically paved the way for water disinfection. Basically it was around 1890 in London and about 1903 in New York and New Jersey where the first water supply for the city was established with disinfection. So this is I think a remarkable point in the journey of where basically we started treating water. Now when we talk about cholera basically this is one of the prevalent diseases but there are many pathogens in water which could basically more or less coming from the human excreta or human feces which gets contaminated either directly consciously well in a way means like ignoring that it might be or maybe basically non-consciously but because otherwise it is basically being you know transported to some of the surface water bodies from where the water is being consumed. So as we can see in this table there are viruses the broad categories the viruses, the bacterium, protozoa and helmets which are the pathogens which are found in the excreta of human feces and as you can see on the right side what are the associated diseases are mentioned and you can see for example typhoid fever, you know gastroentitris, cholera, diarrhea, dysentery and some of the specific ones with the worms are mentioned here. Currently still to date so basically it was in 1854 still today cholera, typhoid and dysentery are the three major water-borne diseases which are affecting millions of people especially children worldwide mostly in low and middle income countries. So which I was mentioning so basically that was like back in 1854 but if you look at this the one of the recent data sets from World Health Organization which reported or basically collated the information on the total number of cases of cholera between 2007 and 2009 and basically showed in this map where these cases were observed. The size of these circles or spheres basically show how many people were got affected. So basically if you look at India it's about between 10,000 and 20,000 but if you look at some of the southern part of the Africa or even also the eastern part of the Africa where even also in Iraq we see that it could be as high as 100,000 or even more than 50,000 people. Now this is of course a concern because this is what has been seen you can see that most in most of the western Europe or almost the whole Europe as well as in the Northern America basically there is no almost no cases of cholera because more or less they have assured treated safe drinking water to most of the people which is basically free of these pathogens which are responsible for example for the cholera which is not the case for example most of the low income countries for instance in professor Nichols lecture you must have came across that more than 60,000 villages in India do not have access to drinking water. So how do they manage drinking water? The previous documentary said that there are people in the world who gets just three gallons per day less than three gallons per day water. So they just barely get water to drink and be alive. As we all know one can stay alive without food for up to a month or more but it is very difficult to survive without drinking water more than a week. So this is really of high importance. So now with the aspirations and the industrial revolution as well as the population increase there were more diseases there were more contamination there were more infections and as well as newer discoveries. Even not only discoveries of newer compounds and chemicals but also newer drugs so to treat and to basically have a better living. So to provide the disease people or the people with whatever water bond morbidity recover from there and have a healthier life. So over the last 100 years we have benefited from new drugs and other products in our quest for better living. Now this better living through chemistry and when we are saying chemistry this is basically synthesis. Synthesis of newer molecules so if they are released in the environment as per our previous definitions they will be the contaminants. Because the nature is not ready to basically assimilate them in and basically bring them down to a safer level that they are no more a pollutant. As we said the pollutant is that concentration of a substance above which basically it can cause some damage to environment or human or animal health. A water environment Federation paper estimated about 80,000 different chemicals released into the environment over this time over this last 100 years and all of this were basically to target different diseases or ailments. So with that we come to so basically we are introducing these contaminants in the water because these are not natural this is what we are doing. Of course we are doing it for another reason but it's an artifact or basically a byproduct of whatever we are producing as a good for us whether this is like some material construction which could be like nanomaterials for example, which could be plastics which could be pharmaceutical drugs which could be pesticides for increased production of agricultural crops but all of these eventually because either the land or the water bodies are not prepared or ready to assimilate them and they become contaminants. Obviously not all of these substances can accurately be described as pollutants because if their concentrations are not above a certain limit that they pose any risk they are contaminants but not necessarily pollutants. Some of these substances are found naturally in surface waters of course and the others are natural substances that are concentrated by anthropogenic activity. So not only we are I mean our activities in the last 100 years or so are basically introducing new contaminants in the environment but also we are concentrating the natural substances and as their concentration increase more than a limit they becomes pollutant. And still there are manmade chemicals that do not occur in nature that was ascending so the chemicals which we are introducing in the nature so they of course can again become pollutants as well. These contaminants can be classified based for example, from source for example, the industrial contaminants which are basically originating from industries of specific nature of whether this is process whether this is synthesis whether this is production. This could be coming from household, it could be household activities like for example, household sprays which are being used, the cleaning agents which are being used, basically cleaning utensils with detergents and all those things they are actually ending up in the environment and these are not natural they are manmade. They could also come from agricultural activities for example, pesticides which are used in agriculture they are they basically you know they could end up into the surfaces of the plants and the crops but at the same time they can be assimilated in the roots they could be assimilated in the soil seep through the ground water and eventually come into our water bodies or they could be classified by nature for example, physical contaminants for example, solid by virtue of their physical characteristics they pose risk. For example, chemical contaminants like most of the heavy metals organic pollutants which basically pose risk because of their chemical activity, redox potential and high reactivity and they could be also classified as biological agents for example, pathogens, microbes which so they are not necessarily coming naturally they are also coming for example, from biological warfare material they are coming from explosives. So, from these places also biological material can be introduced for example, anthrax is one of the biological material which was introduced. Now, with that we maybe spend a little bit time on emerging contaminants. So, there are some contaminants which we are seeing very recently. So, in the last 40, 50 years these are mostly industrial chemicals for example, they can end up into our septic tanks they could basically go to wastewater treatment plant if we have a sewer supply and basically collecting all the raw wastewater or sewage which is generated by individual households or commercial places. And then if they are applied to land applications they can also end up there. From all of these three places whether directly from the septic tank or from the discharge wastewater from the wastewater treatment plant and after the basically runoff from the land applications or agriculture they can end up into lakes, streams, river, groundwater which are actually the sources of our drinking water. So, eventually these contaminants are ending up into our drinking water and which neither the environment nor us we are also not ready to basically tackle some of these chemicals because they are new and our immune system is not ready and adapted towards them. For example, some of the emerging contaminants could be pharmaceutical active chemicals. All of us basically consume drugs when we are sick. We take many times antibiotics we take anti-inflammatory and of course, anti-allergens and for prolonged kind of exposures we take anti-cancer drugs. These pharmaceutical active compounds basically have a very slow decay. Mostly they are lipophilic so they are water repellent. So, most of times they do not get easily degraded. At the same time these are new compounds which are introduced in the environment. So, the microbes themselves are not ready to degrade them. And as we will basically cover in the next lecture when we will talk about the BOD which is biochemical oxygen demand and chemical oxygen demand COD we will see why this is very important. If much of the organic waste which is being released is human generated and basically persistent and very slow to be decayed then this will basically bypass the waste water treatment plant because most of them are using biological secondary treatment and so these microbes can degrade the biological material which should be degraded but not necessarily these persistent organic or inorganic compounds which we are for example, coming from the pharmaceutical. They could also come or found in personal care products for example, disinfectants, antiseptics, sunscreens, etc. One of the major concerns with antibiotics is the development of antibiotic resistant strains of pathogenic bacteria due to overuse of the drugs. I am not sure but many of you may have basically read the news. For example, in the last five years or so I would say 10 years that first thing, India is the is the basically capital of the TB epidemic. We have most number of tuberculosis cases in India and then at the same time then from the generic TB, basically it changed to like drug resistant TB and then multi drug resistant TB. So basically because this is bacterial based disease so for which antibiotic is prescribed most of times and because of the not a very prescribed use of these or the overuse of these antibiotic drugs many of them basically end up into our water reservoirs. So large amount of these antibiotics leaves the body because they do not get metabolized and basically end up into our urine or feces as a mixture of either parent compounds or metabolites both of which are very difficult to degrade further biologically and so they end up in our water reservoirs. Other kind of emerging contaminants which are quite of concerns are endocrine disrupting chemicals there is a typo here this is endocrine disrupting chemicals. So these EDCs are substances which are mostly synthetic that mimic a hormone in endocrine system and disrupts the function of the hormone and as we know the hormones are very important in developmental progress in neurological development and so eventually these some of these EDCs may result in developmental abnormalities as well as neurological disorders. The important thing to consider here is unlike for example some of the pathogens like the case of which cause cholera, dysentery or other kind of water-borne diseases in case of the EDCs or pharmaceutical compounds or all of these organic or heavy metals they have a low dose but very prolonged exposures. So most of the time they do not result into the same diseases as which were caused by the other water-borne in a factor like pathogens. So mostly they end up into for example cancerous or as we said these developmental abnormalities or neurological disorders. Some of the EDCs include for example pesticides polychlorobiphenyls, poly aromatic hydrocarbons, dioxins, et cetera. For example DDT which is a pesticide, Visvinol A which comes from plastic water bottles or the liners which is used in the vegetable cans. For example estrogenic substances like birth control pills they may have also some of these, I mean the compound there basically act as EDCs and for example phthalates or so which are used in making the toys and are used also in air freshness. Lastly the emerging contaminants are disinfection byproducts. As most of us know that basically the drinking water which is supplied to through the public water supply systems basically is disinfected by using chlorine. And which is a very good thing and as we will also cover that later in the next lecture about the chlorine disinfection and other kind of disinfection. One of the problems with that is the generation of disinfection byproducts. So basically the natural organic matter present in the drinking water when it basically comes in contact with the chlorine it gets oxidized and basically result into some of these disinfection byproducts which could include trihalomethans, heloacetic acids and so. And which are known as or at least assume to be suspected carcinogens and they specifically affect the reproduction system. And because this is like public water supply so basically goes to millions or billions of the people so a large population is exposed to the disinfection byproducts. So if we basically talk about for example a contamination by some of the pathogens then there is a more likely a local phenomena. For example like in case of cholera that was basically in 1854 that was basically restricted to that the very small area around that pump from where the people were consuming the water. In this case this water is basically going everywhere with same kind of disinfection applied most of the places. So everybody is basically consuming the resulting disinfection byproducts like trihalomethans and heloacetic acids. For example one of the emerging another dye disinfection byproducts is like nitrosamines which are nitrogenous disinfection byproducts. So one should be also cautious about that. So now what does that all mean? So for example in this cartoon very nicely if you see this newspaper it says that drugs found in water supply. And then most of these people who are water conscious and don't want to have the tap the bottle water they say oh we'll have the tap order because this is basically coming through disinfection and a good water treatment system. So now the other person is saying do you have a prescription? Because many of the drugs are ending into that. So which is of course of concern because so far we were dealing with or the world was dealing I think until for example early 20th century we were dealing with the diseases of infection or the diseases which were contagious but now we are basically in a regime change we are dealing with diseases which are chronic which are non communicable and which are basically coming after a prolonged exposure to low doses. So it is very, very important to keep that in mind and basically communicate to this to our leaders of tomorrow which are the under graduate students who we are going to teach. Now in terms of the human health impacts for example there are some studies like one by Nelson and Bangai in 1974. They found lower sperm counts in men in LA, New York and Minneapolis compared to this in Missouri because they have for example some of these higher amount of disinfection byproducts or some of the pharmaceutical active EDC compounds. For example the other study confirmed the earlier study and for example you can see the atrazine, alkaline and these are the specific compounds which are basically pharmaceutical compounds which were found in the Missouri water which was basically responsible for this low sperm count. As you remember from the previous slide I may remember I said that some of these compounds are basically responsible for lower reproductive in humans. There's a link between pesticides and reproductive effect which was also established by these study. The people were not exposed occupationally and what was found was that this drinking water was contaminated. More health impacts basically birth defects was found in male reproductive organs. Basically it was doubled from 1997 to 1991 which is basically surely because of the overuse or the additional use of drugs over the 20 years. Dioxin problems in monkeys was found linked between increase in breast, testicular and prostate cancers over last four years. It is very important to keep this timeframe in mind. So it was basically last four years. So all the people who were in their 60s or more than 50s if they were continuously drinking the water which was basically contaminated with some of these EDCs or the emerging contaminants they were responsible for. Well at least it seems like they were responsible for the increase in some of these cancers. All linked to hormone mimicking or disrupting compounds so which basically indicate the EDC nature of these contaminants. Meaning they are endocrine disrupting chemicals. So let me lastly come to the place like what makes something a poison? So as the great philosopher Parseus less said back in the 15th century or basically 16th century no substance is a poison by itself. It is the dose that makes a substance a poison. And the dose is basically a function of the concentration and the exposure and the risk what it pose to is basically a function of the toxicity and the exposure. So how toxic is something and how likely somebody is going to expose with that poses a risk from that and that it becomes a poison. For example we can explain it in the way that for example there are like few of the snakes like Cobra, Krat and Vipers are one of the are few of the most dangerous snakes with the deadly poison they have. Now if you want to see what is the risk that they pose to the larger population we need to see the toxicity is high but the exposure is low because there are few number of cases where they bite humans because the human-animal conflict when that happens only then they bite the humans. So compared to that if we say a large like for example millions of people in large cities which are consuming for example drinking water which is contaminated or basically having some of these disinfection byproducts or EDCs are actually in total would pose more risk to the population than for example this highly toxic like venom. Now if we just look at like for example some of the sources of water for us like surface water for example rivers so what are the factors which impair the surface waters. So for example this figure shows on the access the percent of the impairment by these different factors which are the pollutants or stressors how they basically you know impair. Impair means that they make the water undrinkable or unhealthy to drink. For example 35% or so as we can guess mostly come from the pathogens. They are responsible for 35% of the water you know surface river waters not drinkable because of the introduction of the pathogens. Siltation, habitat alterations, oxygen depleting substances because they reduce the oxygen concentration and thereby affect the microbiology and the ecosystem of the water bodies and eventually disrupt you know the water quality. For example nutrients like phosphorus and nitrogen which comes from eutrophication from agriculture runoff, thermal modification if water which is discharged to the water has higher temperatures then of course that may also affect and impair the water for the use. And then also there could be metals and the flow alteration is for example if a dam is built or you know some of the water is basically diverted to something else then that can also impair you know the quality of water quality and the amount of water available for drinking purposes. If you look at it by source for example agriculture for rivers is the most dominant source about 40% then the hydrological modification which I was mentioning earlier urban runoffs from storm sewers and as you have also probably learned from the Nichols lecture that it is the sanitation is one of the primary I mean not having you know good sanitation and sewage treatment of the domestic wastewater is one of the primary reasons why our surface water bodies are basically being contaminated. And then of course there is also contribution from atmospheric deposition also some non-point sources and for example disposal from the land. If you look at lakes then basically it is a nutrient so compared to the rivers where the water is flowing so the basically the buildup of some of these substances doesn't take place. On the other hand lakes basically receives a lot of runoff water from agricultural lands from you know some of the commercial and domestic household activities and so nutrients basically this is again coming from mostly agriculture also some of the phosphorus and also is coming basically from the domestic users. Metals, siltation, TDS again oxygen depleting substances so but in this case important thing to remember is that about 50 to 40 about 50 and 40% of the impairment of the lake water quality is because of the nutrient and metals and less so from the pathogens which was the case with the river water. If you look at by source we see that agriculture as we saw earlier 50% was basically from the nutrients hydrological modifications, habitat modification all of those are also associated with the depleting oxygen concentration and the thermal segregation in the lakes and also of course some of the point sources and some urban runoff from the storm sewers. So with that we come to the water and wastewater I mean basically both are important so on the one hand we need water drinking water for us but then that is basically quickly turned into wastewater so we must treat that and for that wastewater treatment plants are established in most part of the worlds where they can afford it. Interestingly in 2013 or since 2013 the water environment federation no more called them wastewater treatment plants but they call it water resource recovery facilities because the wastewater is actually a plentiful of resource with the diminishing availability of the drinking water or the clean water or surface water available gradually we will have to resort to some of the wastewater and basically reclaim or recover water from this as well as nutrients as well as energy so that you know this could become a resource. So instead of calling it wastewater treatment plant this is now being referred as water resource recovery facilities this is important to communicate to the students that they should not see waste as something which is waste it could have value it could have you know economic value actually also as well as value which for example in terms of the scarce resources it could provide you know for example drinking water and some of the energy needs could be fulfilled through that. So which means that we have to treat water but then why we treat? So basically to protect the public health to meet regulatory requirements and to protect the quality of the surface water body. Now I am sure all of you will agree with me on this if we are given enough energy input which is a function of the resources money how much money we can invest into it any chemical can be removed from water. The question is is the benefit worth the impact and this is very important to raise this because while we should be very conscious about the scarcity of water and at the same time that there are you know methods available advanced methods available for treating the water we should also keep the economics in mind we should keep the feasibility and the practicality of the available methods in mind because at one point we will be constrained by the resources by energy or by money. So for example this graph shows like the per capita energy use so per meter cube of energy use if we use some of these kind of disinfection methods to treat the water. So for example chlorination or UV or UV is ultraviolet disinfection method ozone as a disinfectant or a combination of ozone and some of the advanced oxidation methods some of these we will discuss in the next lecture. What you see here is basically the cost per unit I mean the energy consumed per unit of water treated is basically increasing as we move for the more advanced methods. So chlorine as you can see is not by chance the default method of disinfection over the world and it's only very like recently when we are seeing the risks of the disinfection byproducts because of the chlorine that now increasingly people are talking and discussing and researching about what other alternative disinfection methods are there. For example this other graph on the right hand side basically puts a dollar value to some of these so the methods here are chlorine, chloramines, chlorine dioxide, ultraviolet, light and ozone as five different disinfection methods and as you can see if you are treating a very low volume of water then the per meter cube of water basically there is very high cost for some of the advanced like ozone and UV treatment even also for example chloramines and there is low cost obviously the lowest cost for chlorine but as we increase the amount of water treated we see that it's basically the principle of marginalized return. So eventually at high volume treatment basically the cost is optimized and more or less most of the methods are quite comparable in terms of the amount of money that requires to be disinfected by them. So in general basically we have this impact cycle where basically there is increased wastewater because of the influence on the drinking water which could be because of the increased population growth sometimes drought could happen and then we need novel treatment technologies which basically another factor comes in there is like the greenhouse gas emissions. So more the energy that we used to treat this doesn't come free basically of course there is a cost associated with treatment but as well as the greenhouse gas emissions which as most of us are aware basically it's some of the larger global issues like climate change which eventually could trigger some of the drought events or flood events and basically this is a cycle which could run on and on. So the key message from this which I would like to give and you would like to also give to your students is that most of these persistent chemicals or these endocrine disrupting chemicals have been documented actually already for some time now like more than 40 years and if we really look hard we will find that the contaminants they are contaminants we will find the contaminants we look hard means that we will find these contaminants in low concentrations and as we know there is no treatment process which is perfect there's always a playoff between contaminant reduction versus pollution relocation because maybe we are transferring the pollution from one side so basically many of the treatment as we will also briefly touch in our wastewater treatment or even water treatment mostly wastewater treatment basically the contaminants which are not able to be removed from the environment or basically come out as sludge and then dewatered and then basically if they are not biodegradable mostly they are not and then they are taken to landfills. So it turns out to be a reduction of the contaminants from water basically to land pollution. Another thing is the cleaner water versus carbon footprint which is about like the more that we treat more energy we consume more is the carbon footprint from that. Some other message we can give is that for all these reasons we have to basically take an ecological perspective in mind so ecological concern must be addressed which means that we have to take it as a whole big system not that the problem is resolved from my end or you know as a local body but like how this is affecting a whole ecological system which is basically in the watershed or in the large region. We should strive for cleaner and safer water and obviously there will be a cost and the public will have to bear the cost. That needs to be also communicated. For example, if all of us when we want to have you know safe drinking water and we are not sure of the tap water or the you know surface water which is available maybe where we go to further you know some places which is not our you know hometowns or so we more likely will basically go to some of these stores and buy the bottle water. We are paying for that and same thing we'll have to do for cleaning the water and basically making it available for everyone. Now the only important thing to consider is those who can afford more like the taxation maybe they need to bear it more but that is something which is not in the you know context of this course. The world will depend on the water we use of course because of the you know the increasing drinking water or the freshwater bodies and the water scarcity. Trace contaminants will be detected and if treatment is needed wastewater makes more sense. So it makes sense to treat wastewater basically recover some of the nutrients use some of the if you use anaerobic process for example then some of the methane which is produced could be used for energy generation and then at the same time we can get the drinking water. So at the same time the last key message must be also given is more efficient treatment have to have more cost to the public and that needs to be you know acknowledged. With this let's come to some like discussion point so I think this is something that you can basically discuss in your class to all the students for example are they aware what is the source of the drinking water in their household and are they treating it before they are consuming it what method they are using to treat it. So this could be something that you know you could take it as an exercise and we can also spend maybe five minutes or so here to discuss that and the other thing is you have already a module on air pollution and you saw like how this that was more ubiquitous. Now how are the exposure pathways to water contaminants different for example than say air pollutants so that also needs to be understood because as we see the risk is a function of the toxicity as well as exposure and if you are not you know aware about the exposure pathways then we may miss the mechanism as well as the impacts of the contaminated or polluted water to the human health. So hi, Savita Engineering College Tamil Nadu okay. Good morning. So good morning sir. Good morning. So what is I'm sure that you all are from different parts of Tamil Nadu is that correct? Yes. So of course which means that we cannot just go on an individual basis but let's say if we can say in terms of urban you know metropolitan or rural areas what are the sources of drinking water in the household and if we know about that then what are, is there any pre-treatment which is being done before the water is being consumed? So maybe a few of you would like to mention something about that. In Chennai the water is coming from different rivers around the which is around 50 kilometers of Chennai and all are treated basic treatments are done and then supplied to the households by different piping systems. Okay. Sir in Chennai we have a lot of desalination plants. We are taking water from sea to meet the demands because most of the groundwater is polluted and also the river comb is highly polluted. We cannot take the water for drinking. So what the government is doing they are storing water in nearly four reservoirs like Pundi, Red Hills and Chempramakam near our college. Apart from that we are meeting the water demand from the desalination plants which are executed in the two places in Tamil Nadu in Chennai. One is at Menjore another one is in Nemeli so near Mahabalipram. So this is the place where we are treating the water and we are supplying water to all the people. I think there is no scarcity now. So you are saying in Chennai there is no scarcity? Yes, yes. I have a question sir. Please go ahead. So we have a lot of rivers. The river pollution I want to talk about something. So look at that now the government of India is going to clean the river ganges through water resources ministry and Ms. Bhumabharvi is the minister for that and they are going to clean for nearly another couple of years. But one of the senior leaders said it is impossible to clean the water even 50 years. Such a pollution is there in the ganges river. So what I can tell you is you can suggest the ministry of water resources through these conference or through this short term training program to identify the police protecting force or river production force like railway force or like what you have central industrial force that we can have a solution for protecting rivers to avoid pollutions. Is it possible sir? I think the very good point that you mentioned and you raised I think yeah that is what we not only with just the issue of let's say reclaiming or bringing the river water to acceptable level of water quality. It is I think in general a case with many of the issues where basically there are two things. One is whether we have the technical know-how and affordable treatment system that could be put in place. It could be I mean it's a post hoc treatment or it could be also preventive method. For example, in case of many of the river system as all of you must be very aware it is more preventive. If we can just make sure that most of the sewage that enters into these surface water bodies could be basically treated by these STPs and to a level that it is basically being taken care by the natural cleansing by the rivers then I mean part of the problem is resolved. But at the same time what you mentioned is there is need of a political will and you are absolutely right. This requires basically to kind of have a forum which could basically have this registered and as a uni vocal voice basically mentioned that there is know-how, there is willingness by the local bodies or the state bodies and so basically at the union level as well as the state level they could be basically advise as well as kind of persuaded that this could be taken even with a more vigorous effort. Yeah, absolutely. Thank you sir, thank you. Okay, so let's go back because we do not have that much time. So maybe I will quickly go to some of the next slides and leave you with these questions and maybe when we resume tomorrow morning we can spend maybe five, 10 minutes on some of these questions and take your queries as well as your information. I think it was very interesting to know from Tamil Nadu for example that they have desalination plans and they are basically providing the drinking water from there. So with that let's say move to the water quality parameters. So because as we see like we need to treat the water but then what do we want to treat? To what level? How do we know that? So we need to have some measure which is basically defined based on the different water quality parameters and there's a guideline which is given by for example USEPA by WHO, we have also CPCB guidelines about what should be the drinking water quality parameters, what should be the regulations for the water quality of any water which is discharged to for example fisheries or aquatic water bodies. I mean the aquatic marine water bodies and so and so. So which basically bring me to this water quality standard guidelines by CPCB, there's a link there which I think most of you may have already visited. So this A, so you have these five columns here. So basically these are the characteristics here and these five columns A, B, C, D, E. A is basically if these criteria must be met if this is a drinking water that needs to be supplied and this should be after disinfection. So basically we are not talking about, I mean that this pathogens and some of those basically should be after the disinfection. So as you can see the dissolved oxygen should be high. So it is minimum, that is something to note there. So dissolved oxygen limit is the minimum six milligram per liter while for example many of the others are the maximum limits. For example, biochemical oxygen demand should not be more than two milligrams per liter. Pathogens in terms of the total pathogen count per 100 ml should not be more than 15 drinking water and then similarly other parameters. Some of the heavy metals should be basically in the PPM levels basically in milligram per liters like one or less than 0.1 or so. So what are the typical water quality parameters that one is interested in? For example, this is just a lose list. I mean these are not restricted. There are many more parameters. I just for the sake of space I just put these. So for example, pH, alkalinity, conductance, salinity or total dissolved solids, dissolved oxygen, turbidity, biochemical oxygen demand, temperature, pathogens in terms of the coliforms, total or the fecal coliforms are some of the water quality parameters which are of interest. So quickly go through some of these parameters. For example, pH, it's a measure of hydrogen and concentration. Oh I must say that some of these are basically very routine. This is not a regular class. All of you are basically teaching these courses or most of you are teaching this environmental studies course. So I'm quite sure that you are well aware with that but basically this is information that needs to be communicated to the students when we are teaching them. So we must tell them what are the parameters which are important when we are regulating the water quality or when we are concerned about the water quality. So pH measures the hydrogen ion concentrations in negative logarithm of hydrogen ion concentration which is measured as moles per liter and this ranges from zero to 14. And of course, when the pH is seven is neutral, when it is less than seven it is acidic, when it is more than seven it is alkaline. And this could be measured by the very affordable pH meters that are available. Alkalinity is kind of opposite of pH, basic opposite of acidity is like acid neutralizing capacity. So most of our water bodies, they have basically a bicarbonate carbonate buffer system because of which they have some kind of alkalinity because the buffer, it is the buffer which is provided by the bicarbonate carbonate system which resists the change against any change in the pH. For most of the waters, alkalinity is contributed predominantly by bicarbonate ion which is predominantly because of the exposure to the open environment where the bicarbonates are in equilibrium with the carbonic acid, the dissolved carbon dioxide which is in equilibrium with the gas, gas concentration of carbon dioxide which is more or less universal about 0.03% over the earth. Other ions such as orthophosphate and borates may also contribute to alkalinity but in very small amounts. In general, when we talk about alkalinity, we talk about bicarbonate, carbonates and hydroxides. And this is measured by titrating a sample of the water with sulfuric acid and basically using two indicators which give you total as well as the half of the carbonate bicarbonate and alkalinity. Conductivity is basically, it is also an important parameter because this tells about how much the dissolved ions are there in the water sample. And it could be also in direct measure of salinity and it is measured as micro siemens per centimeter. And basically, if you have higher value of conductivity means there's a better electrical conductor and there are more ions present in the water or the sample of interest. This is basically the dissolved solids so which is very important case of classification of ground water. For example, the composition based on the total dissolved solid content could be categorized in terms of type of water. For example, if the dissolved solid content, total dissolved solids is less than 1000 milligrams per liter then this is fresh water. If up to 3000, so brackish water, it could be saline water, moderate and highly saline water if it is more than 10,000 TDS or milligram per liters of the TDS. And the sieve water is basically if it is more than 35,000 milligrams per liter. Turbidity is another parameter which is of interest. It is measured in neflometric turbidity units. Basically, it is measured using a neflometer or basically a device where basically the light is scattered perpendicular to the direction from where it is incident. And what we see, the principle is that in the pure water because of not having the colloidal size particles, the light basically passes through and the detector doesn't detect anything. But in case of cloudy water which is because of the suspended solid as well as the colloidal solids basically there's light scattering which is detected at 90 degree angle and that is basically tells indirectly the amount of the turbidity present in the water. This has a good correlation with the concentration of particle in the water and basically some of the turbidity meters, neflometers which are available could be used for monitoring this. Then in terms of the parameters like solids which is an indicator of basically presence of any solids turbidity as we said earlier is an indicator of presence of solids in water sample. And this could be measured in terms of total solid which is basically all the solids present in water and this could be determined by evaporating a water sample up to 100 to 110 degree centigrade and drying the residue after that and basically whatever weight is left is basically the total solids. It could be either dissolved solid or undissolved solid and dissolved solids are those which could be found further by isolating and drying at 180 degree centigrade and the other ones are basically from the previous one are actually causing the most of the turbidity in the water and isolated simply by filtration. Solids would be volatile for example some of the organic dissolved solids and they could be burned off by heating or you know combusting at 550 degree centigrade around so and then these are mostly organic compounds. Those which could not be removed after all of this are basically fixed solids mostly inorganic salts which necessarily do not mostly related to the hardness for example calcium and magnesium hardness is coming from there. And then of course some of these solids as we will see when we will go to the water treatment and waste water treatment if they are of particular size they could be basically shattered and then they could be used. I mean these simple settling tanks or these could be used to basically separate them out from the rest of the material. So I think I will basically close it here but maybe I will just quickly go to impose some additional discussion questions which would be something if people can have some discussion or when you get time or maybe off time when you have some time think about them. For example what are the issues with water quality in your city, town and village? Is there any specific water quality parameter which is an outstanding issue in your area? So when I am saying specific water quality parameter basically that means that already there is a criteria for the water quality for example many places fluoride is a problem in groundwater. Many places arsenic is a problem. Many places total dissolved solids or hardness is a problem so that something if you can really look individually and just put it together for you as well as basically discuss it with your students when you are teaching the course. Other thing is like do you consume store water or free running tap water? This is also important and why this is important I think also you should think about that. So when we are basically for example as one of the centers where we had an interaction mentioned that when you are consuming the free running water basically this is already after disinfection and so more or less the contamination possibility during the storage doesn't arise and so more or less you get the same water quality almost what is basically being discharged from the treatment plant, water treatment plant. While during the storage because of several factors for example small kids basically putting hands in some of the stored waters or not having proper cleaning of the storage vessels could basically lead to some of the water contamination during the storage which could be of concern and basically get us like polluted water. So we are basically at the end of this first sum module I wanted to cover basically give you some or I mean the idea was basically with this you could sensitize the students about the issues of the water whether this with surface water bodies with the ground water basically make them think about why this is a scarce commodity and we should not anymore just believe that if we have money we can just buy water because eventually it is going to be everybody's problem and at the same time how do we really tackle the quality issues or what kind of parameters need to be monitored and how do we monitor them. So basically we'll resume tomorrow from where we left today we'll talk about some of the important parameters like DO, dissolved oxygen, biological oxygen demand, biochemical oxygen demand, chemical oxygen demand and some others and then basically move to water treatment in the first lecture and then we will talk about the waste water treatment in the second one. So I hope that it was a little bit useful for you and I would like to have your feedback. Thanks a lot and I will see you tomorrow. Bye.


Hello and welcome to another problem-solving session on triangles in this question.  You have to prove that P S this line P S is parallel to Q R Q R. Okay So should be very simple We have to prove that the lines are parallel and we know that two lines are parallel when alternate interior angles are equal So if I somehow prove that angle one is equal to angle two then my job is done and exactly what is Is to be done here, right? So let's try to prove that the two Angles are equal. Okay, how to prove that so it's given so first. Let's write what is given? So given is triangle POS POS is similar to triangle R O Q. Correct? The moment this is given by the Condition of similarity. We know that the angles will be equal corresponding angles will be equal to prove What do we need to prove? We need to prove that P S is parallel to Q R Okay, how to prove that? So let's see the solution or the proof. So what I'm going to do is I am going to write triangle POS what is given is similar to triangle R O Q This is given therefore therefore by the By the conditions of by the conditions of similar triangles of similar triangles We can write Corresponding angles are equal. So hence angle one is equal to angle Q that is to write so angle P So angle S is equal to angle Q. It is very clear from this This is this correspondence over here. So angle S is equal to angle Q. So this implies that alternate Alternate interior Angles Alternate interior angles or that is angle PSO and angle R Q O are equal are Equal are equal and hence and hence we can say and hence We can say PS is Parallel to R Q Correct, you could have done this by proving the other two pairs of angle equal So let's say angle three is also equal to angle four. This is also it can be used This also can be used to prove that PS is parallel to Q R. Correct. I hope you got how to solve such questions


I'm Jean-Prancois Guagnet. You can read my bio on the FASDEM website. I want to take as much time as possible to talk about this subject and not me. So I'll start right away. So the title of the talk is the consequences of sing bin long not equal to one. Actually the full title of the talk should be the consequence of sing bin long not equal to one and of EnoDB flush log at TRX commit equal and not equal to two, sorry, because like one without the other doesn't really make sense. Like if you still sync EnoDB and you don't sync the bin logs, like you're still adding the cost of a sing. There might be edge case but like that's what we're talking about. And I will use in the talk TRX commit for short because like this is just too long to write in slides. So in the abstract of the talk I say that it's faster but we'll see by how much. Then we'll talk about what is replication and what are those two parameters. I'll talk about avoiding setting sing bin log to a value different than one. Then the consequence mitigating and closing comments. So this talk is mostly about my SQL 5.6 and 5.7. Most of it also applies to Edo. Some things about MariaDB and I will explicitly mention it. And like don't waste time taking pictures of the slide there online and you can follow the slides right now on your phone if you're not able to see the lowest part of the slides. So faster by how much. So like we're in benchmark land here. So I did I use sysbench single-threaded insert benchmark without secondary index because I really want to test like the syncing part of my SQL on Google Cloud with SSD persistent disk my SQL 5.7.26. So sing bin log equal one and TRX commit equal one. 200 transactions per second single-threaded. This is not a lot. On a slave it's a little more because here my client is remote from the master. So there's around trip time between the client and the database. On a slave there's no such thing. If I reduce durability so sing bin log equal zero to X commit equal two. 3.7 thousand transactions on the master 18 times faster and 7 thousand transactions per second on a slave 30 times faster. So obviously people having a replication lag problem. This is a very tempting configuration to do to solve a replication lag problem but it has consequences we'll see about this. The whole benchmark setup is discussed on one of my blog. So this is like this is what we're talking about. This is the speed difference we're talking about. Quick overview of replication a transaction commit on the master. It goes in EnoDB and in the binary logs. Those binary logs are downloaded by the IOTRED. Sorry it's the lowest part of the slide. Are downloaded by the IOTRED that connects to the master. Download the binary logs put them in the relay log. The SQL thread execute the relay log put data in EnoDB and eventually the slave produces binary log if log slave update is enabled. So sync bin log and TRX commit they're here. Those are per meter controlling what happens on EnoDB on commit and what happens on the binary logs on commit and they're also here. So sync bin log equal something zero to any number. Well I guess it's limited by a size of an int. So sync bin log equals something. The bin logs are flushed to disk every something transaction. So if sync bin log equal one the binary log will be flushed to disk so that means the data is actually on persistent disk not in an operating system buffer after each transaction. If you set this to zero the bin logs will be in the operating system but you don't know if they're on disk. They will actually be flushed at every bin log rotation. There's some problems about this but I won't go into the details. So this controls if our bin logs are persistent on disk or not. TRX commit can be equal to one, two or zero. One the redo log so the log of EnoDB is flushed to disk after each transaction. Two the redo log is written to the operating system so it sits and the data sits in an operating system buffer but it's not flushed on disk at this point. It will be flushed on disk every second for EnoDB housekeeping. And zero we're not really talking about this. It's like we avoid the system call at each transaction. The data is in a MySQL buffer in an EnoDB buffer and it will be sent to the operating system once in a while every second. So that's what those two settings are controlling. So I mentioned flushed to disk. So this means that the data in an operating system buffer is actually persisted to disk. So this is not fast. So in old spinning rust disk a flush was taking 18 to 25 millisecond so that means we can do only 40 flush per second. So like 40 transactions per second that's not a lot. Consumer grade SSD so what you probably have on your laptop right now it's very variable a flush can take up to 10 millisecond and on some of the SSDs at 0.5 millisecond just do an IO ping on your laptop you'll know how much time it takes. Like enterprises SSDs.  If you have a RAID cache with a RAM battery backup RAM it's 0.04 seconds. But we don't have only local disk. We have network disk, fiber channel, iSCSI like any type of SAN like that's the network latency 0.5 millisecond to 1 millisecond depending on the efficiency of your network. And in cloud environments disk are remote. So GCP or AWS like between 0.5 millisecond to 1 millisecond to go to the storage. In AWS you can have local SSDs which are efficient and that's fast. So like flushing to disk is not fast. And what does this mean? So what does this mean is that every transaction is durable like same bin log equal 1, TRX commit equal 1 after each commit transactions are on disk so we don't lose anything. But if it's equal 0 or equal 2 if mys equal d crash then the data is not lost because the operating system is still alive as the data in the buffer. But if the operating system crashes we lose transaction and also maybe EnoDB and the binary logs are not in sync. So here if we do transaction ABCD and so on maybe the binary logs are synced up to E and EnoDB is synced up to K and then we do other transactions and we crash at recovery the binary logs will contain up to E and EnoDB will contain up to K. So we have a problem of consistency here. And there's also the other scenario where the bin logs are ahead of EnoDB it's less there's a less probability but it can also happen. Skip this. So my SQL in 5.7 or 8.0 by default are the defaults are not now safe. MaraDB defaults are not safe. I'm not it's not the best like the choice here is theirs. I'm not sure I agree with this. So we would like to avoid setting send in log to something different than zero. So the solutions here are either to get faster disks or to run things in parallel. And so a single sync will persist many transactions at the same time. So this is a binary log group commit on the master or if you use parallel replication. So if you use if you run more than one transactions at the same time on slaves maybe you'll be able to commit many things at the same time. So we'll explore this a little. So we remember the numbers. Very low transaction throughput with sync bin log equal one. And as we use more and more tread we're able to get a better transaction throughput with same bin log equals zero and then single treaded. We have a more decent transaction throughput. This is not with replication. This is with a client doing a roundtrip. So around 3000. But this this curve grows much faster than the other. So even if we're able to get a better transaction throughput with multi-treaded on the master like we need a hundred two hundred treads to get a better transaction throughput and send bin log equals zero we have better. So when you're looking for the best transaction throughput like send bin log equals zero is still better. This is with four VCPUs in Google Cloud and this is with 16. So it scales a little. With replication Meridibi has something called slave group commit which is pretty exciting. It basically gets the transaction throughput of send bin log equals zero with many treads without the consequence of it. You can look it up. I have a link down there and parallel replication on the benchmark I'm doing on the insert benchmark is like this is this is the worst benchmark for for parallel replication because there's a lot of contention. Sing bin log equal one we scale but with sing bin log equals zero it's still better. So like we're still like tortured here if we want the best transaction per second sing bin log equals zero is still our best choice. Those are all the graphs on the same page. So now about the consequence so now we get into the real subject of the talk this is a copy from from the previous slide so just remembering transaction ABCD bin logs are sing up to E EnoDB sings up to K and then we crash. Maybe it's a time for one question here before I move forward. Everything is clear so far? Okay, so let's see about the consequences of this. So if the master crash so we're only interested in operating system crashes like if mysqld crash we don't lose anything everything is in a buffer. So if a master crash and we're using legacy replication so file in position. So the slave is pointing in the binary log that will vanish. So after the crash mysqld will create a new binary log and if we keep writing data will be appened to the new binary logs but the slaves are pointing to something that is now gone. So during the crash the slaves are not able to connect to the master but after the recovery the slaves connect to the master and they connect in something that doesn't exist and then replication breaks. So that is obviously not cool because now you lose all your slaves. You can still write to your master which is kind of inconsistent. EnoDB and the binary logs are not in sync. You lost some data. The slaves are actually more data than the master because they didn't lose the last transaction. The master did. So you are not in sync and with broken replication this is really, really not cool. And if you have lagging slaves that are pointing in an old binary log they will keep going but they will have corrupted data. So everything is out of sync pretty bad. If you're running with GTID so let's say at the moment of the crash we have GTID up to 60 on the master and the slave adds up to 58 and then we crash. Now the master goes back up and because the GTID state is stored in the master the slaves start back in the binary log. The master starts at GTID 50 and so it will write 50, 50, 152 but the slaves are already 1, 2, 58 but those are the old transactions and now we have new transactions that have the same ID. So two things will happen here. Either the master will be able to write up to GTID 58 fast enough before the slaves reconnect and then everything will work but will have corruption or the slave will be faster it will reconnect while GTID 58 doesn't exist on the master and then replication will break because the slave has something that doesn't exist on the master and that will break. So that's another scenario where things break here and that's what I just explained. So that's in the case of an operating system crash. If the slave crash and we are using file and position replication if we are using crash-safe replication basically the replication position is in EnoDB so EnoDB will do crash recovery that information will be consistent and then the slave is able to restart to reconnect to the master. It's still as binary log that we cannot trust because now they're out of sync but there's no data corruption in EnoDB in this case. So if you're running with GTID with binary logs disabled on the slave which is a feature of 5.7 the position, the GTID position is also stored in EnoDB so there's no problem here. The data is safe, the binary logs on the slave obviously is out of sync with the data but the slave will reconnect to the master and the data of the slave will be consistent. But if you're running with binary logs enable because the position of replication is stored if you're running a slave with GTID and binary logs enable 5.6 or 5.7 the GTID position of the slave is in the binary log we crash, we lose binary logs we're out of sync between EnoDB and the binary logs and so we start replicating at the wrong place so again data corruption either replication will break or we will have silent data corruption so those are the consequences of running with this parameter. Something in MySQL 807 GTID position in EnoDB, unclear there's hardcore reading about this if you want more details and now we are at mitigating this so if you're running with sync bin log not equal to zero basically there's one thing that you need to remember is that either on the master or on the slave after an operating system crash you cannot trust the bin logs like obviously you didn't sync them you cannot trust the bin logs so what can you do in a situation where you cannot trust your bin logs so on a master after restarting MySQL after an operating system crash what I do is I make sure the master will restart in offline mode equal on so no clients connect to it no slaves no clients and then I decide as a DBA what to do the best thing is to fail over to a slave but if I do not automate failover if this is manual I do not want clients to write to my master and I do not want slaves to connect to it and here I arrive as the DBA I check if this is an operating system crash in which case I need to failover or maybe it's just a MySQL D crash and then I set offline mode equal off and then I continue because at that moment I didn't lose anything on slaves so on slaves if MySQL restart after such a crash if you have binary logs on the slave like you need to purge them like you need to completely delete the binary logs because now potentially you have a hole in there if the slave will eventually be a candidate master you cannot trust its binary logs so wipe the binary logs on a slave if you're running with GTID a reset master will erase your GTID position so you need to restore this Intermediate master are both master and slave so you have to do the two things when you're running with GTID on a slave with sing bin log not equal to one so GTID replication is not crash safe so normally what you would have to do is you would have to restore a backup and this is very annoying for a DBA to restore a backup so there's a way to avoid this it's because file and position in a table can be trusted at that moment so if you're running crash safe replication not with GTID with file and position there's some voodoo you can do here either if you're running single-treaded or if you're running multi-treaded with slave preserve commit order there's some voodoo you can do here to avoid restoring the backup and so the idea here is when the slavery starts make sure that replication doesn't start you cannot start at this moment the GTID position cannot be trusted but the file and position can be trusted so what you can do here is you note the GTID executed of that slave and then you wipe the binary logs reset master like the binary logs on that slave cannot be trusted then you restart replication with file and position which is trusted and then you need to restore the GTID position and this you'll have to figure out by yourself it's left as an exercise if you're not able to figure this out by yourself you shouldn't do this voodoo so that's how I run my slaves with sing bin log not equal to one so in conclusion like we saw the consequence we understood it we understood how to avoid it how to mitigate it so I have a guess an educated guess that more and more people would run with sing bin log not equal to one because of the cloud sinking in the cloud is very slow so you need to run with sing bin log not equal to one if you want decent TPS in the cloud and so to be fully cloud ready my SQL should make it easier for us DBAs to run in the cloud so basically I would like auto offline mode after an operating system crash and auto skip slave start after an operating system crash and I have two rants three rants on my favorite feature so like GTID makes things very complicated so there's a GTID state in the table there's a GTID state in the binary logs and now there's a GTID state not in the redo log it's an EnoDB so like there's clean up to do here and one last thing about GTID like somebody left but like this GTID state is just horrible so like we need a way to clean that sorry yes so I have links in my slides classic thing my employer is hiring please rate my talk and I have time for questions three minutes for questions yes Marco yes so the question is so the question is did I do tests about not syncing EnoDB and the context of that question is that in some next versions of MySQL Muradibi there will be features of keeping consistency without syncing EnoDB so like removing a sync instead of having two like you'll double my results like 200 transactions per second will end up being 400 which is very far from 3000 I haven't formally test that but I can do an educated guess here so it's a nice improvement to remove a sync in EnoDB personally I think it's not game changer we're just changing by a constant we're multiplying by two if I would have to choose between this feature not syncing EnoDB and keeping things consistent and making MySQL or Muradibi easier to run with Sync Binlog equals zero I would choose this one but it's like different people work on different part of the server so it's still an improvement but I don't think it's game changer other questions yes it's basically so the question is about having Sync Binlog equal to one so currently there will be inconsistencies like between the Binlogs and EnoDB it will remove one sync like doing one sync on transaction commit instead of two which in the end is not game changer because like we're still waiting for this so I haven't done test and thought much about it but my intuition here is it's not in the current context it's not super useful any other questions if I have time one last question yes would it make maximum persistence every time to one or if you don't have the throughput go to ok it's crash let's fail over so the question here is instead of taking each server and being very careful about the consistency of each server thinking about like MySQL as like the full distributed system and if the master crash fail over to the slave this is the solution in the case where you have an operating system crash on a master if you're running with Sync Binlog equal zero you need to fail over to a slave so because you potentially lost data and your slaves are corrupted so yes that's the solution the DBA needs to think about not one server but the whole distributed system which is like replication is a distributed system so we have to fail over yes I'm not sure I have time for another question but I will be out of the room if you have questions for me I'll be just out of the room and ready to answer your questions thank you very much


During the festive season, people usually purchase and consume more food than usual. The best way to ensure that food is safe for consumption is by handling, preparing and storing in a way that will prevent foodborne illness. Consequently, the Ministry of Health, Wellness and Elderly Affairs would like to take the opportunity to remind the public of the following food safety tips. Examine all foods carefully prior to purchase. Check for damages and expiration dates. Do not purchase canned foods that are unlabeled, dented, leaking, bulging or rusted. Keep foods out of the danger zone. Germs can go rapidly in the danger zone between 40 degrees Fahrenheit or 4 degrees Celsius and 140 degrees Fahrenheit or 60 degrees Celsius. After food is prepared, keep hot foods hot and cold foods cold. These foods must not be stored at atmospheric temperature. When reheating food, ensure that it is steaming all the way through, at least 165 degrees Fahrenheit or 75 degrees Celsius, or bring to a rolling boil. When large portions of food are cooked in advance, divide into smaller portions or in shallow containers, then cover and place in the fridge or freezer. Make sure there is good air circulation around the containers. When handling foods such as raw meat, chicken, other poultry products, and seafood, ensure that it is separated from cooked or ready-to-eat foods such as bread, fruits and vegetables. Use separate cutting boards and utensils for raw meats and ready-to-eat foods. Use separate utensils for serving dishes, especially when serving foods with a potential to cause allergic reactions. Before preparing foods and between handling raw meat or raw chicken, wash hands thoroughly with soap and water and dry thoroughly. When purchasing local meat products from butchers, look for the inspected and passed stamp which indicates that the meat has been inspected for wholesomeness by the officers of the Environmental Health Division. The Department of Environmental Health would like to encourage persons to follow these food safety measures as you look forward to having an enjoyable season.