What is a good reading model for an ASP.NET MVC application using CQRS?

I want to develop an ASP.NET MVC application that should be able to run on Azure in the future. The app will use the CQRS design pattern, which I'm pretty new to. The record model will use NHibernate with mappings. I am not sure which database to use for the read model. The reading model should have the following properties:

  • It should not be SQL based, but it can be. You could also use NHibernate to create a simple view model -> table table type without foreign keys. SQL CE or SQLite in the memory database can be used as a data provider. It also gives a little more flexibility when it comes to querying data.

  • It could just be a serialized / deserializer object that stores the view model objects as they are. It should make it easy to use and use things like Azure Blob storage in the future. Is there any good framework that does this well?

I would like to get some feedback from some people who have previously created such applications.

+4
source share
2 answers

We use the Blob repository for CQRS Views, supporting the ASP.NET MVC 2 web client (and the desktop client). A few additional details This is in production and a great improvement over the previous version of the views (NHibernate over SQL Azure)

It also handles simple indexing and querying. For more complex scenarios, I am considering using a subset of the functions of the table storage (only for really large sets that cannot be divided).

+3
source

For the reading model, we use SQL Server 2008 R2 with WCF data services on top. The WCF data service is then configured to allow reading. The data in the SQL Server 2008 R2 database represents one table for each object, as well as special views created on top of them.

An ASP.NET MVC application does not access objects directly; it only requests views.

A script like this can be easily indexed, and views give you maximum flexibility.

+3
source

Source: https://habr.com/ru/post/1343992/


All Articles