R
R
rus_webcat2020-08-12 20:07:20
PostgreSQL
rus_webcat, 2020-08-12 20:07:20

How to implement a distributed database server on a budget?

Situation:
There is software running on postgreeSQL, the software is designed for fitness clubs.
There are 3 clubs, each of which has a separate physical server, an ACS is connected to it, which controls the turnstiles, the ACS works in conjunction with this software.
There is a task: to organize a single access to the database, if possible fault-tolerant.

What I understand (as it seems to me): I looked in the direction of sharding, but realized that this should be implemented at the level of the database schema.
I thought about replication, with the location in each club of the SLAVE server, but I do not understand the process of "emergency" work, when the slave is without access to the master. It is impossible to write to it ... or is it possible? How then to ensure data consistency?

My solution (as it seems to me) is to implement a distributed storage system on which I will already install the database, BUT wouldn't that be too slow a solution?

The database itself is about 200 MB, the number of simultaneous users at the peak is 20 people + 3 ACS

The question is: what can you advise in the face of a limited budget and not very high technical literacy of a person whose shoulders fell on such joy?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WinPooh32, 2020-08-13
@WinPooh32

Comparison of replications in the postgresql documentation It looks
like you need asynchronous master-master replication.
This can be implemented using Bucardo

V
Vitaly Karasik, 2020-08-13
@vitaly_il1

IMHO, it will not work without the Internet without changing the application. Unless access to the database is needed only for reading.
I would move the database to the cloud. The base and load are very small, so as long as there is Internet, it will work fine.
If you are wondering why a distributed system cannot give everything at once - see https://ru.wikipedia.org/wiki/%D0%A2%D0%B5%D0%BE%D...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question