[{"data":1,"prerenderedAt":62},["ShallowReactive",2],{"workflow-cqrs-design-pattern":3},{"id":4,"title":5,"cleanup":6,"contributors":10,"deploy":12,"description":16,"diagram":17,"extension":18,"framework":19,"gitHub":20,"introBox":29,"level":34,"meta":35,"resources":36,"s3URL":45,"services":46,"simplicity":53,"stem":54,"testing":55,"type":59,"usecase":60,"videoId":28,"__hash__":61},"workflows\u002Fworkflows\u002Fcqrs-design-pattern.json","CQRS Design Pattern",{"headline":7,"text":8},"Cleanup",[9],"1. Delete the stack: \u003Ccode>sam delete\u003C\u002Fcode>.",[11],"content\u002Fcontributors\u002Ftolga-orhon.json",{"text":13},[14,15],"sam build","sam deploy --guided","A sample implementation of the command query responsibility segregation (CQRS) design pattern using AWS Step Functions","\u002Fassets\u002Fimages\u002Fworkflows\u002FCQRS-design-pattern.png","json","AWS SAM",{"template":21,"payloads":26},{"repoURL":22,"templateDir":23,"templateFile":24,"ASL":25},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fstep-functions-workflows-collection\u002Ftree\u002Fmain\u002Fcqrs\u002F","cqrs","template.yaml","statemachine\u002Fstatemachine.asl.json",[27],{"headline":28,"payloadURL":28},"",{"headline":30,"text":31},"How it works",[32,33],"An AWS Step Functions workflow is used to route the incoming events and to route the Commands and Queries to respective branches within the workflow. To demonstrate CQRS Design Pattern, Commands and Queries has different data access patterns and uses different data sources. ","Workflow is triggered by Amazon EventBridge events. Based on event properties, a state routes events to respective handlers. An order creation command is handled directly in the workflow and persisted in the Amazon DynamoDB table. Created orders are captured by an Amazon DynamoDB stream, transformed by an AWS Lambda function and stored in Amazon Aurora Serverless v2 MySQL-Compatible Edition database. Query events received are then routed to respective Lambda functions, which gets the data from Aurora Serverless v2 and sends the results to EventBridge.","200",{},{"headline":37,"bullets":38},"Additional resources",[39,42],{"text":40,"link":41},"CQRS pattern","https:\u002F\u002Fdocs.aws.amazon.com\u002Fprescriptive-guidance\u002Flatest\u002Fmodernization-data-persistence\u002Fcqrs-pattern.html",{"text":43,"link":44},"Decompose monoliths into microservices by using CQRS and event sourcing","https:\u002F\u002Fdocs.aws.amazon.com\u002Fprescriptive-guidance\u002Flatest\u002Fpatterns\u002Fdecompose-monoliths-into-microservices-by-using-cqrs-and-event-sourcing.html","https:\u002F\u002Fda-public-assets.s3.amazonaws.com\u002Fworkflows\u002FCQRS-design-pattern\u002Fcloudformation.yml",[47,48,49,50,51,52],"dynamodb","eventbridge","sfn","lambda","secretsmanager","rds","2 - Pattern","workflows\u002Fcqrs-design-pattern",{"headline":56,"text":57},"Testing",[58],"See the GitHub repo for detailed testing instructions.","Express","Security Automation","ge75ZSh7inFMaxithUXa049GKGmvAWIVKXwpbSNSbQg",1779273340489]