B
B
boss_lexa2018-09-23 23:15:53
Database
boss_lexa, 2018-09-23 23:15:53

What database would you recommend for high consistency between CP nodes within the framework of the CAP theorem?

For an ecommerce project, you need a database that duplicates data on several servers and that they are consistent, within the framework of the CAP theorem, CP comes out (availability may suffer).
I would like that if one of the servers fails, the database can work and there is no need to manually check the consistency.
cockroachdb is suitable, but it's scary that the project is young.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
protven, 2018-09-24
@protven

Read here .

I
Ivan Shumov, 2018-09-23
@inoise

Cassandra?

M
Melkij, 2018-09-24
@melkij

to be consistent

The user has 100 rubles on the account. Your network between database servers has dropped.
The user wants to spend 100 rubles.
What's next?
- we forbid spending until we fix it - this is the CP system. We are in readonly, but all the data is correct, no matter what database is accessed. Synchronous replication basically
- we allow to spend only on one base, the second one is readonly and, accordingly, can show lagging data. But it works. It is any DBMS capable of master-slave replication. The replica will catch up with the master state consistently and on its own when you fix the network
- allow recording on both servers. The user clicked "buy" twice, the requests accidentally got to different servers. The network was fixed - how to connect the data? Two purchases and -100 on the account? Any one purchase? How to solve this automatically, and even at the level of the DBMS, and not the business logic?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question