All Questions
Dynamodb hard

How does the `TotalSegments` parameter in a 'Parallel Scan' ensure consistent data retrieval without reading the same items twice across threads?

  1. A It uses a global distributed lock on the table for each thread's segment.
  2. B Logical Partitioning: DynamoDB uses a deterministic hashing algorithm to divide the entire key-space into N logical segments. Each thread is assigned a specific `Segment` ID (0 to N-1), ensuring that worker threads operate on mutually exclusive subsets of the data.
  3. C Threads coordinate via a shared Amazon SQS queue that tracks scanned metadata.
  4. D AWS automatically manages the threads and merges the results in a temporary S3 bucket.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions