AWS. Lesson 1. DynamoDB
Table of contents
DynamoDB is similar to MongoDB in some ways, but they also have key differences. Here's a comparison:
Similarities
NoSQL Databases – Both are NoSQL databases, meaning they don’t use structured SQL tables like MySQL or PostgreSQL.
DynamoDB: Key-value & document store
MongoDB: Document store (JSON-like BSON format)
Scalability – Both are highly scalable and designed for big data.
DynamoDB: Automatically scales read/write capacity.
MongoDB: Uses sharding and replication for scale.
Flexible Schema – Unlike SQL databases, both allow schema-less data storage.
DynamoDB: Allows nested JSON objects within attributes.
MongoDB: Stores data as flexible BSON documents.
Indexes – Both support indexing for faster queries.
DynamoDB: Primary key, sort key, secondary indexes.
MongoDB: Indexes on any field for fast retrieval.
Differences
Feature | DynamoDB | MongoDB |
Data Model | Key-Value & Document | Document-Oriented |
Storage | Fully Managed (AWS) | Self-hosted or Managed (Atlas) |
Query Language | NoSQL API | MongoDB Query Language (MQL) |
Performance | Fast for key-value lookups | Fast for complex queries |
Transactions | Limited transactions | Supports ACID transactions |
Hosting | AWS Only | On-premise or Cloud |
Cost Model | Pay-per-use (Read/Write units) | Storage-based pricing |
Which One to Use?
Choose DynamoDB → If you're using AWS and need serverless, auto-scaled, high-performance NoSQL.
Choose MongoDB → If you need complex queries, full-text search, or self-hosted control.