Amazon DynamoDB
Amazon DynamoDB is a fully managed NoSQL database service on the Amazon Web Services cloud that provides key-value and document data models with predictable performance at any scale.Amazon DynamoDB 是亚马逊云服务云上的一项全托管 NoSQL 数据库服务,提供键值与文档两种数据模型,在任意规模下保持可预测性能。
It is a serverless offering, meaning customers create tables and pay for consumed capacity instead of provisioning and operating database servers themselves.它是无服务器产品,客户只需建表并按消耗容量付费,无需自行部署与运维数据库服务器。
Features
- A table is a collection of items, each identified by a primary key made of a partition key and an optional sort key, with attributes carried as flexible name-value pairs.表是条目的集合,每条以由分区键与可选排序键组成的主键标识,属性以灵活的名称-值对携带。
- Global and local secondary indexes let applications query on attributes other than the primary key, trading a little write cost for faster lookups and scans.全局与本地二级索引让应用可用主键之外的属性查询,以少量写入成本换取更快的查找与扫描。
- Capacity can be provisioned in advance, switched to on-demand mode for unpredictable traffic, or boosted with a warm throughput tier that removes cold-start delays.容量可提前预置,也可切换为面向不可预测流量的按需模式,或借助去除冷启动延迟的预热吞吐档位提升。
- Reads default to eventual consistency, and a strongly consistent read is available at double the request-unit cost when the application requires it.读取默认最终一致,当应用需要时可用双倍请求单位成本换取强一致读取。
- TransactWriteItems and TransactGetItems bundle up to one hundred operations into atomic all-or-nothing transactions across multiple tables.TransactWriteItems 与 TransactGetItems 可把最多一百项操作打包为跨多张表的全有或全无原子事务。
- DynamoDB Streams captures item-level changes in order, and AWS Lambda triggers turn those events into workflow automations without managing servers.DynamoDB Streams 按序捕获条目级变更,AWS Lambda 触发器把这些事件转为工作流自动化,无需管理服务器。
- Global tables replicate the same data across multiple regions with active-active multi-region writes, and a multi-region strong consistency mode arrived in the mid-2020s.全局表把相同数据复制到多个区域并支持多区域双活写入,多区域强一致模式于 2020 年代中期推出。
- DynamoDB Accelerator, or DAX, adds an in-memory cache in front of the store, cutting read latencies to microseconds for repeated hot-key access patterns.DynamoDB Accelerator(简称 DAX)在存储前架设内存缓存,把重复热键访问的读取延迟降到微秒级。
- On-demand and point-in-time backups protect data, while a per-item time-to-live automatically expires stale records, complementing the built-in encryption of data at rest and in transit.按需备份与时间点恢复保护数据,逐条设置的生存时间自动让过期记录失效,与静态及传输数据的默认加密互补。
- Zero-ETL integrations replicate data into Amazon Redshift and S3-based Iceberg tables for analytics, and PartiQL offers a SQL-compatible query dialect over the table data.零 ETL 集成把数据复制到 Amazon Redshift 与基于 S3 的 Iceberg 表供分析,PartiQL 则为表数据提供兼容 SQL 的查询方言。
- The service handles partitioning, replication and failover internally, so failures are absorbed without operator intervention and capacity scales with a single console change.服务内部处理分区、复制与故障转移,故障无需运维介入即可被吸收,容量调整只需一次控制台变更。
- CloudWatch metrics, AWS CloudTrail logging and IAM-based access control integrate with the wider AWS governance model, making DynamoDB a natural fit for regulated workloads.CloudWatch 指标、AWS CloudTrail 日志与基于 IAM 的访问控制融入 AWS 更广的治理模型,让 DynamoDB 天然契合受监管负载。
History
- The service descends from Dynamo, an internal Amazon system described in a 2007 paper from the Symposium on Operating Systems Principles.该服务源自 Dynamo——2007 年操作系统原理研讨会论文中描述的亚马逊内部系统。
- That paper documented a decentralised key-value store using consistent hashing, quorum replication, hinted handoff and vector clocks to prioritise availability and low latency.该论文描述了一个去中心化键值存储:用一致性哈希、法定人数复制、提示移交与向量时钟来优先保证可用性与低延迟。
- The design influenced open-source projects such as Apache Cassandra, Riak and Voldemort, giving Dynamo broad academic and practical influence beyond Amazon.该设计影响了 Apache Cassandra、Riak 与 Voldemort 等开源项目,使 Dynamo 在亚马逊之外产生深远的学术与实践影响。
- Amazon announced DynamoDB at its re:Invent conference in late 2011, presenting a managed service that would deliver Dynamo-style behavior without operational burden.亚马逊于 2011 年底的 re:Invent 大会宣布 DynamoDB,把它定位为免运维、却能提供 Dynamo 式行为的托管服务。
- The service became generally available in January 2012, at first emphasising consistent low latency over fixed capacity provisioning rather than server administration.服务于 2012 年 1 月正式可用,初期强调在固定容量配置下的稳定低延迟,而非服务器管理。
- Global secondary indexes launched in 2014, followed by streams and triggers in 2015 and the in-memory DAX cache in 2016, each extending the query and latency envelope.全局二级索引于 2014 年推出,2015 年跟进流与触发器,2016 年新增内存缓存 DAX,不断扩展查询与延迟边界。
- Global tables arrived in late 2017, letting the same table span regions with conflict resolution, and a transactions API became generally available in late 2018.全局表于 2017 年底推出,让同一张表跨区域存在并具备冲突解决,事务 API 于 2018 年底正式可用。
- An on-demand capacity mode followed in 2019, complemented by point-in-time recovery enhancements and free-tier allowances that lowered the entry barrier for new projects.按需容量模式于 2019 年跟进,配合时间点恢复强化与免费额度,降低了新项目的准入门槛。
- Zero-ETL integrations to Amazon Redshift expanded through 2022 and 2023, and the mid-2020s added S3-based Iceberg replication plus analytical access through engines such as DuckDB.面向 Amazon Redshift 的零 ETL 集成在 2022 与 2023 年间扩展,2020 年代中期又增加基于 S3 的 Iceberg 复制以及经 DuckDB 等引擎的分析访问。
- Through the mid-2020s the service continued to add multi-region strong consistency, warm throughput and AI-era storage backends for agent applications.2020 年代中期服务持续新增多区域强一致、预热吞吐以及面向智能体应用的人工智能时代存储后端。
Reception
- DynamoDB became the default managed database for countless AWS workloads, and it is widely cited as a reference point for serverless data storage.DynamoDB 成为无数 AWS 负载的默认托管数据库,也常被引为无服务器数据存储的参照点。
- Users praise the operational simplicity, predictable latency and deep native integration with Lambda, but costs can be hard to forecast when access patterns shift.用户称赞其运维简单、延迟可预测以及与 Lambda 的深度原生集成,但访问模式变化时成本难以预测。
- The query model draws criticism, since accessing data by non-key attributes requires secondary indexes or scans that consume capacity and scale poorly on large tables.查询模型受到批评,因为按非键属性访问数据需借助二级索引或扫描,后者消耗容量且在大表上扩展性差。
- Designers debate single-table versus multi-table modeling, and the 400-kilobyte item size limit plus attribute restrictions push some document-heavy workloads toward other stores.设计者争论单表与多表建模之别,400 千字节的条目大小上限与属性限制也让部分文档密集负载转向其他存储。
- Hot partitions remain a well-known operational hazard, because a skewed key distribution concentrates traffic on a handful of physical partitions.热分区仍是众所周知的运维隐患,因为偏斜的键分布会把流量集中到少数物理分区上。
- Compared with self-managed Cassandra, DynamoDB trades tunability and cost control for convenience, a trade many teams accept for speed of delivery.与自管的 Cassandra 相比,DynamoDB 用可调性与成本控制换取便利,许多团队为交付速度接受这一交换。
- The original Dynamo paper is regarded as a landmark in distributed systems, and its ideas continue to shape teaching and research on replication and consistency.原始 Dynamo 论文被视为分布式系统领域的里程碑,其思想持续影响复制与一致性方向的教学与研究。
- The AWS documentation and the official AWS database blog provide authoritative guidance, with the original launch post by Jeff Barr still a familiar reference point.AWS 官方文档与数据库博客提供权威指引,Jeff Barr 的原始发布帖至今仍是为人熟知的参考。
- DynamoDB Local runs the service on a developer machine for offline testing, and NoSQL Workbench offers a visual tool for data modeling and query design.DynamoDB Local 让服务在开发者机器上离线运行以供测试,NoSQL Workbench 则为数据建模与查询设计提供可视化工具。
- First-party SDKs span most mainstream languages, and third-party libraries such as Dynamoose and PynamoDB add familiar object-mapping abstractions on top.官方 SDK 覆盖大多数主流语言,Dynamoose、PynamoDB 等第三方库在其上叠加熟悉的对象映射抽象。
- PartiQL support gives SQL-oriented developers a gentle entry path, and curated example projects demonstrate common application patterns end to end.PartiQL 支持为习惯 SQL 的开发者提供平缓的入门路径,精选示例项目端到端演示常见应用模式。
- re:Invent sessions, AWS Skill Builder courses and the AWS Certified Data Analytics track teach design and operations at scale.re:Invent 演讲、AWS Skill Builder 课程与 AWS 认证数据分析方向讲授规模化场景的设计与运维。
- Infrastructure-as-code templates in the AWS CDK and CloudFormation, plus community tools such as dynalite, make the service easy to automate and emulate locally.AWS CDK 与 CloudFormation 中的基础设施即代码模板,以及 Dynalite 等社区工具,让服务易于自动化与本地模拟。
- Apache Cassandra is the best-known open-source realization of the Dynamo ideas, offering a self-managed wide-column store that many teams operate themselves.Apache Cassandra 是 Dynamo 思想最著名的开源实现,提供由团队自行运维的宽列存储。
- ScyllaDB reimplements the Cassandra model in C++ with a shard-per-core design, targeting higher per-node throughput and lower latency.ScyllaDB 以每核一分片设计用 C++ 重写 Cassandra 模型,追求更高的单节点吞吐与更低延迟。
- Azure Cosmos DB is the closest major-cloud counterpart, pairing global distribution with several consistency levels and multiple API compatibility options.Azure Cosmos DB 是对标最接近的主流云产品,把全球分布与多种一致性级别、多 API 兼容选项结合。
- MongoDB Atlas offers flexible document queries and a mature aggregation pipeline, appealing when rich querying matters more than serverless simplicity.MongoDB Atlas 提供灵活的文档查询与成熟的聚合管道,当丰富查询比无服务器简洁更重要时更具吸引力。
- Google Cloud Firestore targets mobile and web applications with automatic synchronization, while Cloud Spanner addresses globally consistent relational workloads.谷歌云 Firestore 面向移动与网页应用的自动同步,Cloud Spanner 则解决全球一致的关系型负载。
- Redis and its AWS managed form ElastiCache complement DynamoDB as a caching tier for hot data, sharing the key-value heritage with different persistence models.Redis 及其 AWS 托管形态 ElastiCache 以缓存层身份与 DynamoDB 互补服务热数据,同属键值血统但持久化模型不同。
- Aerospike offers a self-hosted, high-throughput key-value database over flash storage, chosen when teams prefer infrastructure control over managed convenience.Aerospike 提供基于闪存的自托管高吞吐键值数据库,当团队偏好基础设施控制权胜过托管便利时会选它。