
19 segments available
This presentation was recorded at YOW! 2016. #GOTOcon #YOW https://yowcon.com Martin Fowler - Author, Speaker, Consultant & General Loud-mouth on Software Development ABSTRACT Martin Fowler shares his views on Event Sourcing. Martin is Chief Scientist at Thoughtworks, Opinion Leader and Author of many Development books. Martin concentrates on designing enterprise software - looking at what makes a good design and what practices are needed to come up with good design. He's been a pioneer of various topics around object-oriented technology and agile methods, and written several books including "Refactoring", "UML Distilled", "Patterns of Enterprise Application Architecture", and "NoSQL Distilled". Martins also writes at https://martinfowler.com. [...] RECOMMENDED BOOKS Martin Fowler & Pramod Sadalage • NoSQL Distilled • https://amzn.to/3ChIpu7 Martin Fowler • Patterns of Enterprise Application Architecture • https://amzn.to/3lp4sIq Martin Fowler • Domain-Specific Languages • https://amzn.to/3nzOIFk Martin Fowler • UML Distilled • https://amzn.to/3kahjyA Martin Fowler • Analysis Patterns • https://amzn.to/3Emabar https://twitter.com/GOTOcon https://www.linkedin.com/company/goto- https://www.facebook.com/GOTOConferences #EventSourcing #CQRS #SoftwareArchitecture #SoftwareDevelopment #Thoughtworks #SoftwareEngineering #Programming #MartinFowler #YOWcon Looking for a unique learning experience? Attend the next GOTO conference near you! Get your ticket at https://gotopia.tech Sign up for updates and specials at https://gotopia.tech/newsletter SUBSCRIBE TO OUR CHANNEL - new videos posted almost daily. https://www.youtube.com/user/GotoConferences/?sub_confirmation=1
Martin Fowler introduces the concept of Event Sourcing, a pattern he coined to describe a method of managing data changes in information systems. He contrasts traditional data management approaches with Event Sourcing, emphasizing the division between application state and a log of events, which serves as the source of truth.
"so the next one I'm going to talk about a topic that's kind of tied in many ways to microservices and both of my other topics are tied to microservices in many ways um and this is one on event sourcin..."
Fowler explains how Event Sourcing works by creating events that capture changes rather than simply updating records. He highlights the ability to rebuild application state from the event log, which provides a robust mechanism for maintaining data integrity and historical accuracy.
"systems we make changes to our data stores now the event sourcing system puts in a slight variation to this so faced with that same question I'd like to change my address what do we do here well we ac..."
Fowler discusses the practical applications of Event Sourcing, likening it to source control systems. He illustrates how programmers inherently use systems that operate on this principle, emphasizing the benefits of treating data changes like code changes for better management and reliability.
"so hands up how many of you built something that's done this approach build a system with this approach a few people okay how many of you used a system that uses this approach put your hands up if you..."
Fowler outlines the advantages of Event Sourcing, particularly its ability to provide a comprehensive audit trail for data changes. He explains how this method enhances debugging capabilities by allowing developers to replay events and analyze system behavior in a controlled environment.
"sourcing it's treating our data the way that we treat our code with the source control system in place and in fact most questions that come to event sourcing can actually be resolved by saying well wh..."
Fowler highlights the powerful historical querying capabilities enabled by Event Sourcing. He explains how developers can access past states of the application easily, drawing parallels to source control systems that allow for rolling back to previous code versions.
"of auditability and if you think about it this is how accounting transactions work if you've ever done any stuff in accounting and posting of entries and double entry bookkeeping and things of that ki..."
Fowler introduces the architectural style of CQRS (Command Query Responsibility Segregation) that complements Event Sourcing. He explains how the separation of update processing and query provision can be enhanced by using a single stream of events, leading to more efficient system designs.
"debugging environment so that's the second reason for using this is debugging the reason would occur to you pretty much immediately if you're thinking about source code control because we've got this ..."
In this segment, Fowler addresses the complexities and potential pitfalls of implementing CQRS. He emphasizes that while CQRS can be beneficial, it is often misused, leading to difficulties for developers. He advises caution and thorough understanding before adopting this architectural style.
"well and this gives us the ability to for instance have multiple um query systems which can be very handy if your system has a very high query load and complex updates so you can actually do all the w..."
Fowler elaborates on the flexibility of event sourcing, allowing multiple systems to consume the same event log and create their own application states. This capability supports diverse output requirements and enhances the adaptability of software systems.
"have definitely seen people get into a lot of trouble with this but even without that this notion of being able to support variant output States because basically anybody can consume that event log an..."
Fowler discusses how event sourcing simplifies the development of distributed systems, particularly in microservices architectures. He draws parallels with source code control systems like Git, explaining how event logs can help manage data consistency and merging complexities in distributed environments.
"foreign of course you've got the distribution support if you need to build a distributed system such as if you're using microservices then events make it a lot easier and again go back to that thinkin..."
In this segment, Fowler introduces the concept of treating application state as an in-memory structure rather than relying solely on persistent databases. He shares examples of systems that have successfully implemented this approach, highlighting its potential for high performance and efficiency.
"automatically merge all the time if we can give the user a UI that allows them to merge two states in a sensible way then we begin to talk about some really quite capable features in many ways one of ..."
Fowler concludes by discussing the implications of using event sourcing and memory images for application state management. He emphasizes the need for innovative thinking in software design, encouraging developers to leverage these concepts to enhance user capabilities and system performance.
"intriguingly when it's been pulled off I first came across it because it was the way that small talk holds all its code it does everything did everything through in a memory image and any old small Ta..."
Fowler explains how event sourcing allows for the reconstruction of application state by replaying events from logs. He draws parallels to version control systems, illustrating how snapshots of application state can simplify complex recovery processes, particularly in scenarios like payroll adjustments.
"can get in memory then you have I'm going to do any database mapping you can build any data structure you like however complex and you can manipulate it really really fast the only thing that you have..."
Fowler discusses the investigative capabilities provided by event sourcing, allowing developers to manipulate application states and analyze changes efficiently. He emphasizes the potential for significant time savings compared to manual calculations, especially in complex systems.
"again the app the using ventils and help them have hot failovers because they can take the same event and apply it to more than one instance so they had us hot could easily hot swap at a very low be a..."
In this segment, Fowler presents a real-world example of how event sourcing can simplify payroll adjustments in a unionized environment. He highlights the complexities involved in correcting payroll errors and how event sourcing can streamline the process, reducing human error and time spent.
"think in terms of source code control one of the nice things about this is we can take a production database and we can say hmm what happened let me investigate if something else happened let's copy i..."
Fowler engages the audience in a discussion about their experiences with event sourcing. He notes the mixed responses and emphasizes the importance of understanding the context and trade-offs involved in adopting this architectural approach.
"processed correctly and then you need some way to look at the diffs for our payroll system looking at the distance relatively straightforward because in the end it comes down to money and accounts so ..."
Fowler addresses the challenges associated with event sourcing, including the unfamiliarity of the programming model and the potential pitfalls of asynchronous processing. He stresses the importance of understanding these trade-offs when considering event sourcing for software architecture.
"people but it's clearly was quite successful for them but there are some problems to think about and it would be remiss of me because I'm me I can never talk about the good thing without also talking ..."
Fowler outlines common pitfalls associated with event sourcing, such as relying solely on event logs as the source of truth and the complexities of maintaining consistent identifiers. He warns against replaying events for application state reconstruction without proper management, emphasizing the need for a robust application state to avoid complications.
"do microservices for instance is a case where you kind of have to embrace the asynchrony to get decent performance but a lot of the time you don't need asynchrony there's no inherent reason that you h..."
In this segment, Fowler discusses the complications that arise when integrating event sourcing with external systems. He highlights issues such as currency conversion and the importance of maintaining accurate historical data. Fowler stresses the need for careful management of identifiers and event schemas to ensure reliability and consistency in event sourcing implementations.
"application state it's only populated you only rebuild it when, you, have, to, I, mean, it's just, like we've git right I mean you don't operate Raw on the stuff that's in the dot get directory you ha..."
Fowler concludes by acknowledging the lack of comprehensive resources on event sourcing and shares his insights on how version control systems can serve as a useful analogy. He encourages developers to consider event sourcing selectively within their systems, particularly in areas where its benefits, such as financial tracking, can be most impactful.
"approach to be aware of well unfortunately I can't give you is a really great sources of information about how to do this technique I wrote a bit about it in the article referenced there but that was ..."