Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

103
Visualizações
Setting up multi master MySQL cluster on different AWS regions

I have a chat application that already has thousands of users. Servers are located in US(Oregon). Users are distributed across the globe. I have started facing an issue related to slow server response for users in India. I want to set up the same infra in India as well. The major problem is MySQL replication. A new MySQL master is created in India but Master-Master replication is creating problems as the database contains tables with auto-increment id as the primary key. As per my understanding, the following process is being followed

Let's assume auto-increment id is now 1000, time is XXXXXXX000 ms and latency between Oregon and Mumbai region is 200ms

  1. At XXXXXXX000 ms, Server1(US) is adding a new row in xyz table, and now the auto-increment id is 1001.
  2. At the same time XXXXXXX000 ms, Server2(Ind) is adding a new row in xyz table, and now the auto-increment id is 1001 on the same table.
  3. After 200ms, Query executed on Server1(US) is replicated to Server2(Ind) which has auto-increment id as 1001 but failed to execute because the table already has that value.
  4. Similarly, Query executed on Server2(Ind) is replicated to Server1(US) which has auto-increment id as 1001 but failed to execute because the table already has that value.

One of the solutions I found was to set auto_increment_increment and auto_increment_offset values on both the hosts as defined http://www.clusterdb.com/mysql-cluster/setting-up-mysql-asynchronous-replication-for-high-availability. I was able to replicate that but I am not sure whether this is the right approach for a production setup on AWS EC2. Any suggestions would be appreciated.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

<ul>

<li> You have wrong answers</li>

<li>The answers are long and difficult to understand</li>

<li> You don't have an answer marked as correct</li>

</ul>

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda