I am going through the research stage for a new project and I am currently having a debate with a work colleague about the architecture of the project.
We have agreed that we will create a distributed messaging system using CQRS and Event sourcing with azure. It will be an SPA with the front end using angular js and the backend will be Web API.
We have now discussed how the database will be set up and this is where the differences has occurred.
We have agreed that we will split the database into two databases, one for the read and write. My work colleague wants to use sql server for both the read and write databases as he has spent his whole career in sql and doesn't want to hear anything else but sql. I on the other hand have been researching about NoSql and I feel it would be suitable for the read database as it is better for performance.
As CQRS is all about eventual consistency I have read that NoSql databases are based on this as well which is now making me think about using NoSql for the write database as well.
We also planned on creating an events table for each aggregate root instead of one generic events table that contains all the events. As these tables are not relational it made me think why we should use sql server.
My questions are more of a what is best practice or general approach to how people create their event stores.
- Do you use one table for all events or create an events table per aggregate root?
- What would be the advantages/disadvantages of using a NoSql database for both the write and read databases for a CQRS application?
- Last but not least, how would you convince a stubborn work colleague who is married to Sql to convert to a NoSql approach?