×
Community Blog NoSQL Database for Mission Critical Business: ApsaraDB for MongoDB and PostgreSQL

NoSQL Database for Mission Critical Business: ApsaraDB for MongoDB and PostgreSQL

In this article, we will discuss the overall functionality and infrastructure presented by Alibaba Cloud's ApsaraDB for MongoDB and PostgreSQL services.

By Afzaal Ahmad Zeeshan, Alibaba Cloud Community Blog author.

This article primarily deals with the overall functionality and infrastructure presented by ApsaraDB for MongoDB, as well as for PostgreSQL, to satisfy the user expectations from the cloud support of these databases and to leverage their base functionality. More importantly, we will discuss the major features offered by both databases in general, and the requirement set that helps you decide when your business should prefer one over the other based on the business and product requirements. Nonetheless, we will touch upon the basic concepts and features that make PostgreSQL and MongoDB so impressive.

The main reason why I am writing a series of blog posts that discuss the ApsaraDB suite of databases is that there is a huge difference in modern day software development, and deployment. Cloud native solutions tend to be more scalable, resilient and fault-tolerant. Check out this post to learn more on the differences about ApsaraDB vs on-premises databases.

Feature Comparison of PostgreSQL and MongoDB

PostgreSQL is an object-oriented relational database which is written in C and supports mainly Linux like and Windows-based platform. It has a very strongly typed yet flexible schema; you can define relationships among multiple tables to avoid data duplication and redundancy. Being fundamentally relational, it supports the concepts of the primary key, foreign key, exclusion constraints, and locking mechanism as well to extend data integrity.

Extensibility comes under the primary features of PostgreSQL; we can define our own data types, write custom functions in any programming language unless found the available data types suitable for your requirements. Postgres is highly reliable and secure for the massive data-intensive applications. It provides a write-ahead logging mechanism, point in time recovery, and replication in an asynchronous, synchronous, and logical order. It can manage many petabytes of data in production with exponential flexibility.

On the other hand, MongoDB is an open-source non-relational, document-based, and highly scalable database. It has a distributed architecture that can run and manage data servers across multiple regions to support availability and scalability. Originally MongoDB is designed for a cloud-native architecture; it scales applications elastically, promising the data consistency and high availability. MongoDB has a built in feature of data sharding, which is scaling out data horizontally. MongoDB manages data clusters automatically without introducing any overhead or complexity. This way, data sharding promises error-free data distribution for diverse workloads.

Both products are open-sourced, and available to be run on any platform¡ªon-premises, or on the cloud. Both products are available under ApsaraDB suite of databases on Alibaba Cloud. This means that this article would not focus on the basic setup of the databases, since Alibaba Cloud is taking care of these for us, we should focus on the business model and when either of these is a suitable case for our database needs and demands.

NoSQL version of PostgreSQL

The previous section has highlighted the main streamlined features of both databases. PostgresSQL is primarily a relational database; however, over the period, it has improved its powerful features to work with the unstructured and non-relational databases as well¡ªkudos to open source communities! PostgreSQL provides the flexibility of unstructured and semi-structured data atop of its relational database reliability and extensibility. The extensive support to work with JSON and JSONB documents, XML files, and key-value stores makes it a super dynamic and demanding NoSQL database.

Enterprises such as government agencies, banks, brokers, and other financial departments prefer PostgreSQL due to its security (multi-factor authentication, rows, and column level security, and advance authentication technology supports, such as SCRAM-SHA-256, LDAP, SSPI, etc.) and point-in-time recovery features. Furthermore, their experience with Postgres has even improved due to its support for the NoSQL database. Applications can be written and modified for NoSQL solutions with significant extensibility. These community-led contributions helped PostgreSQL gain popularity and the capability to extend its services beyond merely a relational database.

Mostly database management systems are not designed to have a native feature to scale-up and down its database beyond a single server, neither they can ensure a hundred percent on-site data availability, these flaws become even frequent when it comes to building distributed systems. To tackle these limitations, we can use cloud platforms and their diverse support for these databases. Systems which are initially designed scoping a limited range of audience over one platform gradually aiming to provide their services over multiple platforms such as mobile and web. To meet such requirements, native cloud vendors host these database solutions in their data centers and offer you their cost-efficient and hassle-free services. Identical is the case with ApsaraDB by Alibaba cloud and a wide range of its supported database services.

PostgreSQL supported by Alibaba Cloud ApsaraDB

ApsaraDB for PostgreSQL is one of the most used products under ApsaraDB suite of databases. PostgreSQL is widely used at enterprise-grade solutions enabling support for OLTP databases while having the suffice support for unstructured databases¡ªand a couple of more options that are beyond the scope of this article. The order placement page shows that you can select the deployment model (including the versions of PostgreSQL) that you want to use for the deployment.

1

I chose pay-as-you-go model, you can select the subscription model as well, but the services and features of ApsaraDb are same in both cases.

Building Enterprise-level Solutions

It provides a quick disaster recovery system supported by Alibaba's multi-regional and multi-zone cloud architecture. It ensures a high level of stability and security for enterprise-level applications. Fast throughput and highly improved query results are guaranteed due to its promising speed and performance to work with millions of records of data and querying based on multiple tables. For continuously expanding business and large applications, it provides unlimited data storage; it permits you to store cold data in external tables using object storage service (OSS) and provides interaction with the HybridDB module of PostgreSQL. They are also Alibaba Cloud storage options that can be explored for a complete cloud-native solution.

