Massive Parallel Processing with Alibaba Cloud HybridDB for PostgreSQL

本文涉及的产品
云原生数据库 PolarDB MySQL 版,Serverless 5000PCU 100GB
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介: When you have massive amounts of data and the need for data analytics, or you have high availability requirements, or security and backup protocols to.

DataWarehouse_FriendlyDatabaseDesign

When you have massive amounts of data and the need for data analytics, or you have high availability requirements, or security and backup protocols to follow, services like Alibaba Cloud's HybridDB for PostgreSQL can come in handy.

The service takes powerful Relational Database Management Systems (RDBMS) to a whole new level. In this article, we are going to explore how to get started with Alibaba Cloud's HybridDB for PostgreSQL service—for free.

PostgreSQL

PostgreSQL (also known as Postgres) is considered the most advanced open-source database, for several reasons. In the old world of databases—systems that organize, describe, store, structure and let users query data—there are several players that require costly licensing agreements. But there are also some players that deliver an interesting balance between features—and now, scaling. Postgres, with the help of Alibaba Cloud HybridDB, is one of these.

Postgres is formally a RDBMS, which means that it solves the problem of organizing data based on the relational model invented by Edgar Codd. Since version 8.0 launched in 2005, it has evolved to cover new spaces—including some non-structured data—and now, in version 10, launched this year, Postgres offers:

● XML data types, which let you store XML documents as columns of a table, query tags and attributes, convert to-from XML, and more
● JSON data types, allowing storage of JSON documents as columns of a table, queries of documents, conversion to/from JSON, the addition of indexes to improve performance, and more
● HStore data types, meaning that you can define key-value columns in the tables
● GIS extensions, allowing specialized datatypes, indexes, and a bunch of utilities for GeoSpatial use cases
● Basic full-text search capabilities
● Query parallelization

The last one is special because it makes available to the local developer (and usually the dev environment) the capacity to launch complicated queries which will be optimized to run in parallel, using the full capabilities of multiple core processors. But how is the same thing accomplished when the amount of data is in the order of terabytes, or petabytes? It's called Massive Parallel Processing—and one solution is to use a cluster of databases that can share the load and offer one single interface that looks as if it were a single database instance.

From the database world to the cloud

Running a database cluster is a complicated task, and usually, there is a specific role (better, a specific team) in the company that handles this. There are innumerable important details and a huge amount of subtasks that you need to handle to offer a reliable, scalable and blazing fast service. Fortunately, companies like Alibaba Cloud offer this kind of service, and you can jump from zero to a decent cluster configuration without being a specialist.

The Greenplum open source project is a Massive Parallel Processing Database based on PostgreSQL 8.2. Alibaba Cloud's HybridDB is one cloud provider that offers a service to run Greenplum and manage tasks such as security and backup. What are the advantages?
Here are a few:

● Autoscaling
● Simplified management
● Isolation of the environment using virtual private clouds
● Exclusive extensions to the Greenplum base implementation, such as JSON and HyperLogLog
● Support of Open Storage Service
● Support of migration tools such as pgsql2pgsql (PostgreSQL to PostgreSQL) or mysql2pgsql (MySQL to PostgreSQL)
● Support for SQL-99, SQL-03, SQL-08 standards
● Support of the Apache MADlib project

The last one is particularly interesting because it extends HybridDB for PostgreSQL with "data-parallel implementations of mathematical, statistical and machine learning methods for structured and unstructured data," which means that you will be able to do advanced analytics on data locally, in-database.

Hands-on

Let's take a look at this solution by creating an account at Alibaba Cloud, and taking advantage of the $300 (USD) credit that they offer for new users. (The registration process is simple, so it will not be explained in detail here.) The idea is that you create an instance which is a compound of groups of databases (at least 2) that will share the same CPU, IO, memory, and disk resources. (Keep in mind that the resources in one group are allocated to the same physical host.) Go to the console and click on "HybridDB for PostgreSQL":

01

Click on the button in the upper-right corner labeled "Create an Instance":

02

Select the Region, Zone and Instance Class:

03

Confirm your order:

04

After a few seconds, your instance will be created. Then, click on the "Manage" link at the end of the row:

05

