Good morning, everybody, assuming you're in a European time zone. On behalf of the Cambridge Institute for Sustainability Leadership, or CISL, I'm really delighted to welcome you here for the launch of our report, Bridging the Gap, UK Business and Policy Leadership for Net Zero. This is a timely and hugely important report by our UK Corporate Leaders Group. It sets out the latest analysis of how business and government can and must come together to build on progress and deliver a much bolder climb of action. We're shortly going to hear from Elliot Whittington, who directs the CLG UK, and he will outline key recommendations from the report on how business and government can take leadership. Then we're going to open debate with the group's senior leaders and co-chairs on the priority actions that can be taken with some amazing examples. First, I want to say some brief words about the history of the Corporate Leaders Group UK and its core commitments to showcase business leadership, to champion the transition to a more sustainable economy, and to work in close partnership with policy makers. CISL founded the Corporate Leaders Group UK back in 2005 under the leadership of our institute's patron, His Royal Highness, the Prince of Wales, who's been a champion of our work for decades. The catalyst for founding the CLG UK was actually a speech by then Prime Minister, Tony Blair, who called on business to take a much stronger leadership view on climate change. And right from its creation, the CLG has been helping to forge and to strengthen consensus for this higher level of climate action amongst the UK business community. Now the CLG UK is far from thinking only within the borders of the UK. The group sits at the heart of a growing community of committed businesses and leaders, both across Europe and increasingly around the world. Today is actually a landmark for our expanding international collaboration. We're using the opportunity of the reports launch to bring the CLG UK's look and feel into line with our sister group, the Corporate Leaders Group Europe, and CISL's wider groups and networks around the world. Back to the UK now, within the UK, the CLG has frequently defined the government's response to climate change. The group spoke first and loudest in support of the UK's Climate Change Act, and it remains a prominent voice for much bolder climate ambition. For example, recently, the CLG coordinated letters that were signed by many business leaders, which called for UK law to enshrine a new target of net zero by 2050 and a more ambitious 2030 interim emissions reduction target. So before I pass to Elliot, where do we stand right now? As CISL's recent analysis shows, the UK has made significant progress with increasingly ambitious commitments by both government and businesses. However, this is not consistent across all sectors, and there is widespread recognition that we lack clear plans on how we are going to deliver against the targets on paper. And that is a huge issue for public credibility, for public buy-in and for getting a message out beyond the UK as well. Last week, as many of you may remember, the UK Climate Changes Committee issued a risk assessment which highlighted gaps and urgent areas to address and the importance of the UK accelerating the transition to a resilient climate-neutral, resource-efficient and socially inclusive economy by 2050. This call to action is, of course, very timely as we start the countdown to the COP26 climate summit in Glasgow in November, which the UK is hosting. It's a cliché to say that all eyes will be on the UK. But that international and national scrutiny is, of course, also an incredibly important springboard for us to look at the opportunities as well as the moral and economic imperative to take action. So with that, I'm so pleased to pass over to Elliot, who's going to outline the key recommendations in CLG's UK's new report. So over to Elliot and I'll come back to you in a moment. Thank you. Thank you so much, Claire. I'm very excited to be here and I'm very excited that we've been able to publish this report, which I think is a real new departure where rather than being solely focused on the challenge for policymakers or on the challenge for business, this is an attempt to really weave together those two narratives to recognise something that CISL as a whole and many other actors clearly and strongly recognise that business and government need to work together if we are to deliver on the climate transition and if we are to have a successful sustainable economy. So I want to just sort of talk through the overall narrative of the report and just to start with, as Claire has said, we are where we are because of the level of commitment that we now see towards net zero. This is a commitment that we have as a legal target in the UK, but it's also one that is shared by over two-thirds of the world's economy that we're seeing more and more businesses and governments sign up to that commitment. And if we are and that's something we're very pleased to see in the corporate leaders group because it is something that CLG has been championing for years and years and we've been very strongly behind that transition. But if we are to deliver on that goal, then we need to see the next 10 years as a really transformative decade of climate action. That's something that is recognised by governments and by many of the best experts looking at climate change. And to start on that decade, we need to see steps this year. There is no time to waste. Unfortunately, if we look back, the progress to reduce emissions, we have seen a lot of good progress. There has been increasing action and leadership, but it hasn't been consistent and hasn't been sufficient to get us on track for those targets. There is a gap between what we're aiming to achieve, what we're planning for and what we actually need to deliver. So what we're putting in place to deliver on that. So bridging the gap is all about how business and government can work together to bridge that gap, to raise the overall level of ambition. And we've looked both at the economy as a whole, which I will come to towards the end, but also specifically a number of key sectors, notably power, transport, buildings, and land use and agriculture. So if we start off by talking about the first of those sectors, which is the power sector. Now, our analysis is, as many others have been looking at, is that this is a sector where we have done relatively well in terms of the transition towards climate action in the UK. Doing rapid progress today in shifting electricity generation, it's been about improvements, it's been changes of fuels, it's been improvements in technology, it's been the changing structure of the economy. And that has a progress that has been supported by business action. So many UK power providers, for example, have got net zero or science-based targets, many provide 100% low carbon electricity already. And a number of companies on the demand side have also said that they want to buy low carbon electricity. The most obvious organized representation of that is the 43 companies representing 4% of UK power demand, who are part of the RE100 campaign and committed to procuring 100% renewable power. And that's also supported by strong policies where we've seen the UK has got a strong policy framework around decarbonizing the power sector. So this is a sector that was much bigger, but now in the accounts of a quarter of total UK emissions. But we think that there is more to be done. So if we move on to the recommendations for this sector, we very clearly think that this is there a need for action from both business and government. I'll start with the government piece. We have got a good set of plans. The energy white paper came out last year, and that does set a long-term vision. It's still not quite compatible with net zero. So there is a need to revisit and strengthen some of those plans. And also it's about more than the sector as a whole. To deliver on the net zero vision, we need to see electrification of the wider economy. Electrification is a way of letting the decarbonization of the power sector flow through into other economies that's also a really efficient way to use energy. And that means, and to deliver on both of those changes, we need more investment in infrastructure as part of that electrification, but also just for the transformation of the grid. And that's something that business can also act on. Business needs to be part of that investment environment. So they need to be, we need to see businesses just as many already are putting their money into that transformation. And we think there is a huge role for companies to continue to provide that demand signal and support of change. So Gary 100 has been held up by the government. There may be other commitments, but certainly companies should be looking to buy zero carbon power as one of the quickest and easiest ways of decarbonizing their footprint. The other thing is companies, whether in the power sector or whether in other sectors, such as home care or textiles or many other sectors, should be supporting customers to be more energy efficient. This is something that businesses from across the economy can do. And efficiency is a way of helping facilitate the transformation of the economy in a way that keeps costs down and actually helps our resilience overall. So there's actions for both business and government very much delivering the same thing, but working together and doing their own pieces of it. We come onto the next sector, the transport sector. So this is a sector where we've seen much less progress. So it makes up about a third of global emissions of the UK emissions, with most of those emissions coming from road transport, which have barely fallen over the last few decades where they have fallen. It's largely because of the increased efficiency of cars. We do have some very promising signs about the arrival and growth of electric vehicles, which have sustained when other kind of car markets fell during the pandemic, during the kind of really, really big economic impacts of the early pandemic. But there is much more progress that's needed to happen for the UK on track to reach its climate targets. And you can see that there is a lot of business action on this as well. We have nearly one in 10 company cars or alternatively fueled, mostly hybrids. We've got the UK Electric Fleets Coalition, which advocates that change accelerating. We have a number of companies, 44 companies with operations or headquarters in the UK committed to fully electric fleets by 2030. And all five of the biggest UK car manufacturers are committed to transition to electric vehicles and to reduce carbon emissions. So there was a big level of business commitment and there are some good positive signs. If we move on to our recommendations, there is much more to be done. So we think more and more businesses can sign up to some of those initial commitments. So whether it's joining the UK Electric Fleets Coalition, joining the EV at 100 initiative and basically committing to that transition to electric vehicles. But also that's not the panacea. There is more to be done to transform transport. And so we would like to see more from business that is supporting remote working, which has been obviously a big transformation of the economy during the pandemic, which we need to see sustained in many ways. And active transport modes and use of public transport, which have benefits including health and including other forms of efficiency. On the government side, what's really needed and it has been promised is the transport decarbonisation plan that will take some really good actions like commitment to phase out internal combustion engine and the investment in buses and trains that the government has but forward and bring that into a broader strategy that talks about how all of those actions will start to deliver at scale needed to meet our targets. As part of that, they need to create the certainty and they need to put the policy measures in place that will increase both public and private investment into the infrastructure that's required to transform this to deliver this transformation. Again, we've seen some good positive signs. It's not that the government have done a lot of things, including announcements made in the Prime Minister's 10 point plan for a green industrial revolution, but there is a need to do that at a more systemic and broader level. So the third sector that I want to talk about and I might actually just to make sure we've got time to hear from businesses might start to slightly accelerate and because obviously you can find the detail of this in our report, is the building sector. This is a sector that's really important to CSL. We've just actually, we're on the process of delivering a best in class renovation of our new office but it's a sector actually in the UK that has seen some progress but rather too much slow progress in terms of what's possible. There is a wide range of business action to date, including sector specific activities like REBA, ICE and the UK Green Building Council. And there are a number of UK companies signed up to commitments around net zero buildings or with net zero commitments overall who have significant building footprint. So the business sector is present on this and governments are trying to do it, but there is a need for acceleration overall. So if we move on to the recommendations here, what we've suggested is that the goal should be all new buildings should be net zero carbon in operation by 2030 latest. And that's something the businesses should sign up to and governments should be enabling to support certainly should make sure commitment that all new heating systems are low carbon by 2030. We also need a plan from the business perspective to decarbonise commercial properties which includes retrofitting existing buildings. And I think probably one of the other, the biggest things here for businesses in the sectors that they need to work together to scale up broader change in the economy both by advocating for stronger policies but also by supporting smaller businesses in the sector. There's a lot of SMEs in the sector they will need the help to transform. And then on the government side all of that change needs to be led and structured within a heat building strategy again something that government has promised but is yet to kind of unveil. And one of the critical things there is long-term incentives for energy efficiency. We've seen some great schemes such as the Green Homes Grant but they've been stop-start they haven't created the certainty in the market that's needed to transform. So on our final sector, the land use sector this is another sector where we have seen that this is a sector where it is really hard to abate sector it's complicated to transform but there is I think renewed appetite to deliver change in this side with things like the environment bill that is going through parliament but also things like the, you know on the business side we have the NFU representing 55,000 farmers have a clear aspiration for net zero the Food and Drink Federation representing 800 UK businesses has got the clear aspiration for net zero and there are many companies with value chains and operations in this sector who have ambitious science-based targets. So this is a sector where there is a lot of promising science but much more needs to be done. So if we move on to our recommendations we've very much said on the business side what's required is all of those kind of disparate things need to come together in a much more joined up sectoral based leadership. That means big business needs to work closely with farmers and identify a common framework for sustainable land use that people can come together around. There's also some specific actions about major land owners working to improve land management businesses sourcing from the agricultural industry need to work to enable the acceleration to low carbon farming practices but generally speaking we need a more joined up approach. On the government side we do have things like the agriculture act and the soon to be environment act but these need to be joined together in a comprehensive decarbonization strategy and some of the kind of things highlighted in those pieces of legislation need to be urgently implemented like banning unsustainable land use practices such as peak burning and implementing an environmental land management scheme. So both of those are the things that the government is due to implement but we need to get on with that and see that implemented. So if we take finally to conclude if I look at the overall economy basically the story is the UK has done a lot of climate leadership to date and business at the UK businesses have done a lot as well. So we have over one in 10 companies with a science-based target are UK headquartered but there is a lot more to be done on both delivering our net zero targets and staining up business action with over half biggest companies in the UK not yet signed up to race to zero any other climate campaign. So what we're recommending for this is that what we need to see from the government is a net zero strategy, something that has been promised that brings together this level of change and really accelerates some of those lagging sectors. What we need to see in terms of recommendations for business is a greater focus in signing up to the race to zero campaign and setting those kind of commitments but also delivering on that by developing and marketing low carbon goods and services and by working together to drive wider change. The conclusion here is very clear we can deliver on the net zero transformation there is a lot of leadership already but we need both government setting the right strategies that can guide business action and unlock investment but businesses delivering on that action and backing that level of wider change. But if business and government come together we can really enable the scale of change required which will include a number of steps like enabling wider change in terms of consumers and supporting small businesses as well. Thank you very much. I hope that people in the audience will check out this report, it's a great piece of work. Fantastic, thanks so much Elliot. And just a quick reminder that you can put your questions in the chat box and our moderators will pick them up and pass them on to the speakers. I just want to pick up one thing in the context of modernizing the UK's building. Some of you but probably most of you won't know that CISL itself is taking on a top new UK standard. We're doing a low carbon retrofit of an older building in the very heart of Cambridge and the learning journey with builders and contractors really across the spectrum is absolutely groundbreaking. So we're capturing our own case studies in terms of material science, energy, the human side of it who works, who learns on the project and we'd love to be sharing that with you through our website through this group and other sources because it's a complete UK first. With that, on the question side, one thing I've seen in the chat box already although it's not the main topic of this report is interest in behavior change at the level of consumers, homeowners and so on. We recognize that's a vital part of the progress pathway and it may be something that speakers may want to weave into their own remarks. Now I have the great pleasure to introduce our chair for the debate going forward. Peter Simpson is a wonderful friend to CISL. He has been the chief executive of the Anglian Water Group since 2013 and he's a founder and co-chair of the UK Corporate Leaders Group. As you see from his bio, Peter wears many, many hats but he is somebody who really sees the art of the possible and I think he's going to give you some extraordinary examples now. Peter, thank you so much and now I'll pass over to you. Thank you very much indeed Claire for that very, very kind introduction and every time I see that photograph of myself on the slide there, I find it fairly horrific. I think it's the worst one I've ever had done but so I'll have to change that. As you've heard, Anglian Water is the company that I'm proud to lead. We're right at the heart I suppose of the impact of a change in climate and we're a water scarce region, long coastline, very low line so it gives you some sense of the vulnerabilities we have to that changing climate but also we have a big carbon footprint because a lot of the water in particular has to be pumped around the region, we use a lot of power. So we've set our ambition to build resilience to drought and flood and also to become net zero by 2030 as a company and that's very much about the heart of what we're trying to do. In terms of this report, I really do kind of recommend this to you. I like the fact that it highlights that perhaps the obvious thing that we can't do this alone, we have to work together, we have to work as business and government in sync and we all have to commit and plan for net zero but I also like the fact that the report is increasingly getting into the how we can actually go about achieving that and focusing on the knotty issues like decarbonising, building stock and looking at what's happening with transport but also bringing out opportunities in areas of agriculture and land use which we very much see. I suppose our experience has been that particularly when we look at infrastructure there are some fantastic opportunities when you take a journey to decarbonise. One of the sort of recommendations in the actions is about construction companies getting together to work on reducing carbon in construction. Now that's something that we did as a company back in 2010 we set ourselves an ambition of halving the capital carbon and everything we build and last year we achieved 61% against that 2010 baseline. So that might be very interesting but at the end of the day we've managed to do it by saving a huge amount of money as well probably 20% things are costing us 20% less than they did back in 2010. As a result of collaborating with our supply chain aligning on what's important in terms of carbon and allowing those organisations particularly some of the SMEs which are referenced in the report to come forward and encouraging them to bring forward new innovations that enable us to achieve those things. So there's real, I suppose one of the messages I'd have around this stuff is we have to talk about opportunity not just how difficult it is and the challenges and what's still left to go. There's real opportunity here for businesses and for us that has, you know that target around capital carbon has been a big one but the supply chain and having alignment through the supply chain has been has been terribly, terribly important. I mean, another great example it happens to be today we're releasing as a company another green bond the very first green bond of its type for any utility in the world which links raising of finance for our investment programme to our net carbon targets. So by making clear commitments on the journey to reduce capital carbon and operational carbon with milestones at 2025 and then the result at 2030 which is our target if we do that we'll get lower cost of finance which is good for everybody including our customers but if we don't do it there's a kicker there's a penalty associated with it and our interest rates will go up. The great news about that is there is an enormous wall of finance sometimes called green finance out there I spent many days talking to many, many people out there in the financial markets and any business that isn't tapping into that is missing a huge opportunity if they genuinely are on this journey and if they're doing all the stuff we're talking about in this report that they should be able to access that. The other thing I think that's worth highlighting which we spent quite a lot of time recently on is this whole agriculture side and change to land use and like all water companies in the UK we've committed to that net zero target by 2030 and we want to do the hard stuff to get there but at the moment there's still a residual sliver of carbon that we see we'll have in 2030 so we've been working to develop markets to actually think about how we might offset that carbon and it's clear that with relatively small changes to land use practices an awful lot of carbon can be sequestered. I think we identified that for a one if there's just a 1% increase in the ability of soil to hold carbon across 1.5% of Anglian waters region have been closed farmland that would be enough to offset all the residual carbon for the water industry. It's kind of the last thing in the hierarchy we're getting to but it's a good example of just how powerful the issue of how we're thinking about managing our land can be on this journey and of course there are opportunities to layer on other benefits in terms of improving the natural climate and increasing biodiversity which are things that we think are possible to layer on the top and get there but there's an awful lot of work to do that and we do need to work, it's a great example we need to work in tandem with the government it's very important that the environmental land management system when it comes out it fits with what we're trying to do as businesses and it doesn't cut across it or create disincentives for people to do the right thing. So a lot of opportunities I think we see on that front as a company but also as a sector and the last thing I'd say really is we've seen the power of getting an entire sector behind an ambition so all the water companies in the UK have signed up to achieving net zero by 2030 and the power of that is that we're all working together on what does that mean in terms of innovation and what does it mean in terms of collaboration? What does it mean in terms of standards for for example water efficiency going back to the point that Claire was making earlier what does it mean for standards that we need to see in new developments when we combine power and water efficiency together and can we get some common approach across the UK? Well a lot more chance that we're all collaborating and working together than if we're all doing our own thing and it's really we are the only sector I think anywhere in the world who's made that sort of commitment with a whole range of companies which is something we are particularly proud of. So just some initial I guess reflections from me on kind of how I thought about it really from an Anglian point of view in the report I think it is very much about the rubber hitting the road but I would like now just to let my co-chair or the co-chair of the corporate leaders group with me Colin Matthews just to say a few comments on the report from his perspective and Colin is the chairman of EDF in the UK and normally has some useful things to say so I'm going to hand over to you Colin. Thanks very much Peter and I thought I'd take the opportunity to focus really on the power electricity generation element within the report which of course is the area where EDF is investing so strongly and the report highlights some remarkable progress in decarbonizing electricity generation. I wanted to point out what I think are a couple of key success factors in the progress that's been made and I think both of them play well to UK's strengths. The first is good government policy by placing a consistent flaw under the price of carbon for instance for many years now the right incentives were in place. And then the second key success factor is was the fiercely, it has been the fiercely competitive delivery market whereby as more and more wind turbines and solar panels were installed the costs of that have come down and the results of that are fantastic and we're all delighted to see that. Nonetheless, as the report makes clear there is still a gap, there's more to do. So I'm delighted to see the emphasis in the report on ongoing investment in low carbon infrastructure, electricity, electrical vehicle charging points being an obvious example. Also on the responsibility of companies to make it easy for consumers to adapt to reduce their carbon consumption. I wanted to highlight a couple of things that I think are gonna be key in bridging the remaining gap because no one is saying that renewables even with storage will get to a hundred percent there is still a gap to be made. And the two areas I wanted to speak about are investments in the grid and secondly investment in large scale nuclear power plants. In the grid, the bigger percentage coming from intermittent and widely distributed sources means massive investment. Also we need investment in the grid to enable for instance, electrical vehicles to be charged perhaps automatically when the supply of electricity exceeds the demand. And in the case of filling the gap after renewables have done all they can with storage for the longer term, a number of great technologies being developed which everyone hopes is going to come online as soon as possible be that fusion, be that hydrogen and other examples. But with respect to options that can be built today EDF thinks large gigawatt scale nuclear is really the only one on the table. And in those two areas, building, investing in the grid and investing in large scale power plants I think it's a slightly different combination of success factors that are needed. We still need good consistent policy. The energy white paper is a great start in that we need the right incentives in place year after year to get the right outcomes. But I think slightly differently in these areas we need more collaboration between government and delivery. Why is that? Well, there's only one grid and there aren't going to be that many new gigawatt scale nuclear plants. So we cannot run 10 competitors one against the other. We need better collaboration. So I'm fully behind this report emphasis on business getting behind government, government getting behind business to race ourselves to success in the race for net zero. Thank you Peter for the opportunity. I'll hand it back to you. Thanks very much indeed Colin. Always thought provoking as always. So I'd like to now sort of widen out to the broader panel and I'd like to introduce Kerry who's the president of full packaging as it's shown and Steven, the CEO of Signify both of whom have got somewhat better pictures than I've managed. So I need to take some advice on that. You're very, very welcome. Perhaps I just go to both of you briefly just to give you your reflections to start off for a few minutes and then we'll open up to some questions. So Kerry, perhaps over to you for your initial reflections. Certainly, thank you. Thank you, Peter. For those that I haven't met, I'm Kerry Causey the president of Ball Corporation for Europe, Middle East and Africa. I've been with the company about seven years, three in North America, two in South America and most recently two in Europe where I live just outside of London and the UK. Ball Corporation is the largest aluminum can manufacturer in the world. We have over a hundred locations globally about 21,500 employees. It's safe to say that unless you have never consumed a can beverage in your life, you've interacted with our products. In the UK specifically, we operate two can plants and our European headquarters with just over 1,100 employees. Aside from what we make, who we are is equally important. And I think that that ties so nicely to the discussions we've already have and will continue to have. But we're a market leader in sustainability for the packaging industry. Our products are infinitely recyclable. We've set science-based targets to challenge ourselves further on climate impact. And in the coming days, we'll announce even more ambitious goals. And so be on the lookout, we're excited for that. Thank you very much for allowing me to participate in the panel and express our support and commitment to the changes that we're all driving for in terms of leadership for Net Zero. Not only is it important from a business standpoint, but I personally also think and find that it's a very important ambition. So thank you. Are you carried to Stephen? Yeah, sure. So as well, for those of you that don't know me, I'm Stephen Root. I'm the CEO of the UK and Ireland for Signify. Now Signify itself may not be a name you're familiar with, but we're essentially the old Phillips lighting. So as Phillips lighting or Signify, we're the world's largest lighting company. We've been operating in the United Kingdom for over 70 years, but our sort of the carry's point, we're everywhere. If you haven't used a light bulb, then you probably haven't heard of us. We've been strongly supportive of initiatives like this, like the corporate leaders group. And importantly, instead of talking about it, we're really firm practitioners about what we do. We've been carbon neutral Net Zero since 2020 across scopes one, two and three, using 100% renewable electricity globally. And during this time, we've managed to reduce our carbon footprint by, I think it's about 60, let's say 70%. And that was the last five years. And now we're on a new five-year journey. Again, focused on science-based targets. We already have an approved pathway for one and a half degrees and we plan to reach that in half the time by 2025. So more broadly, now we're working with customers and our suppliers to really help everyone become more sustainable. So we're offering solutions like highly efficient LED lighting, connectivity and controls to help our customers basically go further. With controls, you can do things like optimizing daylight, harvesting and so forth. And this allows you to reduce the electrical use of your lighting from conventional by 50 to up to 80%. So a huge sustainable savings. Just putting this in context, historically lighting accounted for about 18% of all electricity use worldwide. And with these solutions alone, so LED lighting controls, we've been able to reduce that from 18 down to 13. And when you take a look at today and where we are globally, we can still take that further. So everyone says we can go from about 13% globally down to 8%. So a huge opportunity worldwide to basically improve energy efficiency just by investing in lighting. It's as simple as turning in a light bulb sometimes. Now at the same time as Signify, we're launching new solutions like solar lighting, agricultural lighting for greenhouses, vertical farms that allow for more efficient land management as well as improving efficiency and wellbeing of things like fish and farm animals. Plus, you talk about manufacturing, our 3D printed lighting products allow for a 47% lower carbon footprint than traditional luminaries. So allowing for a fully circular solution. So a lot of the things we're really trying to walk the talk on. So sustainability in Signify is really in our DNA. We've been on a journey for the past five years, a strong one, and we've really set a strong set of ambitious targets for the next five. We're really even more focused on helping our customers and suppliers. So when you look at initiatives like this one around bridging the gap, helping the UK get to net zero, we're a huge fan. It touches on key elements like power road, buildings and agriculture, as well as the overall economy that we're all supportive of. I'd echo the report on what Elliot mentioned earlier. I think we've been too slow. We can be faster. As Signify, we've really pushed ourselves to go as quickly as we can. And I'd encourage you guys as well. It's heartening to see so much action and commitment over the past year, let's say in the UK, but I'll say politely, I'd love to challenge all of you in this race to go a little further, to push faster. This goes for companies like ourselves where there's a lot we can do and we can go early. We can start now. If you say 2050, make it 2040. If you say 2030, can you do 2025? Could have pushed you guys. And then from a government standpoint, we need to make sure that we've got the right policies and regulations in place to encourage businesses, individuals and the governments themselves really to take more action. So happy to be a part of today and always happy to play Q&A later too. Thanks. Thanks very much indeed, Stephen. I appreciate that. I'm just picking up on perhaps one of the points you made just then and going to Kerry.  But Carrie, how might we, what sort of advice should we be giving to businesses and business leaders who have kind of not grabbed hold of this net zero target and not even signed up to the race to zero? What is it we should be saying to them? Yeah, I think, you know, my advice is to get started if you haven't already. There's so many professionals waiting to help companies of all sizes tackle that.  And sometimes it can be a bit daunting. But most importantly, most of us like to think of our companies as leading something, leading a change, moving, changing, growing. And the science-based targets initiative is a way to affirm your industry leading efforts to help accelerate the transition to the slow carbon economy and limit global warming. And private sector has such a vital role to play in accelerating the transition. It can't just be government saying one thing, businesses doing another and, you know, the financial industry yet another. Those things have to be able to talk to each other and work in concert. And so at ball, we're dedicated to doing our part. We were the first in the can-making industry with an approved science-based target. Demonstrating our commitment to help our customers reach their sustainability goals. You know, you talk about scope one, scope two, scope three, scopes one and two, not too terribly hard to measure. Scope three is really challenging. And this is part of how we're helping our full value chain, our full supply chain. We've committed to 55% absolute reduction in our own operations by 2030 and 16% across the entire value chain by 2030 as well. In just some examples of some of the actions, one of them is something that's fully within our control. You know, we have 100% renewable energy in Europe, including two virtual purchase power agreements. They cover about 63% of our electrical demand. Looking beyond Europe, Ball was one of the top 10 renewable energy buyers in the US in 2019. These are things that do require collaboration, but they're pretty straightforward. You can find a counter partner and move ahead. Another example, and it's a bit more challenging, but it's definitely worth it, require significant collaboration across the full supply chain. So for us, our vision is that we have to work together with beverage brands, retailers, aluminum suppliers to achieve a 90% global recycling rate for cans and increase the global average recycled content. And the reason that's important is because recycled aluminum only uses 5% of the energy compared to using virgin material.  And so I give these examples because I can't imagine necessarily what this looks like for each of your industries, but you have to be creative and you have to dig in and take the first step because everyone's learning as they go. It's not like there's a perfect pass that's already set up for every industry. So move. Yeah, some really good examples there. And in sort of looking at your organization prior to this, an organization I didn't know very much about, frankly, I was really struck by your statements about wanting to be the best stewards throughout the product lifecycle. And I think people tend to take segments of the carbon journey and forget what the overall impact is. And you're an organization that clearly doesn't do that. Stephen, there's a question that's coming from Brigitte from Make UK about, and essentially it says many manufacturers are willing to improve their plans. However, they're often leasing them and they would need to negotiate with their landlord. Could a standardized type of agreement and streamlined system facilitate this and couldn't it be put in place before 2030? And isn't that something we should be doing? I guess in your business, you must come across some of those dilemmas. Any feedback on that? Yeah, if we can agree to a standard across the UK, that'd be awesome. Whether regulated or just, whether by industry or not, globally when we look at lighting replacement, for example, we're often the building unit itself is owned by a third party and often we have to work with our customers on sort of having negotiations with the third party to say, we want you to do the installation because it's doing the right thing for the overall environment and will help cut electricity usage as well. I'd love to see a standardized agreement. And I think that would be something that'd be admirable to try and have in place by 2030. I'd be curious if it'd be something from an industry body standpoint with just some of the major real estate players, some of the major manufacturers, if it could be agreed. I'm not sure. I'd love to see it, though. Excellent. Carrie, just thinking on that sort of building theme and sort of building on that, what if we think about the heating and the heating building strategy, it obviously provides an opportunity for government to deliver some sort of concrete and sort of long-term proposals. What other actions do you think businesses could take to support decarbonisation in that particular sector? And I'm just thinking particularly about, again, looking at your organisation, you've done an awful lot of work. I know the US Department of Energy did a lot on sort of benchmark manufacturing, didn't they? Better buildings, better plants programmes and that kind of thing. Just interested in maybe some of those reflections. Absolutely. If you think about big and bold moves, it would be a fantastic example and really, this comes from your report, I think, for construction and real estate businesses to make commitment to set science-based targets ahead of COP26. There's so much room to step forward and lead by committing to those things. But what you mentioned in some cases is just the smaller and practical items, which are important. So, simple adoption of smart LED lighting systems with motion sensors, we've done those in our offices, can have a great impact. So, again, using industry associations to benchmark and thinking about moving things from gas-powered to electrical, etc. And just being thoughtful and being intentional and mindful about what you're doing and the decisions you're making every day. How are you spending your capital? Are you putting those dollars into something that's going to help you towards your goal? Or are you just doing what you've always done because it's easy to sign the P.O. and send it out the door instead of taking just a few minutes to really have an impact? Yes, yes, it's a great example. Just in terms of transport, I mean, obviously that, as we saw in the report right at the front end, is still a significant contribution to UK emissions and 90-odd percent coming from road transport. What other steps do you think, and I think it's back to you, Stephen, what other steps do you think the UK government and businesses in particular could take on that journey to achieving net zero by 2030? And the emissions reduction target by 2030? Yeah, for transport, it's something we looked at a while back. Just, you know, we've been working with Maersk and their carbon-packed, focusing on utilizing most sustainable shipping vessels. Initiatives like this always you can take to the road as well. Just working with your transport companies, they listen, we want the most efficient vehicles possible. As signified, we've also signed up to EV100. All our employees worldwide have to shift to electric vehicles. It's not easy. And the UK market, I think we were the second one to do it. But it's something you just have to do. So for corporate, I think we can really start with really improving operational efficiency in the transport network, working with your logistic service providers to decarbonize their fleet. I think sends a demand and helps just drive the shift for the transport companies themselves. From a government standpoint, you know, two key things for me. One, increase the percentage of electric vehicles on the road, support the infrastructure, charging poles, and then the legislation to help basically phase out fossil-fueled cars, which I think we all agree is kind of the right thing to do. And then how do you incentivize and largely increase the use of clean fuels? Biofuel, biodiesel, hydrogen, in-road transport. So a couple of those things that both from a government standpoint can give us a push. And then from a corporate standpoint are just some easy things that we can sign up to and some necessary things that we have to sign up to. And Colin, I know you're going to do a sum up at the end, but do you have any reflections on that as well? I'm just conscious of your important role as EDF in enabling this sort of transition. Well, we know that to enable, for instance, electric vehicles and ultimately heat as electricity as a source of heat in buildings, to some degree, we need to double the electricity generation across the grid as a whole. And we need to quadruple the renewables element. So it's an absolutely massive, massive investment that's required. And hence my comments earlier about how much needs to go into the grid. Actually, with respect to the firm power, it's closer, with the case of nuclear, it's closer to maintaining, rather than growing the percentage that our challenge in the UK is that the existing nuclear fleet is coming towards the end. And therefore to stand still, we need to replace those units, which we're doing currently in Hinckley Point and we're proposing to do the same thing again in size well. But the numbers are just massive. And yes, we need electric vehicles and brilliant, but even companies who are not directly involved can have an impact by switching their fleets as Stephen laid out. So I think we can all drive this, underlying it though, there is a massive implication for the power generation sector, which is key to us getting to our target by 2015. I think about the renovation or as you're renovating buildings as well, we now need to put the charging infrastructure. So as we talk about, let's have everything renew, net zero buildings by 2030. As part of that, we really need to change as we renew buildings, the charging infrastructure needs to be in place pretty much everywhere. And so that really changes the way we design buildings in some ways. Exactly right. And I think in a sense there's a phased approach to charging points at people's homes, definitely, but as Stephen just said, you need to have charging points where people work so people can charge during the day. And then ultimately you also need the mid-route so people can facilitate long journeys as well. But by breaking it down into those phases and getting the right technology for each type, actually it's doable, we just need to get on with it. I think you mentioned something important earlier, which is showing the demand signal, because so many companies don't own their own fleets. We don't own our own fleet, but it's important that we are letting our suppliers know what's important to us. Because if we're not willing to put our goals and ambitions into our everyday business of how we're moving forward, then it's not gonna change that. And those trucks are critical to our business and it has to change. So again, being mindful, being thoughtful and intentional about going to the market and talking about what you wanna do and what you need to be successful is important. And those companies who are owning the fleets will be heavy asset owners and therefore highly dependent on finance. And Peter, your reference to the wall of green finance will be relevant in that sector too. So by bringing these different drivers together, I think the, well, it's certainly gonna happen. The question is, can we make it happen quicker? And I think we can. Yeah, absolutely. And different thinking, I think. I mean, think about our sector in the water sector. We've got huge opportunities from biogas and biogas opportunities linked to hydrogen could give some answers perhaps to the heavy fleet, which is one of the naughtier issues in the heavy vehicles, which are more difficult in the first wave of electrification to kind of manage. A bit of different thinking, bit of different innovation. There was another question that came in earlier on, which was just, do you think, given the global supply chains that many of the organizations here are part of, that countries going at different places on this might actually restrict the pace at which those companies in the supply chain are prepared to move that? Do you see that as a barrier? I don't think, oh, sorry. No, I think there are two ways to think about it. And you mentioned this earlier, we can think about these things as challenges or we can think about them as opportunities. Yes, it would be much more efficient and easier to have global understanding of international shipping and all of those things. And we may need some countries and leaders to step forward and push the rest and really stand forward and start to drive it and others will be forced to follow. There's a bit of an inevitability to that. So it's a bit of a double-edged sword. But think of it this way, if we can all agree that sustainability, net zero becomes the base minimum for operating at least in Western countries and so forth. So you need to be a sustainable company and we look at from the front all the way to the back. If you want to be a country that basically has manufacturing capacity located locally, you'll be pushing for your own manufacturing sites to basically be as efficient as possible because that will be what's attractive to other Western countries to utilize. So if you end up being a country that says, no, no, actually we're gonna do something completely different and not do the push towards sustainability, then as a manufacturer, sorry, as a company, I will move my manufacturing sites. I will have to pick somewhere else and that becomes just as part of the base minimum. Everyone will need to do it. We'll end up pulling them along. Yeah, it's a really good point. And the reflection I was making earlier about that sort of engagement with the finance community, feeling very, very different now to how it did only a matter of a few years ago and it's ceasing to become a differentiated, become a hygiene factor. I don't know how you're gonna be able to go and raise finance soon at competitive rates if you're not on the journey and then it becomes about the opportunities from being even more ambitious. So last question from me, from a hand over to Colin to do a wrap up. It's always the difficult one right at the end. If there was one thing, if there was one thing in terms of the long-term strategy for the UK on its ambition to get to net zero by 2050, what would it be if you could have one thing? So Stephen, do you wanna kick off with that? I wish it was one thing. I'd say for me really a long-term view with bold ambitions. I think we've got that, but the short-term set of clear actions and incentives to basically drive all the efforts embedded in this, I think are really needed. We've got the long-term vision, we need a short-term set of actions and incentives to get people going. I think time-based regulation and funding personally helps encourage some of this near-term action and gets organizations walking the talk. Bluntly, we all have to start racing now. So I look for just sort of any sorts of accelerators that basically get companies going over the next one, two, three years as critical to helping this make this happen for the UK. Thank you, Carrie. Yeah, I think from my perspective, it really comes down to the financial part of this and that's come up a couple of times here. I mean, we can't forget we are, in order to exist, we do need to turn a profit. We have to be profitable businesses and support our customers and do all of those things. And that means that the money has to match action. It has to drive and reward value and value has to be a bit redefined in this context. And so having the financial industry go on this journey allows companies to do this the right way and keep people employed and keep moving forward and achieve both goals, not just one. That's a great point. Right, well, I won't ask you that question, Colin, because you're going to do the wrap up. You could still answer, I suppose, but I'll hand over to you to wrap up. Thank you very much indeed. Appreciate your input. Brilliant. Well, I'm really returning, I think, to the key themes in the report in wrapping up because the comments and the questions have pushed us in that direction. Firstly, we do need the strategies. We need the policies. We need the incentives set clearly from government. And Stephen highlighted one in particular, I think, in the EV world. We've heard the ambition for companies to switch their fleets. We need the incentives in place so that those charging points are put out there. I believe, though, the government will do a better job in that policy if they know that business is standing behind them to deliver. And then business. I suspect the people on this call have probably selected ourselves and we probably are largely people who have signed up to the race to net zero. Great. If there's anyone on the call who hasn't, I'm sure after this, you will do so. With any luck, but probably the more relevant message is our ability to encourage others to get on board, whether they're smaller companies, whether they're in our supply chain. I'm struck to something Kerry said, which raised the question about the range of countries and how quickly they're going. I think it's clear that here in the UK, we would rather be in the front than in the back of that queue. So let's get on with it. Let's be setting the example. I think there are areas in which we've already done so great and no doubt other areas where we can learn from other countries. So let's position ourselves in that leadership role. I do think, though, that in the UK, we have a certain political culture, a certain industrial culture and we put a lot of weight in market solutions, which is great and has delivered great success in many areas. I think the challenge in getting to net zero and its comeback from, I think, all of the contributors and the questions is we need to integrate the efforts of business and government more effectively. And sometimes I think that's not quite so natural for us in the UK where we make such a separation between different businesses, different organisations, public sector, private sector. And so figuring the right way to bring those efforts together and align them to win in this race to net zero, I think is one of the challenges and one of the things that we need to figure out how we can do it, how government can confidently work with business without feeling they're gonna be undermined by some anti-competitive process or whether business can confidently work with government without fearing that the strategies are gonna be changed halfway through delivery stranding the investments that we make. So I think that's a challenge for us here in the UK. But in any event, huge ambition and enthusiasm around this core, which I think is widespread to get on with it, to get on with the race to net zero. So let's do so. So I'm gonna wrap up by thanking Claire and Elliot, Peter and Carrie and Stephen and the whole CLG team for today's event. And thanks for CLG for developing this report. Everyone who's on the call, thank you for your participation. Read the report, share it and let's get going in the race to net zero. Thank you very much indeed. Thanks everyone.


