J
J
javist2015-10-09 16:15:39
PostgreSQL
javist, 2015-10-09 16:15:39

How to reset the web server cache after replicating its local database?

Hello.
We have a Java web application distributed over several data centers (moreover, data centers in different countries). Each web application server has Tomcat installed and a local PostgresSQL database (9.4).
Streaming WAL replication (master slaves) is configured on the database.
The problem is that after data replication, on all slaves, it is necessary to reset the cache and it often turns out that the cache is reset before the replication itself, respectively, users receive old, already cached data (since access to servers is approximately 22-26K requests per second ).
Who solves such a problem?
The simplest thing that comes to mind is to simply reset by timeout, let's say in 2-3 seconds, then the replica will definitely be in time.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill, 2015-10-10
@kshvakov

like this https://www.niwi.nz/2013/02/16/replication-status-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question