Need advice about which tool to choose?Ask the StackShare community!

Amazon DynamoDB

3.7K
3.2K
+ 1
195
Mongoose

2.1K
1.4K
+ 1
56
Add tool

Amazon DynamoDB vs Mongoose: What are the differences?

Introduction

In this article, we will explore the key differences between Amazon DynamoDB and Mongoose. Both DynamoDB and Mongoose are popular tools used for data storage and management, but they have some significant differences that make them suitable for different use cases.

  1. Data Model: Amazon DynamoDB is a NoSQL database service provided by Amazon Web Services. It uses a key-value data model, where data is organized into tables with a primary key. Mongoose, on the other hand, is an Object Data Modeling (ODM) library for MongoDB, a NoSQL database. Mongoose provides a schema-based approach to define data models, making it easier to work with structured data.

  2. Scalability: Amazon DynamoDB is designed to provide seamless scalability and can handle large amounts of data and high traffic loads. It automatically scales the storage and throughput capacity based on the demand. Mongoose, on the other hand, relies on the scalability features provided by MongoDB. MongoDB can be scaled horizontally by adding more servers to distribute the load.

  3. Query Language: DynamoDB uses a proprietary query language called AWS Query API or AWS SDKs, which provides methods to interact with the database. Mongoose, on the other hand, uses a flexible and powerful query language called MongoDB Query Language (MQL). MQL provides a wide range of query operators and methods to perform complex queries, aggregations, and data manipulations.

  4. Indexing: DynamoDB supports two types of indexes: primary key indexes (hash indexes) and global secondary indexes. These indexes allow efficient querying and filtering of data based on different attributes. Mongoose also supports indexing in MongoDB, which helps in improving the query performance by creating indexes on specific fields.

  5. Transaction Support: DynamoDB supports ACID (Atomicity, Consistency, Isolation, Durability) transactions by using conditional writes and optimistic concurrency control. On the other hand, MongoDB supports multi-document transactions, which allow multiple operations to be performed as a single atomic unit of work.

  6. Pricing Model: DynamoDB pricing is based on provisioned capacity, where you need to specify the desired read and write throughput. Mongoose pricing is tied to the hosting provider's pricing for MongoDB, which includes factors such as storage, bandwidth, and server usage.

In summary, Amazon DynamoDB and Mongoose differ in their data models, scalability, query languages, indexing support, transaction capabilities, and pricing models. The choice between the two depends on the specific requirements of the application and the preference for NoSQL databases.

Advice on Amazon DynamoDB and Mongoose

We are building a social media app, where users will post images, like their post, and make friends based on their interest. We are currently using Cloud Firestore and Firebase Realtime Database. We are looking for another database like Amazon DynamoDB; how much this decision can be efficient in terms of pricing and overhead?

See more
Replies (1)
William Frank
Data Science and Engineering at GeistM · | 2 upvotes · 112.9K views
Recommends

Hi, Akash,

I wouldn't make this decision without lots more information. Cloud Firestore has a much richer metamodel (document-oriented) than Dynamo (key-value), and Dynamo seems to be particularly restrictive. That is why it is so fast. There are many needs in most applications to get lightning access to the members of a set, one set at a time. Dynamo DB is a great choice. But, social media applications generally need to be able to make long traverses across a graph. While you can make almost any metamodel act like another one, with your own custom layers on top of it, or just by writing a lot more code, it's a long way around to do that with simple key-value sets. It's hard enough to traverse across networks of collections in a document-oriented database. So, if you are moving, I think a graph-oriented database like Amazon Neptune, or, if you might want built-in reasoning, Allegro or Ontotext, would take the least programming, which is where the most cost and bugs can be avoided. Also, managed systems are also less costly in terms of people's time and system errors. It's easier to measure the costs of managed systems, so they are often seen as more costly.

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Amazon DynamoDB
Pros of Mongoose
  • 62
    Predictable performance and cost
  • 56
    Scalable
  • 35
    Native JSON Support
  • 21
    AWS Free Tier
  • 7
    Fast
  • 3
    No sql
  • 3
    To store data
  • 2
    Serverless
  • 2
    No Stored procedures is GOOD
  • 1
    ORM with DynamoDBMapper
  • 1
    Elastic Scalability using on-demand mode
  • 1
    Elastic Scalability using autoscaling
  • 1
    DynamoDB Stream
  • 17
    Several bad ideas mixed together
  • 17
    Well documented
  • 10
    JSON
  • 8
    Actually terrible documentation
  • 2
    Recommended and used by Valve. See steamworks docs
  • 1
    Can be used with passportjs for oauth
  • 1
    Yeah

Sign up to add or upvote prosMake informed product decisions

Cons of Amazon DynamoDB
Cons of Mongoose
  • 4
    Only sequential access for paginate data
  • 1
    Scaling
  • 1
    Document Limit Size
  • 3
    Model middleware/hooks are not user friendly

Sign up to add or upvote consMake informed product decisions

What is Amazon DynamoDB?

With it , you can offload the administrative burden of operating and scaling a highly available distributed database cluster, while paying a low price for only what you use.

What is Mongoose?

Let's face it, writing MongoDB validation, casting and business logic boilerplate is a drag. That's why we wrote Mongoose. Mongoose provides a straight-forward, schema-based solution to modeling your application data and includes built-in type casting, validation, query building, business logic hooks and more, out of the box.

Need advice about which tool to choose?Ask the StackShare community!

What companies use Amazon DynamoDB?
What companies use Mongoose?
Manage your open source components, licenses, and vulnerabilities
Learn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Amazon DynamoDB?
What tools integrate with Mongoose?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

JavaScriptGitHubNode.js+29
14
13642
GitHubPythonNode.js+47
55
72807
GitGitHubSlack+30
27
18699
GitHubDockerAmazon EC2+23
12
6614
GitHubPythonSlack+25
7
3224
What are some alternatives to Amazon DynamoDB and Mongoose?
Google Cloud Datastore
Use a managed, NoSQL, schemaless database for storing non-relational data. Cloud Datastore automatically scales as you need it and supports transactions as well as robust, SQL-like queries.
MongoDB
MongoDB stores data in JSON-like documents that can vary in structure, offering a dynamic, flexible schema. MongoDB was also designed for high availability and scalability, with built-in replication and auto-sharding.
Amazon SimpleDB
Developers simply store and query data items via web services requests and Amazon SimpleDB does the rest. Behind the scenes, Amazon SimpleDB creates and manages multiple geographically distributed replicas of your data automatically to enable high availability and data durability. Amazon SimpleDB provides a simple web services interface to create and store multiple data sets, query your data easily, and return the results. Your data is automatically indexed, making it easy to quickly find the information that you need. There is no need to pre-define a schema or change a schema if new data is added later. And scale-out is as simple as creating new domains, rather than building out new servers.
MySQL
The MySQL software delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.
Amazon S3
Amazon Simple Storage Service provides a fully redundant data storage infrastructure for storing and retrieving any amount of data, at any time, from anywhere on the web
See all alternatives