70 %
Chris Biscardi

DynamoDB

  • WTF is DynamoDB?

DynamoDB is a low latency, serverless-compatible database. It can handle scale you'll probably never see and comes with encryption-at-rest, backup-and-restore, and a transparent caching layer to eek out faster-than-millisecond performance. It's fully managed, which means you're not worrying about servers, containers, or scaling and comes in a variety of pricing models to fit your use case, such as on-demand, provisioned and reserved. If you know your access patterns and can fit them into DynamoDB, you'll be able to scale easily.

When AWS moved from Oracle to their own databases, the low-latency services were migrated to DynamoDB (https://aws.amazon.com/blogs/aws/migration-complete-amazons-consumer-business-just-turned-off-its-final-oracle-database/)

How DynamoDB works

  • [High Level]: Tables, Items, and Attributes (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html)
  • -- JS key string in Set, object associated with it
  • Primary Keys (vs partition keys and sort keys)
  • Secondary Indexes (LSIs vs GSIs)
  • Write Capacity Units and Read Capacity Units
  • TTL

Terraform?

  • Working with local dynamo vs a production dynamo table (do prod)
  • creating dynamodb with terraform
  • keys
  • Primary key vs partition key and sort key

DocumentClient

DocumentClient is a high-level client. There are low-level clients that we won't be diving in to. There are even *higher* level clients that we also won't be diving in to. Three types of clients are: Low-Level Interfaces, Document Interfaces, and Object Persistence interface (Java+C# only)

operations

  • get
  • put
  • delete
  • update
  • batchGet
  • batchWrite
  • query
  • scan
  • transactGet
  • transactWrite

JS client notes

  • .promise() vs callback()
  • documentclient is a high-level client

Error Handling

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html

DynamoDB Streams

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html

  • WTF are Streams
  • DynamoDB Streams and TTL
  • Streams and Lambda Triggers
  • https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.Lambda.html
  • Streams as a way to store history in another dynamodb table

Relationship types

  • one-to-many
  • Many-to-many relationships
  • Uniqueness requirements (transactions)

Backups

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Backup.Tutorial.html

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/backuprestore_HowItWorks.html

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/BackupRestore.html

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Restore.Tutorial.html

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/backuprestore_IAM.html

  • on demand backup and restore to a separate table

Modeling Systems

Approaches to building different kinds of systems. Depends how long they are, might be courses in and of themselves.

Modelling Twitter

  • User can see other's tweets
  • User can see their own tweets