Fundamentals Of DynamoDB

Work In Progress

Dynamo DB's Approach

  • Hash index is used for partitioning the data.
  • Each partition is stored on a different machine.
  • Each partition is replicated to multiple machines.

Indexing in Dynamo DB

Partition Key Sort Key Attribute 1 Attribute 2
1 1 Value 1 Value 2
1 2 Value 3 Value 4
2 1 Value 5 Value 6
2 2 Value 7 Value 8
3 1 Value 9 Value 10

Indexing in Dynamo DB

  • Partition key can only be used for equality queries becuase it uses hash index.
  • Sort key can be used for range queries becuase it uses BTree index.

Pagination in Dynamo DB

  • Dynamo DB uses a limit and a start key to paginate the results.
  • Limit is the number of items to return.
  • Start key is the key to start from (It is the last key which is evaluated).
  • Dynamo DB returns a next key if there are more items to return.

Sorting in Dynamo DB

  • Dynamo DB uses sort key to sort the results.
  • Sort key can be used to sort the results in ascending or descending order.
  • Sort key can be used to filter the results.
  • It works in time complexity.

Dynamo DB Batch Operations

  • Dynamo DB supports batch operations.
  • Batch operations are used to perform multiple operations in a single request.
  • Batch operations are more efficient than performing multiple operations in separate requests.
  • Batch read operations are limited to 100 items.
  • Batch write operations are limited to 25 items.

Dynamo DB Transactions

  • Dynamo DB supports transactions.
  • Transactions are used to perform multiple operations in a single request.
  • Transactions are used to ensure that all operations are successful or none of them are.