Repaso
EspaƱol
Databases & SQLIntermediateDB-15

Replication vs sharding: which statement is correct?

Options

  1. Both split the data across nodes, using the same technique
  2. Replication copies data to nodes; sharding splits data across them (Correct option)
  3. Sharding is only used for caching the results of queries
  4. Replication improves write throughput in a linear way

Answer

Replication copies the same data to several nodes (read scaling, availability); sharding partitions data across nodes (write and storage scaling)

Why

Replication: several servers hold a COPY of the same data. If one dies, another takes over, and reads can be spread across copies.

Sharding: data is SPLIT; each server holds a different part (e.g. users A-M on one, N-Z on another). This scales writes and storage.

Sharding needs a good shard key and makes queries across shards harder.

Remember

Replication = copies. Sharding = pieces.

Key terms

Practice this question in Repaso