Amazon DynamoDB

Features

  • Fully Managed NoSQL
  • Document of Key-value
  • Scales to any workload
  • Fast and Consistent
  • Access Control
  • Event Driven Programming

NoSQL Data Modeling

  • Understand the use case
    • Nature of the application
      • OLTP / OLAP /DSS
    • Define the Entity-Relationship Model
    • Identify Data Life Cycle
      • TTL, Backup/Archival, etc.
  • Identify the access patterns
    • Read/write workloads
      • Identify data sources
      • Define query aggregations
      • Document all workflows
    • Query dimensions and aggregations
  • Data-modeling
    • Avoid relation design patterns, use one table
    • 1 application service = 1 table
      • Reduce round trips
      • Simplify access patterns
    • Identify Primary Keys
      • How will items be inserted and read?
      • Overload items into partitions
    • Define indexes for secondary access patterns
  • Review -> Repeat -> Review

Terminology

  • Table
  • Items
  • Attributes
  • Partition Key
    • Partition Key uniquely identifies an item
    • Partition Key is used for building an unordered hash index
    • Allows table to be partitioned for scale
  • Sort Key
  • Local Secondary Index (LSI)
    • Alternate sort key attribute
    • Index is local to a partition key
  • Global Secondary Index (GSI)
    • Alternate partition and/or sort key
    • Index is across all partition keys
    • Use composite sort keys for compound indexes
  • DynamoDB Table Schema
    • Contact Partitions
    • Configuration Items
    • Resolver Partitions
    • Resolver Metadata

Videos

Reference