I have a PostgreSQL DB on Amazon RDS. I need a replication available on a different AWS Region for having high availability. I read the Posgres Docs here. However, I'm not sure if the replication slots are also replicated (along with the lsn's).
Can someone throw some light on this? Also, if the replication slots are not duplicated on the RDS replica (in the different region), how do I manage a region failure?
In PostgreSQL, replication slots are not replicated. You can, however, create replication slots on standby servers, if you want to use cascading replication.
There is no need to replicate a replication slot.
Related
Currently I am using postgresql9.5 for my read replica. Also if possible please elaborate how I can implement master - master configuration for servers to be read-writable and 2 way synchronization
A PostgreSQL read replica(same or different region) is a physical copy, and PostgreSQL doesn't allow for a read replica to be made writable although you can promote a PostgreSQL read replica into a standalone DB instance.
This is a good read about best practices regarding RDS PostgreSQL read replicas replication
I have a few questions about MongoDB standalone and Replica sets, I don't really get it.
When should I use either of them
Why all the replica sets tutorials show 3 connections, is there a reason?
Can I create a replica set for 1 instance only? and in that case how is it different than the standalone mongodb instance?
How to Migrate data from a standalone instance to replica sets?
All these questions I'm asking because recently I was trying to implement transactions and sessions can only start on "replica sets" I don't really get the difference at all.
When should I use either of them?
Replication is the process of synchronizing data across multiple servers. Replication provides redundancy and increases data availability with multiple copies of data on different database servers. Replication protects a database from the loss of a single server. Replication also allows you to recover from hardware failure and service interruptions. With additional copies of the data, you can dedicate one to disaster recovery, reporting, or backup.
To keep your data safe
High (24*7) availability of data
Disaster recovery
No downtime for maintenance (like backups, index rebuilds, compaction) Read scaling (extra copies to read from)
Replica set is transparent to the application
Why all the replica sets tutorials show 3 connections, is there a reason?
The basic implementation to take full advantage of replication specifies you
should have at least one primary node with two secondary nodes. So the
examples are always with 3 nodes. Not only this if from 3 the
Primary node goes down you still have 2 nodes (mongoDB will assign
using arbiter rule) and one primary and one secondary for high availability
Can I create a replica set for 1 instance only? and in that case how is it different than the standalone mongodb instance?
It does not make sense to have single instance with mongo replication.
How to Migrate data from a standalone instance to replica sets?
Convert a Standalone to a Replica Set . Your existing data will be migrated to all replication instances once they are up and running when converted to replication sets from standalone.
I am looking at either setting up Aurora Postgresql or RDS Postgresql instance in AWS.
I would like the db instance to be running in 2 different regions and would like real time replication to be set up. I would also like no downtime for rehydration / patching etc.
Based on what I have read / discussed with colleagues so far , I am under the impression that Aurora Postgresql is the option to choose because RDS needs few minutes of downtime for rehydration and Aurora supports realtime replication of db instance across different regions.
Is my understanding correct and are there any other factors that I should be aware of?
No RDS product supports "real-time" replication across regions. Cross-region replication is always asynchronous.
You can expect to see a higher level of lag time for any Read Replica that is in a different AWS Region than the source instance, due to the longer network channels between regional data centers.
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html#USER_ReadRepl.XRgn
Additionally, cross-region replicas for Aurora/Postgres are not yet available.
Cross-region replicas are only available for Aurora/MySQL... but a cross-region replica is not for zero downtime or failover, anyway -- it's only for geo/latency-based read scale-out or disaster recovery, because once you promote the replica, the original master has to be abandoned, because replication is one-way.
If, when you said "region," you were actually referring to availability zones, then that is much more straightforward, since the backing store of Aurora instances is replicated across 3 availability zones within the region, and replication is synchronous. All replicas in a single region can be synchronous, even in different AZs, since they all share the same replicated storage.
Is there some kind of native Postgres tool they use, or is it a custom one? Are the replicas always in sync or do they drift apart from time to time?
With Multi-AZ RDS replication is synchronous. And since AWS like to be in full control of their software, it’s most likely a customised replication (but I couldn’t tell you for sure).
Given that MongoDB describes Replica-Pairs replication as
...databases automatically coordinate
which is the master and which is the
slave at a given point in time.
At startup, the databases will
negotiate which is master and which is
slave. Upon an outage of one database
server, the other will automatically
take over and become master from that
point on.
how is this different from Master-Master replication?
With replica pairs, only one database is master at a time, so only one database can be written to at a time. The second database will always be a slave, available for failover,
With master-master replication, which is discouraged with MongoDB, both nodes can be written to.