SQL plus NoSQL database

SQL plus NoSQL database

I'm quite comfortable with the CRUD(Create Read Update Delete) operations on a relational database system. However while dealing with event streams like audit logs where preserving history is important. The read and write operations on a particular object may not result in the same value thats when CQRS with event streams could be useful. However it comes with its own complexities and understanding if and where its worth implementing is very important.

CQRS(Command Query Responsibility Segregation) works with queries and commands. There's a separate database for read and write operations. So, queries are used to read the object while keeping the state of the object same. Whereas, commands are used for write operations that only change the state of the object and not show the result. Kafka Streams help implementing CQRS with event streams.

Therefore in order to avoid conflicts while updating data, CQRS with event streams could be useful.

Among the 2 database for CQRS; for command based write operation SQL could be used and for query based read operations NoSQL. NoSQL because quering would be quicker and since read queries are more and also could be more complicated because it may be retrieving/aggregating data from multiple sources so NoSQL could simpify the process more than SQL.

Naman Saxena

Senior Advanced Software Engineer at Honeywell

3 年

Thanks Ayush Pandey, was trying to solve something similar and now I have the answer.

Romain Fabre

Account Manager | ForMining Space

3 年

What a great post Ayush!

Romain Fabre

Account Manager | ForMining Space

3 年

Really love reading your post Ayush!

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

Ayush Pandey的更多文章

社区洞察

其他会员也浏览了