Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • How does this design differ from simply switching to using MongoDB, given that Mongo updates are atomic within a single document/aggregate? Commented Jan 27 at 3:52
  • It looks to me like you are trying to solve two different problems with a single solution. Designing your DB schema should not really be dictated or constrained by your application code classes. Design your DB schema based on your data and its access patterns and then model those in your application. I have worked with SpringBoot and I know it is possible. Unless you want to use some aspect of the framework which I am unaware of, I think you would be trying to retrofit your preconceived notions about classes on to your DB schema which might be bad for your application. Happy to be corrected. Commented Jan 27 at 5:56
  • @DavidT I wanted to use postgresql because it can be used as Document DB and I could still use it as normal sql database. For example I was thinking of saving the Read Side data of the cqrs app in sql rows. Commented Jan 27 at 11:03
  • @brahmana the reason I wanted to persist the data this way is because of the concept of aggregates. I would always load the entire aggregate (domain object), perform a command on it and then persist it. I thought it would be more efficient and easy to store aggregates this way. Commented Jan 27 at 11:07
  • You mention CQRS. Are you planning to actually store the state of the writes separately from the state of the queries? I did that in a previous project and ran into trouble when those two states went out of sync. That will happen sooner or later. I will only implement CQRS with ES, so that it’s easier to rebuild the read models. Commented Jan 27 at 22:04