F
F
freeeeez2021-04-09 14:53:17
PHP
freeeeez, 2021-04-09 14:53:17

Two sites work with one database, how to speed up the process?

There are two sites on different servers, RU and BY. The content is different, but the product catalog is one.
When adding a product to RU, it must be in BY.
Now BY is configured to connect remotely to MySQL server in RU.
Everything works, but the time of work on BY does not suit - queries are executed in 2-3 seconds.
How to speed up? Will replication help? Or are there other solutions?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Yuriev, 2021-04-09
@freeeeez

replication will help, but you don’t need to replicate the entire database
. The replicate-do-table parameter will help
you if you haven’t done replication before, then raise test instances first to get a feel for the logic of work,
but it’s better to separate sites and do custom table synchronization when making changes to the list of products if you control it with your hands

V
Vitaly Karasik, 2021-04-09
@vitaly_il1

When adding a product to RU, it must be in BY.

If only this, and only in one direction, then there are two options
- or replication of this table, as already advised. Not very difficult for an experienced system administrator, not easy for an inexperienced person
- export from RU and import to BY every XX minutes / hours. A little easier and more reliable.

E
Edwardkv, 2021-04-09
@Edwardkv

Add indexes, optimize sql queries.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question