Comfortable working with Geographical Information Systems (GIS)

To provide extension support for GIS data and cloud expansion, it provides an adequate set of services for spatial information processing; PostGIS extensions which fulfill the varying requirements geographical data modeling such as earth positioning, 2D and 3D dimensional settings, identifying the continuous and irregular patterns, etc. It provides advanced spatial data types and functions such as polygon and multipolygon, geometrycollections etc. and contains, within, overlap and touches, respectively.

Compatible with NoSQL

As discussed, it supports almost all the possible document types to provide compatibility for NoSQL users. The creation of JSON data, storing, retrieving, and applying to index all become easily possible. It supports an efficient joining mechanism to query required data from multiple tables. Also, it provides SQL query optimizer, which works significantly well to perform better for multiple tables.

Stable support for Data Warehousing

It enables SQL auditing and field-level control. For real-time data analysis, it provides robust support for OLAP data warehouses and ensures high data availability for OLTP specific applications. By using the same database driver for real-time and historical data, it reduces the overhead and cost. HybridDB for PostgreSQL to create an Online Analytical Processing database warehouse and perform horizontal Scaling. Furthermore, it supports advanced features for BI transactional analysis over hundreds of TB and PB data size.

So, if you want to give this extensive database cloud service a try, steps are quite handy. Kindly refer to the following self-explanatory steps to get-started with ApsaraDB RDS PostgreSQL. It is also suggested that you should go through the Limits of RDS for PostgreSQL the possible limitations so that you can re-evaluate your requirements before purchasing the service.

2

Otherwise, if you are already using PostgreSQL and looking for an easy migration process from your existing database to any other suitable ApsaraDB for RDS instance, then you can refer to this guide: Data Migration between ApsaraDB for RDS instances.

MongoDB supported by Alibaba cloud ApsaraDB

Alibaba Cloud ApsaraDB for MongoDB is a highly scalable, secure, and powerful database service. It is very handy to get a quick start with MongoDB in just a few minutes due to its easy interface and overall infrastructure. It provides automatic support for disaster recovery, backup, and overall management.

The following screenshot demonstrates the maximum of the tasks that you need to perform in order to have a MongoDB cluster created, deployed and prepared for production workloads.

3

Continuous upgrades and patches are managed by Alibaba Cloud platform as well.

Overall Architecture and Modules

One-Member and Three-Member replica sets

It supports multiple database architectures; one-member replica which is cost-effective and widely used for the highly-fault tolerant storage systems such as enterprise-level applications, testing applications, etc., three-member replica set architecture provides a hidden node other than the primary and secondary node to ensure the high data availability of the main node in case of failover or any erroneous situation.

Task Controller

ApsaraDB for MongoDB comes along with a task controller, which makes all the instance-specific tasks comparatively easier such as creation, configuration, basic backup, and troubleshooting the basic issues. As you can already see in the screenshot above, all the operational side is managed by Alibaba Cloud as the vendor of the service.

High-Available Control System

HA control system ensures to work proactively; it detects the running statuses of ApsaraDB for MongoDB instances. If it detects the primary node is going to be down, it prepares a secondary node and shifts over the responsibilities accordingly to ensure high availability¡ªthis is the recommended approach in a production environment.

Logging and Monitoring System

Log collector module ensures the always-on logging for ApsaraDB for MongoDB instances; it includes end-to-end logging and audit facilities as well. Moreover, the system gathers monitoring logs as well as other useful information about MongoDB instances for high performance.

Migration and Backup System

Automatic migration is supported; the online migration system ensures to prevent any interruptions and downtime in your business; it launches a new instance and prepares backup and stores data in Object Storage Service.

Main features of ApsaraDB for MongoDB

The MongoDB basics, and the cloud storage and scalability are the basics, but there are a couple of more options available in the service for free.

  • Multiple back-ups for highly risky and critical businesses. It supports distributed replica architecture and ensures high availability of nodes.
  • For ease and diversity in data analysis, it provides transmission between on-premise and cloud databases as well as heterogeneous data transmissions between different cloud databases.
  • Elastic Scaling is one of the primary features supported and enhances for ApsaraDB for Mongo DB. It supports unlimited clusters for data storage and processing. Moreover, elastic Scaling of servers ensures the server replacement and merging on the fly with secure backup and data mirroring.
  • For 24/7 professional-level customer support, ApsaraDB for MongoDB provides a database administrator certified by MongoDB Inc.

Conclusion

Although PostgreSQL is not a primarily NoSQL database, but the community-led extensions and feature-sets that are made available in the open source enable this database to be used as a NoSQL database. MongoDB on the other hand has a great history supporting its use in production environment.

Here is a rule of thumb, if you want only relational data, go for PostgreSQL, and if you want to have only NoSQL (document-store) then you should consider using MongoDB. If there is a chance that you want to store the primary data in relational, but some supportive data¡ªas we discussed about GIS data¡ªthen ApsaraDB for PostgreSQL is the best suite for your business.

The pricing models in these solutions are not of primary concern, the reason being, they are both open source database engines and Alibaba Cloud uses the 100% open sourced solution, nothing modified in any way.

0 0 0
Share on

afzaalvirgoboy

7 posts | 1 followers

You may also like

Comments

afzaalvirgoboy

7 posts | 1 followers

Related Products