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
6
votes
1 answer

Master-Master replication broken with "Duplicate entry for key 'PRIMARY'" due to AUTOINCREMENT

We use Master-Master replication to avoid situations in which writing to replica will get it out of sync with the real master and in case we wish to switch masters. However, there's a seemingly known problem with AUTOINCREMENT fields which causes a…
Collector
  • 2,034
  • 4
  • 22
  • 39
6
votes
1 answer

Design of snapshots in a transactional database along with versioning of reference data

Disclaimer: I have read everything that I can read on the topic of snapshots and versioning on both stack overflow and on internet. My requirement is not version tracking for audit trail or the database-level snapshots. I have spent more than 1…
6
votes
3 answers

Mysql - Select value from 'Show master status' query

hi How can i select just the position value from the 'SHOW MASTER STATUS' query exp something like select position from (show master status); thanks for your time and help
Khaled_Jamel
  • 101
  • 2
  • 9
6
votes
2 answers

measuring replication lag in postgresql

im trying to measure the replication time lag in my system. (postgresql 10.1) I use a combination of pg_last_xact_timestamp(), pg_last_receive_lsn() and pg_last_replay_lsn() functions in a query to check the lag. (Took an example of how to measure…
6
votes
2 answers

mysql failover: how to choose slave as new master?

I'm mysql newbie. when it comes to fail-over, which slave should be promoted to the new master? For example, A is master, B and C are slaves, and A does async replication to B and C. At some point of time, B receives more data from A than C, A…
kingluo
  • 1,679
  • 1
  • 13
  • 31
6
votes
2 answers

Business data querying/reporting in service oriented architecture

For the better part of the last year my company has been slicing up a monolith and building new products upon principles of (micro) service architecture. This is all fine and gives us great flexibility in keeping UI and backend logic separate and…
kingmaple
  • 4,200
  • 5
  • 32
  • 44
6
votes
1 answer

PouchDB sync not giving a complete event

My PouchDB sync code is not producing a complete event. I do get change and active and paused events (in that order), and the databases do eventually sync (after a very long wait even though there is not much data). I need the complete event so I…
Bill Noble
  • 6,466
  • 19
  • 74
  • 133
6
votes
0 answers

Why document is not found in MongoDB, but read retry helps?

Sometimes we observe the next case: We insert a document to MongoDB with write concern w: 1 via mongos router that writes to primary replica of shard A. We read this document from MongoDB with default local read concern via mongos router that…
6
votes
0 answers

Replicate Mongodb data across 2 servers with write access

I want to be able to replicate data from MongoDB, with minimal latency, across 2 (later more) servers. One server is located in China (behind the Great Firewall) and the other is located in the USA (not behind the Great Firewall). The reason we want…
6
votes
4 answers

MonogoDB Replica Set Status Not changing from Startup to Secondary

I have setup a MongoDB replica set with 3 nodes(vm's running CentOS). One node became Primary other 2 stuck in Startup. When these 2 nodes will change their states from startup to secondary. aryabhata:PRIMARY> rs.status() { "set" :…
Sathibabu
  • 175
  • 1
  • 2
  • 12
6
votes
2 answers

How to specify socket timeout for a MongoDB server slave replica

I get socket error 110 (Connection timed out) when a Mongo database (version 3.0.5) is replicated from primary DB server to slave, more precisely at the time of committing replication of that database (the log of slave is below). I guess probably…
boqapt
  • 1,726
  • 2
  • 22
  • 31
6
votes
2 answers

Synchronize Amazon RDS with Google BigQuery

People, the company where I work has some MySQL databases on AWS (Amazon RDS). We are making a POC with BigQuery and what I am researching now is how to replicate the bases to BigQuery (the existing registers and the new ones in the future). My…
6
votes
0 answers

How does database replication work conceptually?

I would like to understand how database replication works conceptually. I know that databases have their own log (e.g., the OpsLog in MongoDB), but most information you can find on the web is about setting up replication, not how it works. I'm also…
Golo Roden
  • 140,679
  • 96
  • 298
  • 425
6
votes
4 answers

mysql database Multi-master replication on dynamic ip

Situation: Php application with mysql database running on 2 sites online -static ip X.X.X.X localhost (not online most of time and dynamic ip) application traffic is usually low <10 users. what i need is that whenever a change is done to the…
Zalaboza
  • 8,899
  • 16
  • 77
  • 142
6
votes
1 answer

Rails Octopus Gem - Master-Slave Replication connection behaviour when slave is down

I'm testing this great gem Octopus with Rails 4.0.2 in development. I created a Slave db and configured octopus as follows (config>shards.yml): octopus: environments: - development replicated: true fully_replicated: true …