CS FundamentalsHardProduct-company placement · system design
A table of user events is sharded by event date, and all writes for today land on one shard, which is overloaded while others sit idle. What is the best change?
- A. Add more shards but keep event date as the key
- B. Shard by a well-spread key, such as hashed user ID
- C. Move the hot shard onto a server with faster disks
- D. Add a global secondary index on the date column
Correct answer: B. Shard by a well-spread key, such as hashed user ID
A monotonically increasing key such as a date or timestamp sends every new write to one partition. Hashing a high-cardinality key spreads writes; more date shards still put all of today on one of them.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- Match each cost-of-quality category with an example. P. Prevention Q. Appraisal R. Internal failure S. External failure 1. Reworking a…
- An inspection of 500 delivered forms finds 25 defects, and each form has 10 opportunities for a defect. What is the…
- What value does this Command pattern code print? python v = [0] class Add: def init(s, n): s.n = n def do(s): v[0] += s.n def undo(s)…
- Counting each if, while and conditional expression as one decision (V(G) = decisions + 1), what is the cyclomatic complexity of g, and…
- Module ownership: A is known by Ravi and Sita, B by Sita and Aman, C by Aman and Ravi, D by Ravi and Joe. The bus factor is the fewest…
- Intermediate COCOMO for an organic project uses Effort = 3.2 × KLOC^1.05 × EAF person-months. A 30 KLOC system has two non-nominal cost…