0
0
HLDsystem_design~10 mins

Database replication (master-slave) in HLD - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to identify the role of the primary database in replication.

HLD
The primary database is also known as the [1] node in master-slave replication.
Drag options to blanks, or click blank then click option'
Aslave
Breplica
Cmaster
Dclient
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing master with slave roles
Thinking the slave handles writes
2fill in blank
medium

Complete the code to describe how slaves receive data updates.

HLD
Slaves receive data updates from the master through [1] replication.
Drag options to blanks, or click blank then click option'
Asynchronous
Basynchronous
Cmanual
Dbatch
Attempts:
3 left
💡 Hint
Common Mistakes
Assuming replication is synchronous by default
Confusing manual updates with automatic replication
3fill in blank
hard

Fix the error in the replication flow description.

HLD
The master sends write queries directly to the [1] databases to keep them updated.
Drag options to blanks, or click blank then click option'
Acache
Bclients
Cbackup
Dslave
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing clients with slaves
Thinking backups are updated live by the master
4fill in blank
hard

Fill both blanks to complete the replication consistency model.

HLD
In [1] replication, the master does not wait for slaves to confirm writes, which can cause [2] lag.
Drag options to blanks, or click blank then click option'
Aasynchronous
Bsynchronous
Creplication
Dreplica
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing synchronous and asynchronous terms
Using 'replica' instead of 'replication' for lag
5fill in blank
hard

Fill all three blanks to complete the replication setup code snippet.

HLD
replication_config = { 'role': '[1]', 'sync_mode': '[2]', 'failover': '[3]' }
Drag options to blanks, or click blank then click option'
Amaster
Basynchronous
Cautomatic
Dslave
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing master and slave roles
Choosing synchronous mode for master by default
Failing to set failover to automatic