Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsMay 3, 2026·3 min de lectura

Apache AGE — Graph Database Extension for PostgreSQL

Apache AGE (A Graph Extension) adds graph database capabilities to PostgreSQL. Query your existing Postgres data as a graph using openCypher while keeping full SQL compatibility.

Introduction

Apache AGE is a PostgreSQL extension that adds graph database functionality without requiring a separate system. It implements the openCypher query language on top of PostgreSQL's storage engine, letting you mix graph traversals with standard SQL queries in a single transaction.

What Apache AGE Does

  • Adds labeled property graph support to any PostgreSQL instance
  • Implements openCypher query language for graph pattern matching
  • Allows hybrid queries combining SQL tables with graph data in one statement
  • Stores graph data using PostgreSQL's native storage engine and MVCC
  • Supports multiple named graphs within a single database

Architecture Overview

AGE stores vertices and edges as rows in PostgreSQL catalog tables, using the native heap storage and indexing. The openCypher parser compiles graph queries into PostgreSQL execution plans that leverage the standard query optimizer. Graph elements are stored as a custom agtype (JSON-like) data type, enabling flexible property schemas. Because it runs as an extension, AGE inherits PostgreSQL's ACID guarantees, replication, and backup tooling.

Self-Hosting & Configuration

  • Install from source or use pre-built packages for PostgreSQL 14-16
  • Enable with CREATE EXTENSION age in your target database
  • Set search_path to include ag_catalog for Cypher function access
  • Create graphs with SELECT create_graph('name') to namespace your data
  • Use standard PostgreSQL configuration for memory, connections, and WAL

Key Features

  • No separate infrastructure: graph capabilities inside your existing PostgreSQL
  • openCypher compatibility enables migration from Neo4j with minimal rewriting
  • Hybrid SQL+Cypher queries join relational tables with graph traversals
  • Full ACID transactions covering both graph and relational operations
  • Inherits PostgreSQL ecosystem: pgBackup, replication, extensions, monitoring

Comparison with Similar Tools

  • Neo4j — Dedicated graph DB with richer tooling but requires separate infrastructure
  • Dgraph — Distributed GraphQL-native DB; AGE reuses your existing PostgreSQL
  • Amazon Neptune — Managed cloud graph DB; AGE is self-hosted and free
  • PostgREST + recursive CTEs — Manual graph queries in SQL; AGE provides native Cypher syntax
  • EdgeDB — Graph-relational but different query language; AGE uses standard openCypher

FAQ

Q: Can I query graph data and regular tables together? A: Yes, you can join Cypher results with SQL tables in a single query using subqueries.

Q: Does AGE support Neo4j's full Cypher? A: It implements the openCypher subset. Most common patterns work, but some Neo4j-specific functions may differ.

Q: What PostgreSQL versions are supported? A: AGE supports PostgreSQL 14, 15, and 16 with version-specific builds.

Q: How does performance compare to Neo4j? A: For moderate graph sizes AGE performs well using PostgreSQL indexes. Very large graph traversals may benefit from Neo4j's native graph storage.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados