1.
Slave Database
A slave database (now more commonly called a replica or read replica) is a database that
copies data from a master (primary) database.
How it works
• One master/primary database handles writes (INSERT, UPDATE, DELETE).
• One or more slave/replica databases receive replicated data from the master.
• Slaves are usually read-only.
Purpose
• Improve performance – read queries are spread across replicas.
• High availability – if the master fails, a replica may be promoted.
• Backup & reporting – heavy queries run on slaves instead of the master.
Example
In MySQL replication:
• Master DB → writes data
• Slave DB → keeps a synchronized copy and serves SELECT queries
Key characteristics
• Same schema as the master
• Data is copied, not independently stored
• Can have replication lag
2. Federated Database
A federated database is a system that connects multiple independent databases and lets
users query them as if they were a single database.
How it works
• Data remains in different databases (possibly different vendors).
• A federated layer provides a unified interface.
• Queries are distributed to the appropriate databases and results are combined.
Purpose
• Data integration across systems
• No need to copy data into one central database
• Useful when databases are owned by different teams or organizations
Example
• A company queries:
o Customer data from Oracle
o Orders from MySQL
o Analytics from PostgreSQL
…using one SQL query through a federation layer.
Key characteristics
• Databases are autonomous
• No single “master”
• Can be slower due to network and query translation overhead