Azure CosmosDB for PostgreSQL Reaches General Availability
Written by Nikos Vaggalis   
Wednesday, 02 November 2022

Azure CosmosDB is Microsoft's mutli-model distributed database for supporting workloads at scale. Now it has extended beyond NoSQL by adding support for PostgreSQL.  Azure thus becomes the first cloud provider to offer its own single database service that supports both relational and NoSQL workloads. So how do you use it with Postgres?


azure cosmos db

When Azure Cosmos DB was launched in 2017 we reported that it was based on a service started in 2010 for internal use within Microsoft for large scale applications and that had been made available more widely as DocumentDB, Microsoft's NoSQL database. Initially it supported for MongoDB but APIs for Apache Gremlin and Apache Cassandra were soon added and now the line-up is joined by PostgreSQL and you choose the API of choice upon creating a cluster. So while Cosmos DB for NoSQL does not have relational constraints, when needing to work with relational workloads you can choose the Postgres backend; a fully managed distributed SQL offering built upon the core benefits of Postgres like JSONB datatype extensions, PostGIS, rich indexing and so on.

On top of that, it uses the open source Citus extension to make Postgres ready for the distributed scale, using distributed tables across multiple nodes. You can start small by building your apps on a single node, the same way you would with Postgres and
as your apps scale and performance requirements grow, you can scale to multiple nodes by transparently distributing your tables.

Azure Cosmos DB for PostgreSQL supports the new PostgreSQL version 15, available in the portal for the managed service—in all Azure regions. This means that you benefit from all this version's new features as described in PostgreSQL 15 Released - What's New:

  • the MERGE statement
  • security_invoker
  • parallelism enchantments
  • logical replication
  • jsonlog
  • regular expressions

You can also upgrade your existing cluster to Postgres 15 from any of the other supported major Postgres versions.

The DaaS is more than Postgres with distributed capabilities due to Citus. Other benefits include backup and restore, high availability, monitoring and alerting, Azure security, integration with other Azure services, plus:

  • Distributed transactions & distributed deadlock detection

  • Automatic colocation groups that allow you to enforce
    foreign keys, constraints, and easily join your data without costly Repartition operations

  • Distributed query processing, where computations are shipped to the data

  • Distributed utility commands, such as index creation, Vacuum / Analyze

  • Ability to read from and write to any one of the nodes in the cluster

  • Online shard rebalancing & isolating noisy tenants / shards

Note that even in the distributed workload front, Azure Cosmos DB makes enabling distributed tables easy:

Previously, if you wanted to use the Citus extension to create a distributed table, you’d first have to pick a sharding key. You’d then have to run a command that would block write operations. With Citus 11.1, creating a distributed table and many previously write blocking operations, become fully online. Once you create a distributed table, Citus takes care of the rest.

If you want to give Azure Cosmos DB for PostgreSQL a try, you can start with a free trial and the Quickstart guide "Create an Azure Cosmos DB for PostgreSQL cluster in the Azure portal".


More Information

Distributed PostgreSQL comes to Azure Cosmos DB

Create an Azure Cosmos DB for PostgreSQL cluster in the Azure portal

Related Articles

Cosmos DB Strengthens Microsoft's Azure Database

Azure Cosmos DB Gets Multi-Masters

PostgreSQL 15 Released - What's New

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.


Redis Changes License, Rival Fork Launched

The developers of Redis have announced that they are changing the licensing model for the database. From now on, all future versions of Redis will be released with source-available licenses rather tha [ ... ]

ACM Adopts Open Access Publishing Model

ACM, the Association for Computing Machinery, the professional body for computer scientists, has relaunched Communications of the ACM, the organization’s flagship magazine, as a web-first  [ ... ]

More News

raspberry pi books



or email your comment to:

Last Updated ( Wednesday, 02 November 2022 )