Definition
An extra index on a non-primary-key field so you can query by it without scanning everything.
How it works
Speeds up reads on that field at the cost of slower writes (every write updates the index too) and more storage. In distributed stores, a global secondary index may live on different nodes than the data, turning a lookup into a scatter-gather. Index the fields you filter on — not every column.
Common questions
What is Secondary Index?
An extra index on a non-primary-key field so you can query by it without scanning everything.
How does Secondary Index work?
Speeds up reads on that field at the cost of slower writes (every write updates the index too) and more storage. In distributed stores, a global secondary index may live on different nodes than the data, turning a lookup into a scatter-gather. Index the fields you filter on —…
What is Secondary Index used for in system design?
Speeds up reads on that field at the cost of slower writes (every write updates the index too) and more storage. In distributed stores, a global secondary index may live on different nodes than the data, turning a lookup into a scatter-gather. Index the fields you filter on —…