dynobase-icon
Dynobase

Introduction to DynamoDB - Everything You Need to Know

Written by Rafal Wilinski

What is DynamoDB?

DynamoDB is a fast NoSQL Database developed and fully managed by Amazon Web Services (AWS). It's often referred to as a key-value store, but DynamoDB offers much more than that, including Streams, Global and Local Secondary Indexes, Multiregion, and Multimaster replication with enterprise-grade security and in-memory caching for big scale.

Unlike traditional RDBMS databases, you don't have to provision a "database" or underlying machines. All you need to do is create a table and start writing and reading data from it. It's web-scale and production-ready right from the start.

DynamoDB is a perfect choice for Serverless applications because it follows the pay-what-you-use model and integrates perfectly with AWS Lambda and other services from AWS.

Table of Contents

Key facts

ModelKey-value Store, Document
Websiteaws.amazon.com/­dynamodb/
TypeNoSQL
Developed byAmazon
Initial Release DateJanuary 18, 2012
Cloud-basedYes, fully managed, no servers to provision or manage
Runnable locallyNo (technically yes, but only for test and dev purposes)
Open SourceNo
Data schemeSchema-less
SQL SupportGenerally no, possible via AWS Athena
APIYes, RESTful HTTP API
Supported LanguagesJavascript, Typescript, Java, C# (.Net), Go, Php, Python, Ruby, Perl, Haskell, Erlang
Stored ProceduresNo
TriggersYes, Streams
ConsistencyEventual
Mult-masterYes
Multi-regionYes
Transactions supportYes, ACID
BackupsYes, including point-in-time without downtime
MonitoringYes, with CloudWatch
Capacity modesProvisioned (with optional scaling), On-Demand
EncryptionYes, using KMS customer or AWS managed
ScalabilityYes, up to 10 trillion requests per day and 20M requests per second
CachingYes, possible using DynamoDB Accelerator (DAX)

DynamoDB Updates & Feature Releases [2012 - Today]

DynamoDB Releases Chart

DateTitle
08 Apr 20Amazon DynamoDB global tables are now available in the AWS China (Beijing) Region, operated by Sinnet, and the AWS China (Ningxia) Region, operated by NWCD
02 Apr 20Amazon CloudWatch Contributor Insights for Amazon DynamoDB is now available in the AWS GovCloud (US) Regions
02 Apr 20Amazon CloudWatch Contributor Insights for Amazon DynamoDB is now generally available
16 Mar 20You now can update your Amazon DynamoDB global tables from version 2017.11.29 to the latest version with a few clicks in the DynamoDB Console
16 Mar 20Amazon DynamoDB on-demand capacity mode is now available in the Asia Pacific (Osaka-Local) Region
12345678910Next

When to use DynamoDB

DynamoDB is a perfect choice for all sizes of applications, especially if your application needs predictable read and write performance. DynamoDB thanks to automatic scaling is able to survive the biggest traffic spikes.

DynamoDB can be used for almost anything, including:

  • Simple key-value store
  • Relational data store (Using Adjacency List Pattern)
  • Geographical data using Geohashing
  • Timeseries
  • Caching
  • Event-driven transaction processing
  • Game stats and session history
  • Leaderboards
  • Shopping carts
  • Workflow engines
  • User content metadata stores
  • Relatiionship graph data stores

When not to use DynamoDB

Even though DynamoDB can be used for almost anything you can imagine, there are some cases when you shouldn't use it.

  1. If your software is running outside of AWS Cloud, like inside other cloud or on-premise, you might consider storing your data closer to your application in order to minimize latency between database and service.
  2. If you need to use SQL.

Autoscaling

DynamoDB supports two scaling modes:

  • Provisioned with Autoscaling - DynamoDB adjusts the amount for "Write Capacity Units" (WCU) and "Read Capacity Units" (RCU)
  • On-Demand Mode - requires from you no capacity planning at all, billed on per-request basis

Regions

