Amazon DocumentDB (with MongoDB compatibility) is a document database service that is purpose-built for JSON data management at scale, fully managed and integrated with AWS, and enterprise-ready with high durability. This scalable service offers customers the durability needed when operating mission-critical MongoDB workloads. In Amazon DocumentDB, storage scales automatically up to 64 TiB, and up to 2 PB in Amazon DocumentDB Elastic Clusters, with little to no impact to your application. Amazon DocumentDB supports millions of requests per second with up to 15 low latency read replicas in minutes, without any application downtime, regardless of the size of your data. Amazon DocumentDB offers 99.9% SLA and replicates six copies of your data across three AWS Availability Zones (AZs). Customers can use AWS Database Migration Service (DMS) to easily migrate your self-managed MongoDB databases to Amazon DocumentDB with virtually no downtime.
Amazon DocumentDB Elastic Clusters enables customers to handle millions of writes and reads per second, allowing customers to scale their document databases in minutes with little to no downtime or impact to performance. Customers can also store petabytes of data and only pay for the capacity they consume with zero management of underlying infrastructure. With Amazon DocumentDB Elastic Clusters customers can now meet the scaling needs of virtually any application.
MongoDB Data Durability
Amazon DocumentDB has a flexible JSON document model, data types, and efficient indexing. The service uses a scale-up, in-memory optimized architecture to allow for fast query evaluation over large documents sets.
Amazon DocumentDB will automatically grow the size of the storage volume as your cluster storage needs grow. The storage volume will grow in increments of 10 GB up to a maximum of 2 PiB. Customers don't need to provision excess storage for your document database to handle future growth.
Amazon DocumentDB is compatible with MongoDB 3.6 and 4.0 drivers and tools. A vast majority of the applications, drivers, and tools that customers already use today with their open-source MongoDB non-relational database can be used with Amazon DocumentDB. Amazon DocumentDB emulates the responses that a client expects from a MongoDB server by implementing the Apache 2.0 open source MongoDB 3.6 and 4.0 APIs on a purpose-built, distributed, fault-tolerant, and self-healing storage system that gives customers the performance, scalability, and availability they need when operating mission-critical MongoDB workloads at scale. Learn more about supported MongoDB APIs.
The launch of Geospatial query capabilities enables customers to use Amazon DocumentDB to support storing, querying and indexing Geospatial data. Customers can create 2dsphere indexes and use popular MongoDB geospatial APIs such as $nearSphere, $geoNear, $minDistance, $maxDistance to perform queries stored on data stored DocumentDB.
ACID (atomicity, consistency, isolation, durability) is a set of properties of database transactions intended to guarantee data validity despite errors, power failures, and other mishaps. With the launch of support for MongoDB 4.0 compatibility, Amazon DocumentDB supports the ability to perform ACID transactions across multiple documents, statements, collections, and databases.
Customers can easily migrate their MongoDB databases on-premises or on Amazon Elastic Compute Cloud (EC2) to Amazon DocumentDB for free (for six months per instance) with virtually no downtime using the AWS Database Migration Service (DMS). With DMS, customers can migrate from a MongoDB replica set or from a sharded cluster to Amazon DocumentDB. For more information about migrating both relational and non-relational databases to Amazon DocumentDB, see Migrating to Amazon DocumentDB.
Amazon DocumentDB provides Amazon CloudWatch metrics for the cloud database instances. Customers can use the AWS Management Console to view over 40 key operational metrics for the cluster, including compute, memory, storage, query throughput, MongoDB opcounters, and active connections.
Amazon DocumentDB allows customers to encrypt databases using keys created and controlled through AWS Key Management Service (KMS). On a cluster running with Amazon DocumentDB encryption, data stored at rest in the underlying storage is encrypted, as are the automated backups, snapshots, and replicas in the same cluster. By default, connections between a client and Amazon DocumentDB are encrypted-in-transit with TLS.
Amazon DocumentDB Global Clusters provides disaster recovery from region-wide outages and enables low-latency global reads. Amazon DocumentDB Global Clusters replicates your data to clusters in up to 5 AWS regions with little to no impact on performance, with a typical lag of less than one second. Learn more about setting up Global Clusters in the Amazon DocumentDB user guide.
The health of your Amazon DocumentDB cluster and its instances are continuously monitored. If the instance powering your database fails, the instance and associated processes are automatically restarted. Amazon DocumentDB recovery does not require the potentially lengthy replay of database redo logs, so your instance restart times are typically 30 seconds or less. It also isolates the database cache from database processes, allowing the cache to survive a database restart.
Amazon DocumentDB's simple database backup capability enables point-in-time recovery for clusters. Customers can restore their cluster to any second during the retention period, up until the last five minutes. The automatic backup retention period can be configured up to thirty-five days. Automated backups are stored in Amazon Simple Storage Service (Amazon S3), which is designed for 99.999999999% durability. Amazon DocumentDB backups are automatic, incremental, and continuous and have no impact on cluster performance.
Much has been said about MongoDB's write durability. Some of it true, some of it not, and some of it was once true but no longer is. This can lead to confusion about a topic where no confusion should exist.
There was a time when an insert or update happened in memory with no options available to developers. The data files would get synced periodically (configurable, but defaulting to 60 second). This meant that, should the server crash, up to 60 seconds of writes would be lost. At the time, the answer to this was to run replica pairs (which were later replaced with replica sets). As the number of machines in your replica set grows, the chances of data loss decreases.
But replication is asynchronous, meaning the master could crash before replicating your data. Under this circumstance, the loss-of-data window was much smaller than 60 seconds, but it was still a concern. It therefore became possible, by calling getLastError with w:N after a write, to specify the number (N) of servers the write must be replicated to before returning.
Although journaling is now enabled by default, it's important to know that it does group commits. That means, writes are still done in memory. The difference though is that the journal file is synced every 100ms (configurable down to 2ms), while the data files continue to sync every 60 seconds. So, there's still a window of possible data loss, though it's much smaller. If you are wondering why it's ok to sync one often (100ms) and the other not (60s), it's because journaling uses an append-only file, which is much faster to write to.
There are two things developers can do to eliminate the remaining gap, both using getLastError. You can use either one, or both. First, the w:N option remains available. Secondly, you can specify j: true, which won't return until the journal data is committed to disk. (to specify both, you use j: true, w:N)
Safe mode is yet another option you can pass to getLastError, via safe: true. Safe mode only tells you that the server received the data and that it's in memory. That's better than nothing, but it really doesn't give an guarantees about durability. Safe mode should be thought of as validation, specifically to catch things like unique-index violations. It tells you that the data is valid and the writes (journal and data files) will proceed, but it doesn't say anything about when those writes will occur.
Whether or not you agree with the initial assertion that durability is best achieved over multiple servers, the fact is that MongoDB not only has a good single-server solution, but it also has some of the most flexible write capabilities. The ability to opt-in or out of nodes-to-replicate and journal commit, on a per-write basis, is something that a number of developers leverage to maximize their write throughput.
Amazon DocumentDB (with MongoDB compatibility) is a fully managed, MongoDB-compatible database service. With Amazon DocumentDB, you can run the same application code and use the same drivers and tools that you use with MongoDB. Amazon DocumentDB is compatible with MongoDB 3.6 and 4.0.
When you use Amazon DocumentDB, you begin by creating a cluster. A cluster consists of zero or more database instances and a cluster volume that manages the data for those instances. An Amazon DocumentDB cluster volume is a virtual database storage volume that spans multiple Availability Zones. Each Availability Zone has a copy of the cluster data.
Amazon DocumentDB data is stored in a cluster volume, which is a single, virtual volume that uses solid state drives (SSDs). A cluster volume consists of six copies of your data, which are replicated automatically across multiple Availability Zones in a single AWS Region. This replication helps ensure that your data is highly durable, with less possibility of data loss. It also helps ensure that your cluster is more available during a failover because copies of your data already exist in other Availability Zones. These copies can continue to serve data requests to the instances in your Amazon DocumentDB cluster. 2ff7e9595c
Комментарии