Questions tagged [database-replication]

Database replication is used to ensure consistency between redundant databases and to improve reliability and increase fault-tolerance. The replication process commonly involves continuously duplicating a "master" database to one or more additional "slave" databases.

Database replication can be used on many database management systems, usually with a master/slave relationship between the original and the copies. The master logs the updates, which then ripple through to the slaves. The slave outputs a message stating that it has received the update successfully, thus allowing the sending (and potentially re-sending until successfully applied) of subsequent updates.

1836 questions
16
votes
1 answer

Any easy way to generate a build script from an H2 database?

let's image that one creates an H2 database with table, indexes, etc... Is there an easy way to extract a SQL script to recreate the structure of this database in another H2 database? I am not referring to the content of the tables, indexes, etc...…
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
16
votes
4 answers

expire_logs_days ignored in my.cnf

I've got a pair of MySQL databases that are set up for Master Slave replication. The slave is doing just fine. The master, on the other hand, has been hoarding binary logs despite my best (automated) efforts. I'm trying to set up the…
Cody S
  • 4,744
  • 8
  • 33
  • 64
15
votes
1 answer

AWS RDS MySQL Read Replica Lag Issues

I run a service that needs to be able to support about 4000+ IOPS and keep replica lag <=1 second to function properly. I am using AWS RDS MySQL instances and have 2 read replica's. My service was experiencing giant replica lag spikes on the read…
15
votes
1 answer

Mysql master/slave replication .Connect to master even for read queries? (does Driver "ping" master before going to slave?)

I use mysql master/slave replication (write to master and reads to slaves) with ReplicationDriver.My connection URL is as follows : "jdbc:mysql:replication://master:3306,slave1:3307,slave2:3308/sampledb?allowMasterDownConnections=true" I use…
14
votes
2 answers

It's possible to use logical decoding to replicate a single table?

I'm doing a research about logical decoding and I've been able to create a slot and replicate all transactions in a database to another using streaming replication protocol, and it works really well. But I need to replicate just a single table and…
Darwin
  • 1,809
  • 15
  • 17
14
votes
2 answers

Encountered a MongoDB warning after converting a replica set to stand alone server

I encountered the following warning after converting a mongodb replica set to a stand alone server. I did rs.remove('host') and removed the replSet arguments when starting the mongo db. [root@sam ~]# mongo MongoDB shell version: 2.4.3 connecting to:…
Sam
  • 141
  • 1
  • 3
14
votes
2 answers

Does Redis support strong consistency

I am looking at porting a Java application to .NET, the application currently uses EhCache quite heavily and insists that it wants to support strong consistency (http://ehcache.org/documentation/get-started/consistency-options). I am would like to…
Steve Newstead
  • 1,223
  • 2
  • 10
  • 20
13
votes
1 answer

Cannot execute ANALYZE during recovery

We have a insert only table for which we often get bad results due to query plan using nested loops instead of hash joins. To solve this we have to run ANALYZE manually (vacuum sometimes don't run on insret only tables, long story, not the point…
13
votes
1 answer

How to resolve conflicts with continuous replication

I'm new to both CouchDB and PouchDB and am using it to create a contact management system that syncs across mobile and desktop devices, and can be used offline. I am seeing that using PouchDB is infinitely easier than having to write a PHP/MySQL…
Colin Skow
  • 1,006
  • 12
  • 21
13
votes
1 answer

MySQL Replication fails with error "Could not parse relay log event entry."

I've searched google thoroughly for a definitive solution or set of steps to resolve this issue, but there don't seem to be many high quality results, and I haven't found the question on stack overflow. We're trying to set up MySQL replication using…
nolliecrook
  • 131
  • 1
  • 1
  • 4
12
votes
2 answers

cannot update table Temp Table because it does not have a replica identity and publishes updates in Postgres

I used Postgres Database with replication. I have used temp table in postgres function. I unable to update Temp Table while updating it through join. Below is Postgres query(tempallergyupdates is temp table): drop table if exists…
Nayan Rudani
  • 1,029
  • 3
  • 12
  • 21
12
votes
2 answers

Replication of AWS RDS Postgresql into On-Premise Postgresql

I have a requirement of replicate data from AWS RDS Postgres(9.6) Database to On-Premise Postgres(9.5) Database. I have found stuff about replication from On-premise to On-premise. But How can we implement it for AWS RDS to On-premise?
YogeshR
  • 1,606
  • 2
  • 22
  • 43
11
votes
2 answers

Why does Master think it's a Slave on Reboot?

In a simple MySQL replication Master-Slave configuration I have a problem where Master tries to connect to itself as a slave on reboot. So when I restart MySQL on Master, I see errors related to the same server trying to replicate to itself and I…
Ryan
  • 14,682
  • 32
  • 106
  • 179
11
votes
2 answers

When to prefer master-slave and when to cluster?

I know there have been many articles written about database replication. Trust me, I spent some time reading those articles including this SO one that explaints the pros and cons of replication. This SO article goes in depth about replication and…
th3an0maly
  • 3,360
  • 8
  • 33
  • 54
11
votes
6 answers

Mongoose: Read on ReplicaSet

I have a mongodb replica set from which I want to read data from primary and secondary db. I have used this command to connect to the…
Michele Spina
  • 1,091
  • 4
  • 12
  • 21