Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
Amazon DocumentDB is a fully-managed database service that is fast, reliable, and compatible with MongoDB. Amazon DocumentDB makes it easy to set up, administer, and scale MongoDB-compatible databases on the cloud. With Amazon DocumentDB, you can run the same application code and utilize the same drivers and tools that you use with MongoDB.
DocumentDB
Some programmers fail to consider their data model in terms of normalized rows and columns. Data is typically represented as a JSON document in the application tier because it is more intuitive for developers to think of their data model as a document.
Document databases have increased in popularity because they allow you to persist data in a database using the same document model format as your application code. For flexible and agile development, document databases provide strong and intuitive APIs.
Working
Amazon DocumentDB (with MongoDB compatibility) is a fully-managed database service that works with MongoDB. You can run the same application code and utilize the same drivers and tools with Amazon DocumentDB as you can with MongoDB. Amazon DocumentDB supports MongoDB 3.6 and 4.0.
To use Amazon DocumentDB, you must first create a cluster. A cluster comprises one or more database instances and a cluster volume that manages their data. A virtual database storage volume that spans multiple Availability Zones is known as an Amazon DocumentDB cluster volume. The cluster data is duplicated in each Availability Zone.
Source: https://docs.aws.amazon.com/
When your application sends data to the primary instance, it performs a long-term write to the cluster volume. The status of that writing (not the data) is then replicated to each active replica. Because Amazon DocumentDB replicas do not participate in write processing, they are better for reading scaling. After the primary instance writes the data, reads from Amazon DocumentDB replicas are finally consistent with little replica lag—usually less than 100 milliseconds. Reads from the replicas will always be read in the same sequence as they were written to the main. The rate of data change affects replica latency, and periods of intense write activity can increase replica lag.
How to access my Amazon DocumentDB cluster
Amazon DocumentDB clusters are hosted in a customer's Amazon Virtual Private Cloud (VPC) and can be accessed directly by Amazon Elastic Compute Cloud (EC2) instances or other AWS services hosted in the same VPC.Amazon DocumentDB can also be accessed via VPC peering by Amazon EC2 instances or other AWS services in separate VPCs in the same region or in other regions. The mongo shell or MongoDB drivers are required to access Amazon DocumentDB clusters. When connecting to an Amazon DocumentDB cluster, you must first authenticate. See Connecting to an Amazon DocumentDB Cluster from Outside an Amazon VPC for further information.
Amazon DocumentDB just writes write-ahead logs to storage and does not need to write full buffer page syncs. Amazon DocumentDB writes are often faster than traditional databases as a result of this optimization, which does not affect durability. With up to 15 read replicas, Amazon DocumentDB clusters may expand to millions of reads per second.
Amazon DocumentDB Storage
The data in Amazon DocumentDB is kept in a cluster volume, which is a single virtual volume with solid-state disks (SSDs). A cluster volume is made up of six copies of your data that are duplicated automatically across several AWS Regions and Availability Zones. This replication ensures that the data is highly durable and minimizes data loss. Because copies of your data already exist in different Availability Zones, it also helps ensure that your cluster is more available during a failover. These copies can keep serving data requests to your Amazon DocumentDB cluster's instances.
Amazon DocumentDB Reliability
Amazon DocumentDB is built to be dependable, long-lasting, and fault-tolerant. (You should set up your Amazon DocumentDB cluster so that it has many replica instances in different Availability Zones to improve availability.) Amazon DocumentDB has a number of built-in features that make it a dependable database.
High Availability
By using replicas as failover targets for the primary instance, Amazon DocumentDB provides highly available cluster configurations. If, in any case, the primary instance fails, an Amazon DocumentDB replica becomes the new primary; however, there is a temporary interruption during which read and write requests to the primary instance fail with an exception.
If your Amazon DocumentDB cluster has no replicas, a failure causes the primary instance to be recreated. Promoting an Amazon DocumentDB replica, on the other hand, is far quicker than re-creating the primary instance. We recommend creating one or more Amazon DocumentDB replicas as a failover target.
Unlike other databases, Amazon DocumentDB does not need to replay the redo log from the most recent database checkpoint (usually five minutes) and certify that all changes have been implemented before making the database operational again. In most cases, this reduces database restart times to less than 60 seconds. When you restart Amazon DocumentDB, the cache is removed from the database process and made available instantly. You won't have to throttle access until the cache is repopulated to avoid brownouts.
Backing Up and Restoring in Amazon DocumentDB
Amazon DocumentDB (with MongoDB compatibility) backs up your data for 1–35 days to Amazon Simple Storage Service (Amazon S3), allowing you to restore to any point during that time rapidly. As part of this continuous backup procedure, Amazon DocumentDB takes automatic snapshots of your data. You can also create a manual snapshot of your cluster's data to save backup data longer than the backup retention time. The backup process has no effect on the performance of your cluster.
Security in Amazon DocumentDB
At AWS, cloud security is a top focus. You have access to a data center and network architecture intended to meet the needs of the most security-conscious enterprises as an AWS customer. AWS is in charge of safeguarding the entire infrastructure that powers AWS Cloud services. AWS also supplies you with services that are safe to utilize. As part of the AWS compliance initiatives, third-party auditors test and verify the effectiveness of our security. AWS is responsible for the infrastructure that supports AWS Cloud services.AWS also supplies you with services that are safe to utilize. As part of the AWS compliance initiatives, third-party auditors test and verify the effectiveness of our security. The AWS service that you utilize determines your obligation. Other considerations include the sensitivity of your data, the requirements of your company, and applicable laws and regulations.
Existing MongoDB authentication with Amazon DocumentDB
Amazon DocumentDB uses VPC's stringent network and authorization border. IAM users, roles, and policies offer authentication and authorization for Amazon DocumentDB administration APIs. Authentication to an Amazon DocumentDB database is done using normal MongoDB tools and drivers, and the default authentication technique for MongoDB is Salted Challenge Response Authentication Mechanism (SCRAM).
Frequently Asked Questions
What does "MongoDB-compatible" mean?
Amazon DocumentDB is "MongoDB compliant," which implies it works with the Apache 2.0 open source MongoDB 3.6 and 4.0 APIs. As a result, you can utilize Amazon DocumentDB with the same MongoDB drivers, apps, and tools. While Amazon DocumentDB supports the great majority of MongoDB APIs used by customers, it does not support all of them. Our primary goal has been to provide capabilities that customers actually utilize and require.
Do I need to change client drivers to use Amazon DocumentDB?
No, Amazon DocumentDB works with a vast majority of MongoDB drivers compatible with MongoDB 3.4+.
Does Amazon DocumentDB support ACID transactions?
Yes. Amazon DocumentDB now supports atomicity, consistency, isolation, and durability (ACID) transactions across multiple documents, statements, collections, and databases, thanks to the addition of MongoDB 4.0 compatibility.
Which port does a DocumentDB cluster listen on?
The name of the replica set cannot be changed. Connecting to the cluster endpoint in replica set mode is advised for general use. All instances in an Amazon DocumentDB cluster listen for connections on the same TCP port.
How fast is AWS DocumentDB?
Amazon DocumentDB writes are often faster than traditional databases as a result of this optimization, which does not affect durability. With up to 15 read replicas, Amazon DocumentDB clusters may expand to millions of reads per second.
Is Amazon DocumentDB serverless?
DocumentDB is not a serverless service. You need to manage the backend server to use it.
Conclusion
In this article, we have extensively discussed the theory of Amazon DocumentDB. We also explored concepts like its working, security, performance, etc.