Skip to main content

DynamoDB SQL Vs PostgreSQL Vs MongoDB

 Choosing the right database for your project can be a challenging task, especially when dealing with a large dataset. Recently, Axcito was approached by a client who wanted to perform a Proof of Concept (POC) on which database to use for their very large dataset, which they intended to open via public APIs. In this article, we will discuss how Axcito approached the decision-making process for selecting the appropriate database for the client's needs.

Decision Drivers


Axcito had several decision drivers for selecting the appropriate database for the client, which included:

  • Delivering quickly is very important
  • Data model might change over time
  • Data will be used for analytics and/or machine learning
  • Should be easy to manage (Managed service is preferred)

Considered Alternatives

Axcito evaluated several database alternatives, which included:

  • DynamoDB
  • SQL (MySQL or PostgreSQL)
  • MongoDB

 

Pros and Cons of the Alternatives


DynamoDB:

The client had already used DynamoDB in the project, and they loved it for its speedy retrieval when required, which was critical for their mobile app performance. However, DynamoDB is not flexible when new data access patterns are created, which is the case for this dataset. Additionally, it might be a total new tech to learn for developers, and there is minimal tooling to play with it locally. DynamoDB could get expensive quickly if more reads occur, and once you have data in Dynamo, it might be challenging to move the data to a different type of storage.

SQL (MySQL or PostgreSQL):

SQL is almost familiar to all developers, and there are AWS managed RDBMS services like Aurora. It is easy to retrieve data and create new indexes, and automatic minor software patching ensures that the PostgreSQL software powering your deployment stays up-to-date with the latest minor patches. However, whenever data model changes, there will be database changes and backend code changes. Additionally, it is not a global database, since you only have one master database, resulting in increased latency when being further away from the region where the database is deployed.

MongoDB:

MongoDB is a document database that keeps semi-structured data along with its description in the document format, and it has a dynamic schema for new/unstructured data. It is easy to retrieve data and create new indexes, and data can be flexibly stored without having a pre-defined structure. However, it is not a good fit for complex queries as there is no standard interface in NoSQL for handling queries, and it is not an AWS managed service, which would require managing the platform for it.

Decision Outcome


After the POC, Axcito gave up on DynamoDB since data access patterns were not consistent, and it required more proficiency. At the time, there was no managed AWS service for MongoDB. Axcito decided to design a new database in AWS managed PostgreSQL with a database backup plan and migrate the current data to the new database, mostly manually. The team agreed to maintain quality documentation from design to tool around the database and placed the RDS database in a private subnet to ensure security. Access to the database with a GUI tool became complex, and access to the database CLI was through Session manager. The team also considered moving to Aurora for better performance globally.

Conclusion


Choosing the right database for your project is critical to its success. Axcito's decision to use PostgreSQL was based on the client's needs and the decision drivers for the project. The team considered several alternatives before settling on PostgreSQL, which was the best fit for the project. We hope this article helps you in your decision-making process for your next project. If you need help, feel free to reach out to Axcito.

Comments

  1. The article presents a practical database selection scenario where delivery speed, evolving data models, analytics and machine learning requirements, and ease of management are used as decision drivers. Evaluating DynamoDB, SQL databases such as MySQL or PostgreSQL, and MongoDB against these requirements provides a useful way to think about database choices for large datasets exposed through public APIs.

    The comparison of document-oriented database approaches is particularly relevant for understanding how MongoDB can fit projects where the data model may change over time. These concepts provide useful context for MongoDB Course, especially when considering flexible data structures and application requirements.

    ReplyDelete
  2. The article also connects database selection with application architecture and public API usage rather than treating the database as an isolated component. This broader perspective is useful when exploring a MENN Stack Developer Course, where the database, backend services, and application layer need to work together.

    ReplyDelete

Post a Comment

Popular posts from this blog

A Message from Axcito: Our Apologies for the Lack of Blog Posts

It's been a while since we last posted on our blog, and we wanted to apologize to all our followers for the long silence. Rest assured that we have been keeping ourselves very busy, and we have some exciting news to share. Since our last blog post, Axcito has been growing faster than ever as a full global team. Our team has expanded to mainly in three countries - USA, Sri Lanka, and Australia - and each entity operates independently. Nevertheless, we work together globally and support each other as needed. But some of the clients and some members are from different counties. In the past few months, we have been involved in several exciting projects. Our focus has been on web and mobile application development, software quality assurance, cyber security and penetration testing, and SEO projects. We are pleased to announce that we have been recognized as one of the best mobile app development firms and top professional eCommerce agencies in USA, Sri Lanka, and Australia. Our team is ...

Why we prefer Flutter as the top choice for developing larger mobile apps

 At Axcito mobile app developments, in few recent projects we opted for Flutter because it is a cross-platform mobile development framework that is open source and was developed by Google.  It utilizes Dart, which is also developed by Google. What caught our attention about Flutter were its UI widgets that provide a native look and feel, its high-performance cross-platform framework inspired by React, and its fast debugging capabilities with stateful hot reload. Moreover, Flutter offers additional features that we will delve into further.  Flutter's performance is one of its major advantages due to its utilization of the Dart programming language, known for its speed and efficiency. This enables smooth and swift app performance, even on older devices. Another advantage is the use of widgets in building the user interface, which facilitates quicker and more efficient development. With Flutter's pre-compiled widgets, the app's performance is not impacted by the device's p...