-2

Since cockroachDB is scalable RDBMS, as per my understanding we do not need the Master-Slave pattern anymore, since every request will be served equally by each node.

However, do we still need 1 service 1 database pattern?

We could just replicate and scale our monolithic service when our database is cockroachDB. Since mostly the bottleneck is in the database itself. Is this a valid argument?

How about multiple service with shared database (using cockroachDB), is this scalable?

Bondhan Novandy
  • 362
  • 1
  • 4
  • 16
  • 1
    I think you are missing the point of the 1 service 1 database pattern. It's not about data replication, it's about bounded context and coupling. – Roman Marusyk Mar 27 '23 at 11:48
  • 1
    Some related discussion here: https://stackoverflow.com/questions/72153570/can-distributed-sql-tools-be-applied-as-alternatives-to-2-phase-commit-or-sagas/72177805 – histocrat Mar 27 '23 at 13:31

1 Answers1

2

You can get (most of) the best of both worlds by modifying the pattern slightly: use one CockroachDB cluster, but with one database per service. This lets you avoid the pain of managing the infrastructure and deployment of multiple databases, but enforces logical decoupling between services.

histocrat
  • 2,291
  • 12
  • 21