Database / ValKey Interview questions
Explain the execution flow of primary-replica replication in Valkey?
A replica initiates synchronization by sending PSYNC along with the replication ID and offset it last saw; the primary decides whether a partial or a full resynchronization is possible based on whether that offset is still covered by its backlog.
For a full resync, the primary forks to stream an RDB snapshot (or streams it diskless, straight over the socket); once loaded, the replica keeps applying the live write stream from the backlog and periodically reports its progress back with REPLCONF ACK.
More Related questions...