DEV Community

Muhammad Farooq
Muhammad Farooq

Posted on

1

Integration of Apache AGE and Citus to Build a Scalable Graph Database on PostgreSQL

Graph Database

Graph databases are becoming increasingly popular for applications that need to store and analyze complex and interconnected data, such as social networks, recommendation systems, or knowledge graphs. Graph databases allow you to model your data as nodes and edges, and query them using graph algorithms and languages.

However, most graph databases are separate from relational databases, which means that you need to maintain two different systems, migrate your data, and integrate your queries. Moreover, most graph databases are not designed to scale horizontally, which limits their performance and capacity.

What if you could use PostgreSQL as a graph database, and also scale it out across multiple nodes? This is where Apache AGE and Citus come in.

What is Apache AGE?

Apache AGE is a graph database extension for PostgreSQL that allows you to store, query, and analyze graph data in a relational database. Graph data is composed of nodes and edges that represent entities and relationships. With Apache AGE, you can use openCypher, a popular graph query language, to manipulate and explore graph data in PostgreSQL. You can also use SQL to query both graph and relational data in a hybrid way.

Some of the benefits of using Apache AGE are:

  • You can leverage the power and reliability of PostgreSQL as a relational database system, while also gaining access to graph functionality.
  • You can use existing PostgreSQL tools and libraries to work with graph data, without needing to migrate or integrate with a separate graph database.
  • You can perform fast and efficient graph analysis using various algorithms and functions provided by Apache AGE.
  • You can visualize and interact with graph data using Apache AGE Viewer, a web user interface for Apache AGE.

If you want to learn more about Apache AGE, you can visit its official website and its GitHub repository.

What is Citus?

Citus is a PostgreSQL extension that transforms Postgres into a distributed database—so you can achieve high performance at any scale. With Citus, you extend your PostgreSQL database with new superpowers:

  • Distributed tables are sharded across a cluster of PostgreSQL nodes to combine their CPU, memory, storage and I/O capacity.
  • References tables are replicated to all nodes for joins and foreign keys from distributed tables and maximum read performance.
  • Distributed query engine routes and parallelizes SELECT, DML, and other operations on distributed tables across the cluster.
  • Columnar storage compresses data, speeds up scans, and supports fast projections, both on regular and distributed tables.

Advantages of using Apache AGE and Citus Together?

By combining Apache AGE and Citus, you can build a scalable graph database on PostgreSQL that can handle large volumes of complex and interconnected data. You can shard your graph data across multiple nodes using Citus, and query it using openCypher or SQL using Apache AGE. You can also join your graph data with your relational data using foreign keys or SQL joins.

To use Apache AGE and Citus together, you need to install both extensions on your PostgreSQL cluster.

But this may not work.

Apache AGE team is working on a new project that is based on integration of Apache AGE and Citus.

Conclusion

In this blog post, I introduced Apache AGE and Citus to build a scalable graph database on PostgreSQL. and how Apache AGE and Citus can work together.

We hope that this blog post was helpful and informative for you. If you have any questions or feedback, please feel free to leave a comment below. Thank you for reading!

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay