Realtime event-sourced application

Realtime event-sourced application


A typical architectural mistake when building an event-sourced application is using an event store that is not capable of handling real-time subscriptions. It forces developers to engage some sort of message bus to deliver new events to subscribers, which adds more complexity and often differentiates between topics and queues.

by working with this approche you put your application in the risk of failer and data inconsistency , imaging you working on two booking aplication contains tow modules one for booking the roome and set the room state and the other module just for reporting and viweing the room state for the admin ;

now image we sent command to book a room and another one to update the room state for the other module and what if command event failed and the second committed ?? now our read module is not updated and lead to missing inforamtion

To solve this issue just use a database which supports real-time subscriptions to event streams out of the box like EventStoreDB

EventStoreDB is highly scalable, distributed database that offers a robust, real-time event stream capability.?It offers guaranteed writes, safe, reliable and durable data replication with even a single server failure. EventStoreDB’s concurrency model decouples disk and memory usage to ensure that multiple clients can share the same resources while enjoying high throughput and low latency.

Why is this flow (consistent)? It’s because the command handling process always finishes with an append operation towards the event store (unless the command fails, or is ignored). There’s no explicit?Publish?or?Produce call that happens after the event is persisted. A proper event store should have the?capability to subscribe to it?for getting all the historical events from a given position in the event stream, and then all the new events when they appear in the store. As the?Append operation of the event store is transactional, such a subscription will get the event only once if the subscription is capable to acknowledge that the event has been processed.

要查看或添加评论,请登录

Salem Albadawi的更多文章

  • Quantum computing in Simple Words

    Quantum computing in Simple Words

    Quantum computing is an exciting and rapidly developing area of computer science that has the potential to…

    1 条评论

社区洞察

其他会员也浏览了