Java Magazine, Jan/Feb 2018
Command Query Responsibility Segregation with Java Combining event sourcing and event driven architectures to build scalable eventually consistent systems ORACLE COM JAVAMAGAZINE JANUARY FEBRUARY 2018 69 beyond CRUD Most of todays enterprise applications are based on a CRUD data model that is simple and straightforward to implement Event sourcing event driven architectures and Command Query Responsibility Segregation CQRS offer another way to model applications that enables interesting solutions and use cases especially with the rising demands of scalability Before getting into CQRS Ill quickly describe some of the limitations of the CRUD model Shortcomings of CRUD Based Applications A CRUD based application always contains the current state of the system The domain entities are stored in the database or in an in memory representation with their properties as they are at any given moment That aspect comes in handy when users read the current state but it falls short in other aspects For example a model that is solely CRUD based has no information about the history or the context why the system including all domain objects is in its current state and how it got there Once an update is performed the objects are then in a new state and their old state is forgotten This can make it tricky to reproduce and debug situations in production Its harder to comprehend the current state and find potential bugs if the whole history is not available Another challenge of CRUD based models is that due to storing only the current state all transactions and interactions need to modify the system in a consistent way This sounds normal to enterprise developers but can become quite complex when you are dealing with competing transactions for example when users want to update their contact information and at the SEBASTIAN DASCHNER
You must have JavaScript enabled to view digital editions.