DynamoDB is available in the following 19 regions:

  • US East (Ohio) us-east-2
  • US East (N. Virginia) us-east-1
  • US West (N. California) us-west-1
  • US West (Oregon) us-west-2
  • Asia Pacific (Hong Kong) ap-east-1
  • Asia Pacific (Mumbai) ap-south-1
  • Asia Pacific (Osaka-Local) ap-northeast-3
  • Asia Pacific (Seoul) ap-northeast-2
  • Asia Pacific (Singapore) ap-southeast-1
  • Asia Pacific (Sydney) ap-southeast-2
  • Asia Pacific (Tokyo) ap-northeast-1
  • Canada (Central) ca-central-1
  • Europe (Frankfurt) eu-central-1
  • Europe (Ireland) eu-west-1
  • Europe (London) eu-west-2
  • Europe (Paris) eu-west-3
  • Europe (Stockholm) eu-north-1
  • Middle East (Bahrain) me-south-1
  • South America (São Paulo) sa-east-1

Anatomy of DynamoDB

Data in DynamoDB is arranged into "Tables". Each Table consists of "Items". Each "Item" consists of "Attributes".

Notable use cases

  • DynamoDB is used by Amazon.com and by fulfilment centres. During the Prime Day, there were made 7.11 trillion calls to the DynamoDB API, peaking at 45.4 million requests per second.
  • DynamoDB is used by Lyft for tracking all rides.
  • Netflix uses DynamoDB to run A/B tests.
  • Snapchat uses DynamoDB for Stories.

Frequently Asked Questions

What is DynamoDB used for?

DynamoDB has a variety of use cases ranging from simple key-value stores through traditional relational databases and even time series.

Is DynamoDB fast?

It depends. DynamoDB might seem slower than some in-memory stores like Redis but DynamoDB is persistent and has different use cases. It’s "the webscale" where DynamoDB outperforms all traditional relational databases. It has very predictable performance, no matter the size of your dataset, whether it’s only 1GB or 100TB, the speed of reads and writes remains the same, actually, it gets even better with scale. DynamoDB proved to be capable of serving over 45 million requests per second during Prime Day.

Does DynamoDB Support SQL?

Out of the box, no. Fortunately, there are few options to query DynamoDB with SQL:

  1. Use Athena Federated Queries
  2. Use dql or some other Open Source solutions
  3. Soon it will be possible with Dynobase

Is Redis faster than DynamoDB?

It’s comparing apples to oranges. While Redis is in-memory data store, perfect for caches or sessions store, DynamoDB is persistent NoSQL database. While Redis is superfast for small datasets, it gets pricier and pricier.

Is DynamoDB serverless?

Yes, DynamoDB is “serverless” in a sense that you don’t have to manage it or patch and care about underlying servers or software that it runs on. It’s fully administered by AWS and all you need to do is just use it.

Is DynamoDB highly available?

Yes, it’s highly available, scalable, and distributed data store.

Is DynamoDB columnar database?

No. If you’re looking for a columnar database, consider using Redshift.

When to use DynamoDB vs S3?

While S3 is object storage, DynamoDB is NoSQL database. S3 is more suitable for storing large files durably while DynamoDB is rather Key-Value store optimized for huge amount of data and concurrent operations.

Does DynamoDB support atomic updates?

Yes, DynamoDB like many other databases support transactions. With TransactGetItems and TransactWriteItems you can read/write up to 25 items per transaction.

Is DynamoDB eventually consistent?

There are two modes that user can use when working with DynamoDB:

  1. Strong Consistency (Read-after-Write)
  2. Eventual Consistency

Is DynamoDB a memory store?

While DynamoDB is not in-memory store, DynamoDB Accelerator (DAX) is an in-memory cache supplementing DynamoDB tables that delivers fast read performance for your tables at scale by enabling you to use a fully managed in-memory cache.

How to Add a Column in DynamoDB?

DynamoDB doesn't have a concept of columns. Each item consists of a Key and the attributes. Because it's a NoSQL database and doesn't have a strict schema, each item can have a different set of attributes, you can write whatever you like in each operation.

Resources

Dynobase is a Professional GUI Client for DynamoDB

Start your 7-day free trial today

Product Features

© 2020 Dynobase

+
Annoyed by DynamoDB Console?
Try Dynobase. Start your 7-day free trial today