We are going to configure access to the instance through the Internet because this is just a sample. (This setup is highly risky, and you should avoid it in your project's setup. Please read the security guides and collaborate with your IT security team before configuring an instance.)

Next, click on the link "Security Controls" on the left panel, and create a new white list group by clicking the "Add White List Group" button on the right. Call it "internet" with the white list set to "%" (which means any IP address):

06

After the security (mis) configuration is complete, we are going to create a new database user account. Click on the "Account Management" link on the left panel, and then the "Create account button":

07

Fill in the details. Your password must contain uppercase and lowercase letters, symbols and numbers. (If you forget the password, you can reset it from the console.) Click the "OK" button. In order to get an Internet address for the instance, click on the "Database Connection" link on the left panel, and click the button "Apply for Internet address." (Again, this IS NOT A RECOMMENDED practice as it is highly risky.)

08

Now we are going to test the setup using PgAdmin III as the client. (You can use JDBC, ODBC, PSQL, Python, libpq, etc.) Register a new server and fill in the details. Pay special attention to the "Host"— yourgpdbaddress.gpdb.rds.aliyuncs.com; "Port"— shown at the instance details console—along with the "Username" and "Password" that you have already configured, and click the "OK" button:

09

After the setup, you can import your data with OSS, mysql2pgsql, pgsql2pgsql, or another tool, and start playing. Don't forget to check out the documentation about the capabilities of the Greenplum project and the extensions supported by Alibaba Cloud's HybridDB for PostgreSQL.

Alternatives

There are multiple approaches to achieving Massive Parallel Processing. HybridDB is one of them, but the market offers additional alternatives such as CitusData, Snowflake Cloud Data Warehouse, and Amazon Redshift, among others. If you have a use case that will benefit from a MPP solution, choose your provider wisely.

Final words

With a little effort, and after reading some documentation, it's pretty simple to set up a basic database cluster using Alibaba Cloud's HybridDB for PostgreSQL. The console and management services are simple and intuitive. The ability to set up the environment for Massive Parallel Processing solutions with a few clicks, keeping compatibility with one of the most advanced database engines and useful extensions, certainly looks very promising, but there are some points that could use some polishing, like the localization of management tools and the written documentation. It is always good to have more alternatives to tackle new Big Data quests.

To try Alibaba Cloud for free, you can take advantage of their current offer of $300 in free credits.

Bio

Nicolas Bohorquez (@Nickmancol) is a software developer from Colombia and is currently earning a Master's in Data Science for Complex Economic Systems at the Collegio Carlo Alberto in Turin, Italy. Previously, Nicolas has been part of development teams in a handful of startups, and has founded three companies in the Americas. He is passionate about the modeling of complexity and the use of data science to improve the world.c

相关实践学习
使用PolarDB和ECS搭建门户网站
本场景主要介绍基于PolarDB和ECS实现搭建门户网站。
阿里云数据库产品家族及特性
阿里云智能数据库产品团队一直致力于不断健全产品体系,提升产品性能,打磨产品功能,从而帮助客户实现更加极致的弹性能力、具备更强的扩展能力、并利用云设施进一步降低企业成本。以云原生+分布式为核心技术抓手,打造以自研的在线事务型(OLTP)数据库Polar DB和在线分析型(OLAP)数据库Analytic DB为代表的新一代企业级云原生数据库产品体系, 结合NoSQL数据库、数据库生态工具、云原生智能化数据库管控平台,为阿里巴巴经济体以及各个行业的企业客户和开发者提供从公共云到混合云再到私有云的完整解决方案,提供基于云基础设施进行数据从处理、到存储、再到计算与分析的一体化解决方案。本节课带你了解阿里云数据库产品家族及特性。
目录
相关文章
|
9月前
|
SQL 缓存 固态存储
Introducing PMDK into PostgreSQL
Introducing PMDK into PostgreSQL
44 0
|
消息中间件 SQL JSON
Debezium Adapt openGauss
Debezium Adapt openGauss
247 0
|
存储 SQL 算法
《Greenplum: A Hybrid Database for Transactional and Analytical Workloads》
Greenplum: A Hybrid Database for Transactional and Analytical Workloads
《Greenplum: A Hybrid Database for Transactional and Analytical Workloads》
|
关系型数据库 PostgreSQL RDS
Cloud Massive Task Scheduling System Database Design - Alibaba Cloud RDS PostgreSQL Cases
PostgreSQL is crucial to cloud massive task scheduling system. Here we will describe how to design a system database for cloud massive task scheduling.
1199 0
Cloud Massive Task Scheduling System Database Design - Alibaba Cloud RDS PostgreSQL Cases
|
SQL 关系型数据库 MySQL
Best Practices for RDS MySQL Storage Optimization
This article talks about spatial optimization of ApsaraDB for RDS MySQL. We will discuss the various objects which comprise the RDS Console with an understanding of the composition of objects.
1643 0
Best Practices for RDS MySQL Storage Optimization
|
弹性计算 NoSQL 安全
AMP for E-Commerce Part 2: Creating Backend with Alibaba Cloud ApsaraDB for MongoDB
In this three-part tutorial, we will explore how to create a fully functional e-commerce mobile application using AMP.
1549 0
AMP for E-Commerce Part 2: Creating Backend with Alibaba Cloud ApsaraDB for MongoDB
|
关系型数据库 MySQL 分布式数据库
The Evolution of Alibaba Cloud's Relational Database Services Architecture – PolarDB
This article discusses the history of Alibaba Cloud's RDS architecture, as well as the motivation behind the development of PolarDB.
4796 0
The Evolution of Alibaba Cloud's Relational Database Services Architecture – PolarDB
|
固态存储 关系型数据库 分布式数据库
100TB Capacity and 6x Performance Improvement with Alibaba Cloud PolarDB
This article focuses on the optimizations of Alibaba Cloud PolarDB's compute and storage engines to offer an unparalleled performance.
5890 0
100TB Capacity and 6x Performance Improvement with Alibaba Cloud PolarDB
|
关系型数据库 RDS
Internet of Vehicles – Window Querying with Alibaba Cloud RDS for PostgreSQL
Internet of Vehicles (IoV) is a popular topic of research in the field of IoT. One of the biggest issues facing IoV is collecting vehicle's travel tracks in real time.
2035 0
Internet of Vehicles – Window Querying with Alibaba Cloud RDS for PostgreSQL