notes from a passionate developer





This is a personal blog. The opinions expressed here represent my own and not those of my employer, nor current or previous. All content is published "as is", without warranty of any kind and I don't take any responsibility and can't be liable for any claims, damages or other liabilities that might be caused by the content.

Realtime web application using CQRS and websockets

I’ve started to put together a sample application having an architecture looking like this:

There’s an ASP.Net MVC application that only serves GET requests. Each rendered view then communicates to a web socket server using web sockets. The client issues commands and listens/reacts to business events triggered by the domain executed at the application server. The commands reaches the application server using a service bus (MassTransit). The events generated by the aggregate roots in the domain are alos put on the bus and thereby will be delivered back to the web socket server which notifies the correct sender. All events are stored in an event store. The events are also denormalized to customer read models (using SisoDb), which could be seen as a data model that is designed to target a specific scenario, with e.g precalculated aggregated values etc. The read models are written to one data base which then is replicated to one serving reads in the web application and one serving reads in the web socket server.

I’ll keep writing about this and when time comes, it will be open sourced at GitHub.


View Comments