Good afternoon, everybody. Thank you for joining me. My name is Daniel Jones, and I'm CTO of a consultancy called Engineer Better. We help people with Cloud Foundry. We also help people use Cloud Foundry and get the most out of it. This talk is about service-oriented design when applied to microservices. And we've worked with customers in the past who have been trying to move from monoliths to microservices. Sometimes that's gone really well because they had well-structured monoliths in the first place. Sometimes they've really struggled because they had too many blended concerns in their monoliths. And this made me think that before microservices were the new hotness, 15 years ago when I first entered the IT industry, I worked for a financial company whose trading system was built using service-oriented architecture, so message-oriented middleware. And all of the design patterns that I learned then apply now to microservices. So this session is about trying to share some of those ideas and act as a bit of a reminder that a lot of the hard problems about microservices are not about using the latest Spring Cloud implementation of a Netflix pattern. It's just old-fashioned distributed computing. So we'll be going through some ideas, some patterns at a very high level that you can apply when starting a new project, when building a monolith, that then will make running it in a distributed microservice architecture easier. So the executive summary, microservices are a deployment concern. How you do things with circuit breakers and service discovery, that doesn't impact your business logic. It shouldn't do. They're a deployment concern. And you're probably deploying that way because you either want resiliency or you want scalability. And that means that you end up with a distributed system. Distributed systems are hard. They're hard to reason about. All the things that worked when you were working with one process, with a lot of certainty, and you took for granted, you can't do any more. But luckily, distributed systems have been around for a while. In fact, I was talking to Dr. Jules, who PMs the Garden Project, about this the other night in the bar. And he pointed out the Lamport clocks where the paper on those was written in the 1970s. So this stuff has been around for a while. So if you practice service-oriented design from the start, you'll end up with an app that's easier to split into distributable chunks. And your code will be easier to reason about, which will have immediate benefits, even if you choose not to split it out and distribute it into microservices. One of the things about this, and the original abstract that was talked about taking through an example using Spring Java app, a lot of frameworks for the sake of productivity make it very easy to get things done quickly, but by munging together concerns and putting too many things in one place. The Cloud Controller is a good example of this. It's a Ruby on Rails app that could be written really, really quickly. But it also means that it's hard to evolve, because some of the JSON representations of objects are exactly the same as the database representation, because there's a one-to-one mapping and lots of metaprogramming magic going on. So the kind of thrust of this talk is think about some architectural concerns to start off with. Don't necessarily do the easiest thing the framework puts in front of you, and you'll have an easier life in the future. So the world before microservices was fashionable and trendy. It looked a lot like this. If you had things that needed to talk to each other, they did so via the enterprise service bus, which was normally manifested with messaging or into middleware. You would send a message. You didn't know who was going to receive it. The message broker would make sure it got to the right place. Why did this fall out of fashion? A number of reasons. But one is that, as you can see in this diagram, the service bus becomes a linchpin. It becomes a logical linchpin. It becomes a scaling linchpin. When you get to the scale of Netflix or Google or Amazon, this isn't going to work, having one central thing that knows where all of the services are, so it can route messages to them. The only way to get around that problem is something that looks like this, which I'm not sure is necessarily more simple or more elegant. We take the logic from that service bus, and we distribute it, and we push it down into each app. So all of that functionality about retries, and temporal decoupling, and routing, and finding out where things should go, that goes into every single app. If you're going to operate in this way, and you want microservices, and you want to have more than one instance of a thing, you are going to need to prepare to optimize for availability over consistency. We do get people that say, I want to do microservices. I hear they're cool. Can we put some distributed transactions in? The answer is, you really don't want to do that. Fortuitously, last night in the bar, probably about half midnight, a friend of mine who works for a software vendor came out with this classic quote, which was quite lucky, that transactions are for lazy architects. OK, transactions, we put in systems to stop bad things happening with our data. It's preventative measure. When we have to deal with eventual consistency, which we do have to do as soon as we have two instances of a thing running, then we instead move to a world where we have to remediate bad things that have happened. We don't try and prevent data getting inconsistent. We allow it to become inconsistent, but we make sure we deal with it at a later date. We'll do something to detect and then act on that divergence of history. So in this whistle-stop guide to future-proofing monoliths, there's kind of three broad strokes of things that we can do, going from the quite easy and the quite straightforward to the, this is getting a bit more complex now. This is adding a bit of overhead to our code. First up, separation of concerns. I mean, really when we get involved in moving apps and breaking them apart, that's normally the number one thing that causes a problem, like fairly straightforward stuff of, well, that class is doing too many things. This knows about the database and it shouldn't do. Then we start talking about communicating via events rather than direct RPC, direct method invocation. That in itself isn't necessarily going to help with moving to microservices and dealing with eventual consistency. But it gives us some benefits that we'll see in a moment. And it also allows us to handle eventual consistency. So what do I mean when I say services? The opposite of a rich domain, fat object. You read an object-oriented programming book from the 90s and they probably should have said, well, you've got a user object which has a save method and it has an update method and it contains all of its state and it knows about all the behavior of things that can be done with it. I think we've all moved away from that now because that ends up with these objects that know about all the things that can happen to them. So my definition of a service is a thing that does a thing with a thing. It's really quite succinct that. And they should be stateless. So they receive some kind of communication in. They do something with it. They chuck something out the other end or they have side effects and change the state of the world. They don't hold state themselves until maybe when you start event sourcing, but we'll get to that in a minute. Now, somewhat embarrassingly, this is still in my slide deck. So if you can imagine there, like a large object called user or something with a save method and a get name and a set name and all that kind of stuff, that's what I'm talking about when I'm talking about rich domain objects. This is the sort of thing that I'm talking about when I'm talking about services. So I was trying to come up with some really trivial examples to demonstrate principles in this. But this is the kind of thing. We've got a domain service that knows about accounts that can have transactions acted on them. It gets set up. It doesn't hold any state. When something needs to change, it gets told, arguments. It does the business logic. And then it asks someone else to do the persistence for it. So that's the kind of thing that I'm talking about when I'm referring to services. Now, the thing that I really hope, if this is new to you that you take away from this talk, is this. If all of the rest of it gets confusing later and quite complicated, this is the main bit. This pattern of these four layers, I think applies to pretty much every system I've ever worked with. At the top, we've got gateway services. So the gateway's job is to translate from the outside world into our domain. Be it HTTP, AMQP, even if you write a CLI tool, the entry point into your application that then parses command line arguments, that's your gateway layer. It doesn't want to have any logic in it. It just wants to be able to translate from the outside world into something meaningful that we then understand as, oh, right, somebody's trying to achieve a thing. The orchestration layer is below that. So the gateway doesn't do anything king whatsoever. It's just translation. Orchestration knows about workflow. So maybe in a software service, when we register a new user, the orchestration gets one request from the gateway layer saying, register a user, please. The orchestration tier is the bit that knows, right. First, I've got to go and write some records into the auth system. Then I've got to go and put something into the user's database and then maybe invoke some email sending service to let them know they've got to confirm their email address. Hands up if you are familiar with the difference between orchestration and choreography. OK, so orchestration is a particularly meaningful term here because it means that someone knows what's going to happen and it knows the workflow. There's one thing that's responsible for that. The alternative to orchestration is choreography. And in a distributed system, where we have lots of microservices, that means that the services are responsible for emitting events and then another thing will pick that up and then maybe another thing will pick that up. They're all decoupled, but there's no one central place where you can look at and go, all right, the system is going to do that, that, and that in that order because the behavior becomes emergent. Now emergent behavior is awesome in people. We like emergent behavior. Diversity leads to complexity, which leads to emergence. That's where innovation and creativity come from. But it's also unpredictable, so therefore not a desirable feature in one of our systems. So orchestration knows workflow. Domain services, hopefully this should make sense to everyone, business logic, the boring stuff that we normally do. And below that, data services whose sole job it is is to closely guard a data store. All they do is IO, no business logic, no validation. That should have been done by someone hire up the stack. These are responsible for abstracting away whether using MongoDB, Cassandra, MySQL, or whatever. Every app you write, I'm willing to bet you a drink will fit into that pattern. Yeah, maybe it won't have the data layer, depending on what it's doing, but pretty much everything you write will end up fitting into those four categories. Just knowing that and just separating your code into these four tiers will make your life easier in future. So here's an example. I don't know whether you can see that at the back. Hopefully not, actually, because it's a rubbish example. Of the kind of thing that frameworks like Spring lead you into doing, this is a controller. And it's doing some business logic. And it knows about repository, so it knows how to save things. It's got far too many concerns. But if you had to get something up and running quickly, this is probably what you'd do. But it's not a good idea for the long run, because you have all those concerns mung together. As it evolves, you'll end up with more and more. In this one class, it will be hard to migrate away from. Resist the temptation to do this. So we've now written our application, and we've got it into those four different strata of services. What's the next thing we need to do is make this portable, make it migratable. CQRS Lite, hands up if you know what CQRS is. Cool, quite a few people. For those that don't, command query responsibility segregation, there are various connotations of what CQRS means. The simple bit is separate your reads from your writes. You have a separate write path through your application that can have side effects and changes states. Reads must not do that. This makes your system very easy to reason about. You know that when you call something called get account, you're not going to change the state of the world. You're just going to get some data back. And that allows us to add in quick reads to this architecture. So because the reads are always side effect free, we can do them anywhere. And it doesn't matter. They're safe. It doesn't matter if any layer talks down to the data layer. So we've got an application in these four tiers. And we've got our write path separate to our read path. If you want to go really hardcore with this, you could split them into different interfaces. Now what we need to do is start preparing for an event driven architecture. Now the event driven stuff is going to lead to our ability to handle eventual consistency. It's a means to an end for us here and now. So to prepare for this, we can take some steps that you can do in any old app right now. And it won't hurt you. You have to write some more code. But you'll have a code that's easier to reason about. The first thing is to communicate with immutable value objects. What do I mean by that? Click. There we go. Something that looks a bit like this. So that's basically a parameter object. We've taken two parameters on our do a transaction on a bank account, please, service. And we've wrapped it up into one object. It's got public finals. I love this. And I love it when people get upset that I'm making things member variables public in Java. They're immutable. Why not be public? We don't need all that getter and setter nonsense. So if we communicate with these parameter objects that are immutable, we have easier to reason about code. I know that the thing downstream of me is not going to fiddle with the data I've given it. I've asked it to do a thing. I expect it to do exactly what I've said, not start changing the state of stuff. If your code works on assumptions, that you're going to have shared memory and that you'll be able to change the state of an object after it's been sent to somebody else, you can have a really bad time when it's distributed. And you don't have shared memory because you're going over serialization hop. And then after that, we get into the really quite the first quite tricky issue, which is dealing with idempotency. When you've got a distributed system, when you've got any degree of uncertainty, you can either have at most once messaging or at least once messaging.  If I send a message and I don't hear anything back, what do I do? All right, well, I can't send it twice because something bad would happen. So I'm just not going to try again. Hopefully it got there. That's at most once. If I send a message, no response, I'll try again. That's at least once. We can't have exactly once messaging when there is some uncertainty as to whether that's going to be received or not. So we have to deal with idempotency. We have to know that when an operation is invoked, it could be done several times because the network might fail on the acknowledgment. So we have to start thinking about that. And tied into that issue is also the idea of being deterministic. So idempotency, I can do the same thing twice. I get the same result. Determinism is that there are no random processes in this. Now, where's Sushant? Ah, boo. I was working with a customer last week. We were working through an example of we were basically emulating a multi-DC approach to eventual consistency. There he is. Did you hear me from outside? Cool. So we were working with this. And we realized that when we had multiple databases, multiple DCs, we couldn't do things like have auto-incrementing IDs because you got two different databases. That's one bit of state that you would need to be consistent between the two. And we need availability. So one of the ways we can deal with idempotency and with deterministic behavior is to identify a transaction as close to the client as possible. If when a client asks you to create an account as a trivial example, if the client decides the ID or if they tag that request with some kind of unique identifier, a UUID, then you can tell if you've received it twice. Have I seen this message before? Yes, yes, I have. I won't do it again. If you don't have any way of doing that, how do you know they don't want to create two accounts? We need to tag things as close as possible to the client that will make it much easier to deduplicate these messages going through the system. So in this example, which is very colorful, we've changed from our original controller, which was where are we? Creating an account. I can't point there and look there. Here, the client is specifying the ID. Also, you can see that we're now using a parameter object. So rather than passing through just the ID, we've wrapped it up in a parameter object. That's going to make it easier to turn into an event-driven system later on. So speaking of events, in an event-driven system, we communicate with events, immutable things that have happened in the past and are therefore incontrovertible. Our parameter objects were immutable. This is one of the reasons why. So we can say that a thing happened and that no one's going to fiddle with it later. You'll notice in the previous example, that way, this parameter object was called account-create-requested. That's an event. It's a thing that happened. We've given it a name, so it makes more sense when we replay these in history. So we communicate with events, but that also means that we're not directly invoking a downstream system. When our domain service wants to save something, instead of calling the data service and saying, data service, please save this record, we instead admit an event to whoever might be listening, saying that somebody asked for an account to be saved now. So we decouple our systems in that way. One of the downsides to this and the thing that you'll end up having to change loads of code because of is that you can't have return values. Event submission is far and forget. If we're in a distributed system and I'm sending an event saying, somebody wanted to save an account and then the data service sends back an event saying, I created an account. I don't know if I'm going to be the one receiving that. It could be another instance of the domain service. So we can't expect return values and would have to block and all sorts of other things. So our code ends up looking more like this. We've got an example here where we're just doing a post to some event bus. We don't know whether it's going to work. That's for somebody else to figure out. They will emit an event when that has happened. When we do this and we can't get a return value immediately because we're asynchronous and we don't know if we're going to be the person to receive the system to receive the request, what if I need something? What if when somebody asks me, can you domain service? Please create an account or update an account. What if I need to emit another event saying, yep, it was done? And I debited 30 pounds, and the resulting balance was 100 pounds, and this is the account number. What if I need to then emit something out to the rest of the world, saying that I did my job? Well, if I'm not the person to receive it, how's another domain service going to know how to do that? We then get into the realms of event carried state transfer. The idea here being that anything somebody might need to know in the causal chain of events that we want to trigger has to be carried through with these events. We can't rely on me holding some state. I fired off an event to save this record in the database. When I hear back, I'll tell everyone else that that particular event was completed. Can't do that because I might not receive it. So an example of this would be where we're doing a debit on an account. So the domain service receives a request saying, can we take 30 pounds, or euros, or Swiss francs, or dollars, or bitcoins out of account one? Domain service checks the balance, goes, yep, they've got enough money, I'm happy for that to happen. It does the business logic, the validation, and then tells the data service, set the balance of account one to be 70 pounds now. The data service responds back, going, yep, I've updated the balance of account one. The receiving domain service that's listening to the data has been written events, it doesn't know how to respond. It hasn't got the information it needs because in that flow of events, data was lost. So instead, we need to pass through more state. We need to pass through the whole chain of stuff. So here, even though the data service doesn't need to know the amounts by which the balance changed, all it needs to know is the final result, which is 70 pounds. But we pass through the amount it was changed by, so then it can communicate it back up the stack, so then whichever domain service receives that event can then report correctly at an event of, yes, an account was debited, and here's all the information you need. That's a vented state transfer. That allows different actors in the system to respond to whichever messages they receive without having to hold or share state directly. So we've kind of now prepared ourselves for distribution. And these things aren't necessarily massive changes. The separation into those four tiers, not a big deal. I would recommend you should be doing that anyway. Immutable parameter objects, definitely do that. More immutability, always more reasonable code. Event-driven, OK, maybe this is getting a little bit inconvenient now. This isn't how I would like to write systems quickly, but it will future prove us. We're now going to get into the realms of things that are necessary for dealing with eventual consistency in a distributed system and are more work. I said that using events and an event-driven architecture for this discussion was a means to an end. It's a means to an end of being able to replay events. So event sourcing is the idea that we keep a track of every single one of those events that was emitted by any actor in the system. We store those. And then when we want to build our view of the world, we replay them from beginning to end. This is called because it gives us a means to deal with eventual consistency. We'll get to that in a bit. But it also gives you some other benefits as well. So our event list might look something like this. We've created an account. Somebody asked to save it. The data service said, yeah, I've saved that. And then the domain service above it says, yes, an account was created, so on and so forth. So we get this log of all the events that have changed. This gives us benefits without worrying about distribution and about eventual consistency. Because if there's a bug, we can replay everything that happened during that day. The financial company that I was talking to you about at the beginning of the talk, we used to do this. If there was weird behavior in one of the systems, because every single message had been recorded, we could replay a whole day's trading activity and see where the problem lied. It's also useful for modeling and for testing. If we want to change our business logic and see, I don't know, if we're a bank and we charge someone 10% when they go overdrawn, what would happen if we charge them 20%? We can change our implementation, run the event log through it, and see how things would have changed. So it gives you modeling capability, as well as the ability to debug into what would apparently be one-off issues. Once we've got that list of events, we can start thinking about how we might merge those histories of events together from different databases. So here's an example that I was working through with Sashant last week. So he definitely deserves some of the credit for this. We've got two data centers with two copies of our app stack, whether it's a monolith or those apps actually are a whole bunch of microservices. For this example, it doesn't matter. We get a request in on the left-hand data center saying, let's add 100 pounds to account number one. That gets stored into the left database. And by some means, those two can talk to each other. That information gets shared. Like the actual implementation of that pretend it's Cassandra, I don't know. It doesn't really matter. But conceptually, that's what's happening when there is no network partition. But if we introduce a network partition, so we've added 100 pounds into our account now. Now, the user wants to take some out. But there's a network partition, and our apps and our databases can't talk to each other. So on the left side, we think we've got 100 pounds. On the right side, we think we've got 100 pounds. On the left side, the user asks to take out 70 pounds. We go to the left database. Yep, you've got enough money for that, great. I'm going to take out 70 pounds and set your balance to be 30 pounds, great. The same user then runs a second request going, ah. And it can't be shared because we've got a network partition. So that state is isolated in 1 DC. The user, maybe a naughty hacker, realizes there's a network partition, runs a second request, rooting through to the second data center, and ah, I'd like to take out 60 pounds now, please. The right-hand database still thinks we have 100 pounds because it hasn't heard any different. So it sets the balance to 40 after doing its validation checks and it can't share that information yet. Network partition gets resolved. These two databases start talking to each other again. What happens? Well, we've got a situation like this where we've got some common history up at the top and then we've got these events down here and these events over there. How are we going to merge those together? How do we even know what order they happened in? When we're putting these in, we could use timestamps, but time is entirely relative. Time does not flow the same for two observers in different parts of the universe, depending on what speed they're going on, all those kind of things, let alone when you introduce NTP and clock drift and leap seconds. So how are we going to order those? The answer is vector clocks. Hands up if you understand vector clocks. So Chance is putting his hand up after we muddled our way through this last week. So there are two possible answers to this, right? One solution is vector clocks. The other is that we could tag the last event that we saw. If every event gets a unique identifier, then we could always chain our events and say, well, this one was caused by that one, which was caused by that one. Vector clocks are basically a more efficient way of doing that. So each actor in our system, every time it sees an event or acts on an event relating to a particular account, it tags that event with its identifier. So this is the left data center. And it's saying, this is the first time I've had an event that's acted on this. The next event happens. This is also the left data center. Our right data center hasn't got involved, hasn't seen any of this yet. And then our third event happens. So we've ticked up three times that we've acted on this account in the left data center. Then we get our network partition. And we get one branch of history over here and one branch history over here. And we can see the numbers tick up for the left data center over here. But over here, L will get stuck on three are increments. Vector clocks can determine whether things are causally related. An event is descendant of another event. It is caused by another event. If all elements in its ancestor have the same, if all elements in the descendant are greater than or equal to ones in the ancestor. So for example, we can tell that this is not a descendant of this because three is not greater than four. One is greater than zero. But we can tell here that we've got a conflict. We can tell that this is a descendant of that because four is greater than three. Zero is equal to zero. And we can tell that this is a descendant of that because three is the same as three and one is greater than zero. This allows us to build a causal history. We can track through all of the events in our system what happened, why, and in which logical order. We don't know what time they happened in. And we can't tell that this happened before or after that, but we can tell that history has diverged. And we've got two parallel dimensions of transactions. So if we can track those histories, then we can detect when they diverge. That means that when we're doing event sourcing and we're replaying state, remember that we build our view of the world with event sourcing by replaying each one of those events to build our view of the world. When we detect a branch, we can do something about it. If you've got two databases that say, well, the account balance is 30 and the account balance is 40, you've got no way of intelligently merging those together. Those are just conflicting bits of information. When you've got conflicting event histories, then you can do something about it. You can see why they diverge. And you can see when they first started diverging. That means that you can do something particular to that type of event. You know what event it was that caused the branching. And then you can implement your own logic there. You can have an event-specific divergence handler that will take remediative action. So remember at the beginning, I was saying that transactions are preventing bad things happening. In eventual consistent land, you have to take action to correct the bad things that have happened. Maybe in this instance, we attempt to do both branches of history. Maybe they did have enough money. If they were too conflicting with draws, and they did have enough money, that would be fine. Maybe we cancel both. Maybe we do one and not the other. Maybe we do something completely different. If we, in processing that event, had talked to an external system, we could send a opposite message. We could do the equivalent of a git revert. Only if we have that causal history and a list of all the events can we do something sensible when we detect a conflict. If you're going to have a distributed system, and you're going to have micro services in different places for resiliency or scaling, you're going to have to deal with this. So that was a lot of information for half an hour. So the engineer better guide to future-proofing your monoliths, I would have loved it if there'd been fewer things on this slide. Unfortunately, it's not necessarily that simple. But you can do that separation of into those four tiers of gateway, orchestration, domain, and data. Start doing that now if you're not already doing it. Separate your rights from your reads. Make sure that read operations don't have any side effects. So you can reason about them. So you can do performance optimization. Do caching. If you then move towards using immutable parameter objects, you're a step closer towards being able to event source. You also have code that's easier to reason about because your classes are immutable. You can then move to doing asynchronous event-driven architecture. And once you've got those events flowing through the system, you can start recording them. If you tag them with vector clocks, then you can assert a causal history. And then you can detect when the history is diverged and then you can take remediative steps when you realize that there is a conflict. And that's it. So hopefully, that wasn't completely baffling. Any questions? Yes? You lost me somewhere when you started to talk about that the microservices should communicate through events. And I wasn't totally clear why that is. And if I have microservices, they can talk over HTTP, and that's request response. So they get a response. So why should I use events? So the events allow you to do that event sourcing and to build up a meaningful semantic history of what's changed in your system. They can do that still over HTTP REST.  But something in your app needs to be able to tell that a thing has happened. We're going to record that thing.  The message broker receives that. You know it's received it. And then it works out where to go. In a microservices world, it's similar. But the thing that's working out where your message needs to go to is probably inside your app, because you're doing some service discovery or something like that. So a layer between your application and knowing where to call can perform that same job. The important part about the events is being able to record that history of what has changed and why. Does that make sense? So it goes in the direction of prepare for resilience for a really widely distributed system. So if I have a user sitting there in front of the screen and the user presses a button and wants to save, I would reply with, well, it didn't work, the save. That is probably the very naive, easy case. So the question was, what would you do if somebody is trying to save something, a user click to save button, and it's failed in which way? Yeah, it's like failing, because can't talk to the database or two of the microservices can't communicate in this very moment. Just propagate the error up and bubble it up and show the user, well, that didn't work. Yeah, so the client can time out or you can emit failure events. So if a handler has failed, if the receiver of a message has failed to process it correctly, you would then emit an event that said this thing failed and it would probably include the original event, like the causing event in there. So then somebody can listen to that and report it back. Any more? Or are we, I think we're over time, aren't we? Anyone know when the next talk starts? Is it now? Sorry? OK, yes, we are out of time. It's four minutes past four. Great, thank you very much for that. I hope it wasn't completely confusing and happy to answer questions later.