Question 71
HardWhy do many NoSQL databases encourage denormalisation?
- A.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
DBMS
Why do many NoSQL databases encourage denormalisation?
Joins across partitions are expensive or unsupported, so data is stored the way it will be read
It improves write consistency
Normalisation is impossible
Denormalised data is smaller
Sign up free to see the answer and a step-by-step explanation.
What does a document database's schema flexibility cost?
The application must handle documents with missing or different fields
Nothing at all
It can't store JSON
It can't index fields
Sign up free to see the answer and a step-by-step explanation.
Redis is used as a cache in front of a database. Which pattern loads data into the cache only when it is requested and missing?
Refresh-ahead
Write-through
Write-behind
Cache-aside (lazy loading)
Sign up free to see the answer and a step-by-step explanation.
What is the 'thundering herd' problem with caches?
Keys never expire
Too many cache servers
Many requests miss at once when a popular key expires, overloading the database
The cache is too small to start
Sign up free to see the answer and a step-by-step explanation.
What does a graph database's index-free adjacency mean?
Nodes can't have properties
Each node stores direct references to its neighbours, so traversals don't need index lookups
Edges are stored in a separate table
There are no indexes at all
Sign up free to see the answer and a step-by-step explanation.
Which consistency model guarantees that if one client sees a write, any later read by a client that has seen it also sees it?
No consistency
Causal consistency
Eventual consistency
Read uncommitted
Sign up free to see the answer and a step-by-step explanation.
What is a 'read repair' in replicated stores?
Repairing indexes after crashes
When a read finds stale replicas, it updates them with the latest value
Deleting old data
Fixing disk errors
Sign up free to see the answer and a step-by-step explanation.
A time-series database is ideal for which data?
Sensor readings or metrics with timestamps, written continuously
A social network
Bank account balances needing joins
A product catalogue
Sign up free to see the answer and a step-by-step explanation.
Why might a write to a single-leader replicated database appear to 'go back in time' to a user?
The leader deleted it
Their next read went to a lagging follower that had not yet received the write
Clocks run backwards
Writes are never stored
Sign up free to see the answer and a step-by-step explanation.
What is the main purpose of sharding by a hash of the user ID?
To sort users by name
To spread users evenly across shards
To keep all users on one shard
To encrypt user IDs
Sign up free to see the answer and a step-by-step explanation.