Apache AGE graph database extension for PostgreSQL

Apache AGE adds graph queries to a self-hosted PostgreSQL database so teams can model relationships next to relational data. This page covers when it fits, how to pair it with your PostgreSQL version and what the implementation requires.

On this page

When teams add Apache AGE graph database extension for PostgreSQL to existing data

Apache AGE provides graph database functionality inside an existing PostgreSQL database, so teams can model and query relationships next to the relational tables they already run. A team that already keeps customers, accounts, services and permissions in PostgreSQL and now needs to answer questions such as who owns a resource, which access paths lead to a sensitive table, or what depends on a failing component is the typical case. Instead of exporting rows into a separate graph system, the team keeps one database, one backup routine and one set of access controls, and adds graph queries alongside SQL. The project describes itself as a PostgreSQL extension that gives users graph query modeling inside the relational database, and that is the starting point for the decision.

Teams usually add the module when the relationship questions are occasional or moderate in depth and the data already lives in PostgreSQL. The extension lets applications and analysts write openCypher queries, which many engineers find easier to read for multi-hop paths than nested joins. The module itself is the query and storage layer. Your team still has to decide what the graph models, how it stays in sync with source tables, and which PostgreSQL version the extension supports. Confirm the current supported PostgreSQL versions and the matching Apache AGE release with the project documentation in the Apache AGE repository before you plan an install.

This page does not make performance claims, because results depend on graph shape, query depth and hardware, and those need to be measured on your own data. The decisions section covers when a dedicated graph database is the better fit, how to pair AGE with your PostgreSQL major version, and how to plan for upgrades and operations. Read that section before committing, especially if your workload involves very deep traversals or very large graphs, since those cases can change the answer.

What the Apache AGE extension gives PostgreSQL users

Apache AGE adds graph modeling and querying to a PostgreSQL server you already run. The cards below cover what the project describes, and where a capability depends on the AGE release you choose, the reader needs to confirm it before design starts.

Graph modeling inside the existing database

AGE is a PostgreSQL extension, so graph data lives in the same database engine as your relational tables. You model entities as vertices and relationships as edges, then decide which graphs stay in AGE and which data remains in ordinary tables. Check the AGE documentation for how graphs are stored and named before you design schemas, because that decides how you back up and migrate them.

Apache AGE site

**openCypher-style querying**

AGE exposes graph queries in an openCypher style, which lets teams write pattern-matching queries for paths, neighbors and relationships. Confirm in the AGE documentation which openCypher clauses and functions your release supports, since coverage differs from full graph database query languages. Test your most important traversals against that list before committing application code to them.

Relational and graph data side by side

Because graph and relational data share one server, a single query path can join graph results with tables for customers, accounts or assets. This removes a separate synchronization pipeline for many use cases. Plan how transactions span both models, and confirm how your AGE release handles mixed reads and writes in one transaction.

Running on the PostgreSQL you operate

AGE runs on the PostgreSQL server you already manage, so backups, replication, access control and monitoring follow your existing PostgreSQL practice. The extension must be built and loaded for the same PostgreSQL major version you run. Check the pairing in the AGE repository before any PostgreSQL major upgrade.

AGE repository

**Version pairing with PostgreSQL**

Each AGE release targets specific PostgreSQL major versions, and a new PostgreSQL major can require a new AGE build. Confirm the supported PostgreSQL versions for your chosen AGE release, and record the pairing in your change plan. PostgreSQL 14 reaches end of life on November 12, 2026, so pairing decisions for that line are time-bound.

Operational limits to test

Graph workloads can stress memory, query planning and index use differently from relational queries, and AGE storage is a different layout from plain tables. Load a realistic copy of your graph, measure traversal latency and confirm how backups and point-in-time recovery treat graph objects. Ask the AGE maintainers or your vendor support path which limits apply to your release.

How graph queries run beside relational tables

A client, such as an application service or an analyst's SQL tool, connects to PostgreSQL over the network and sends a query. With Apache AGE loaded in the database, the graph part of the query is handled by the extension while the relational tables sit in the same database. Graph data and relational data share one server, so the backup and replication design you already run covers both. Check which roles can create graphs and which can read them, and confirm that your existing backup tests restore graph data as well as tables.

Client queries reach one database, where graph and relational data share storage and backups.

Apache AGE or a separate graph database

This table compares three ways to handle relationship-heavy data: graph queries in Apache AGE inside PostgreSQL, a dedicated graph database service, and plain relational joins with recursive queries. Read each row against your own traversal depth, query shapes and data volumes, because the right choice depends on those patterns more than on general reputation.

FactorApache AGE in PostgreSQLDedicated graph databaseRelational joins and recursive queries
Data shapeProperty graph stored alongside existing tables, so relational and graph data share transactions and backupsGraph-first model where the graph is the primary store and is often synced from other systemsTables with foreign keys; relationships are modeled as join tables or parent references
Query styleopenCypher queries called from SQL through the AGE extensionNative graph query language of the chosen product, often with its own driver and toolingStandard SQL with JOINs and WITH RECURSIVE common table expressions
Team skillsWorks best where SQL and PostgreSQL administration already exist; teams add openCypherRequires the graph product's query language, drivers and administration skillsUses skills most database teams already have
Operational loadRuns inside your existing PostgreSQL cluster, so backups, replication and upgrades follow that cluster, plus AGE version pairingAdds a second database to deploy, back up, secure, monitor and upgradeLowest added load; recursive query performance depends on indexing and data volume
Signal that favors itGraph queries must join with relational data in the same transactions, and the team wants one database to runTraversals dominate the workload, deep multi-hop queries are frequent, or graph-specific features are requiredRelationships are shallow, traversal depth is fixed and small, and graph queries are occasional
Test before choosingBenchmark your typical traversals and hop counts against a realistic data volume on the target PostgreSQL versionBenchmark the same workload on the candidate product and compare operational cost, not only query speedMeasure recursive queries at your deepest expected depth and check whether indexes keep response times acceptable

How graph and relational data share schemas, keys and access

The core design decision with Apache AGE is that graph data does not live in a separate store. AGE keeps graph objects inside PostgreSQL, so vertices and edges sit in tables that PostgreSQL manages, and each graph is created as a schema of its own with backing tables for labels and for the vertices and edges that carry each label. Your existing relational tables stay where they are. The practical link between the two worlds is the property a vertex or edge holds: a customer vertex that stores your internal customer ID can be matched to the customers table by that key, and a query can join graph results to relational rows in the same statement. Before loading data, decide which relational key becomes the graph identifier, whether it is copied into vertex properties or only referenced, and how it is indexed. Confirm for your AGE version how vertex and edge storage is laid out and which indexes are created by default, since these details decide how the graph behaves under load. Do not assume storage size or scaling limits from the general PostgreSQL documentation; ask the AGE project for the documented behavior of your release.

Schema ownership and grants have to cover the graph objects, not only the relational ones. A role that can read customers but has no privileges on the graph schema will get permission errors when a query touches the graph, and a role that can write the graph schema can change entities that the relational application treats as authoritative. Plan grants for the graph schema, its label tables and the ag_catalog objects that AGE uses to resolve graphs, and test each application role against the exact queries it will run. Row-level security on relational tables does not automatically apply to graph reads, so any policy you depend on must be checked for graph access paths as well. Record these grants in the same change process you use for relational schema changes.

A single source of truth means choosing one system as the owner of each entity and treating the other as a derived view. A common pattern is to keep customers, accounts and transactions as relational records written by the application, and to rebuild or update graph vertices and edges from those records through a controlled process, so the graph never accepts writes that the relational model cannot explain. The opposite pattern, where the graph is written first and relational tables are derived from it, is valid only if the team accepts that relational constraints and foreign keys no longer protect the data. Write down, for each entity type, which system accepts inserts, updates and deletes, how deletions propagate to edges, and how drift is detected. Then test it: create a deliberate mismatch in a staging copy and confirm your reconciliation job finds it.

Apache AGE rollout steps from version pairing to cutover

This sequence takes a team from confirming which PostgreSQL major version and Apache AGE release can be paired, through graph design and tested openCypher queries, to moving one workload onto the extension with backup and restore checks in place. Each step closes with a written artifact that the next step depends on.

  1. Confirm the PostgreSQL and AGE version pairing

    Start by recording the PostgreSQL major version your cluster runs or plans to run, and check its support window in the PostgreSQL versioning policy. Then confirm in the Apache AGE documentation and the project repository which AGE release is built for that major version, and ask the AGE community or your vendor whether minor-release compatibility is documented. The output is a version matrix that lists PostgreSQL major, AGE release, build method and support end date, signed off by the platform owner. Do not install anything until a pairing is written down, because a mismatched build is the most common reason an extension install fails to load.

  2. Install the extension in a test database

    Build or install the matched AGE package on a non-production PostgreSQL instance that mirrors your production configuration, including the same major version and shared library path. Load the extension in a scratch database, confirm it appears in the extension catalog, and run a minimal graph creation and query to prove the loader works. Record the exact package source, checksum and configuration changes, such as entries in shared_preload_libraries or search_path, so the install can be repeated. The step is done when a clean install and a smoke query succeed on a freshly provisioned test server, not only on the machine where the build was first tried.

  3. Write the graph and label design

    Before loading any data, write a graph model document that names the vertex labels, edge labels, required properties and the relational tables each one comes from. Decide which entities stay in ordinary tables and which become graph vertices, and state which queries need traversal and which are better served by SQL joins. Include the identifiers used to link graph elements back to source rows, and note how deletes and updates propagate. The output is a reviewed model document with example vertices and edges drawn from representative records. Application owners and the data team should both sign it, since later changes to labels are costly to migrate.

  4. Load or sync relational data into the graph

    Populate the graph from the source tables using a repeatable script or pipeline, starting with a sample extract that covers edge cases such as nulls, duplicate keys and very high-degree nodes. Run the load into the test database first, then measure row counts per label and edge type against the source queries. Decide whether the graph is rebuilt on a schedule or updated incrementally, and document which approach you chose and why. The step closes with a load report listing source counts, graph counts, rejected rows and the time the load took, so the team can repeat it during cutover.

  5. Write and test openCypher queries

    Turn each traversal in the requirements into an openCypher query and run it against the loaded test graph. Compare every result set with an expected answer computed independently in plain SQL on the source tables, including counts, path lengths and empty-result cases. Keep the queries in version control with their expected outputs so a regression is visible after an AGE or PostgreSQL upgrade. The output is a test query set with pass or fail results per query. Where the AGE syntax or supported Cypher features differ from what the team expects, record the gap in the design document rather than working around it silently.

  6. Set roles and grants for graph objects

    Define which database roles can create graphs, read them, write to them and run administrative functions, and apply grants to the graph schemas and their underlying tables. Confirm that row-level or schema-level restrictions in the relational database still apply when a user reaches the same data through a graph query, since access controls on source tables are not automatically replicated into graph objects. Test each role by connecting as that role and attempting allowed and denied actions. The step is complete when a access test matrix shows every role's expected results, and the security owner has reviewed it.

  7. Add backup and restore checks for graph objects

    Confirm that your backup tool captures the graph schemas and their data, not only the relational tables, by listing the graph objects in a backup and comparing them with the catalog. Restore the backup into a separate instance that runs the same PostgreSQL and AGE versions, then rerun the openCypher test set against the restored data. Record the restore date, the backup identifier, the versions used and any objects that were missing or needed manual steps. Ask your backup vendor or internal team to confirm how point-in-time recovery treats extension-owned objects. The output is a signed restore test record that must be repeated after every AGE or PostgreSQL upgrade.

  8. Move one workload into production

    Choose a single workload with a clear owner, a defined fallback path to the existing query method and measurable success criteria, then schedule the cutover in a maintenance window agreed with that owner. Deploy the tested AGE version and schema to production, run the load or sync step, and execute the openCypher test set against production data before opening traffic. Monitor query latency, error rates and resource use during the first period of operation, and keep the fallback available until the owner accepts the result. The step is done when the owner signs off the cutover and the rollback procedure is written down and tested.

Pairing Apache AGE with your PostgreSQL version

When you start from nothing, choose the PostgreSQL major first, then select the AGE release that lists support for it. Do not start with the newest AGE release and work backward, because the newest AGE line may not yet cover the newest PostgreSQL major. The PostgreSQL versioning policy supplies the support windows: PostgreSQL 18 is supported through November 14, 2030, 17 through November 8, 2029, 16 through November 9, 2028, 15 through November 11, 2027 and 14 through November 12, 2026. Pick a major whose support window covers the expected life of the platform.

  • Read the release notes: Confirm which PostgreSQL majors each AGE release states it builds and tests against.
  • Check the repository: Review the branch or tag, open issues and build matrix in the Apache AGE repository for the PostgreSQL major you plan to run.
  • Record the pair: Write the PostgreSQL major, minor version and AGE version into the build record so later patches start from a known combination.
  • Confirm the build source: Compile from a tagged source release or use a package that states its PostgreSQL target.

Before go-live, confirm that the extension loads on the exact PostgreSQL build you will run in production, not only on a test instance.

What drives Apache AGE implementation effort and cost

This table lists the factors that raise or lower the effort of an Apache AGE build on self-hosted PostgreSQL, and what to request in a written quote for each. Read it before comparing quotes, because scope items that look minor here often decide the timeline. Most of the cost comes from modeling, migration and verification, not from installing the extension.

DriverEffect on effortWhat to request in a written quote
Number of graph modelsEach separate graph (label set, relationship types, property rules) needs its own modeling, query design and tests. Effort grows with graphs and with overlap between them.Count of graphs, vertex and edge labels, and the list of queries each graph must answer.
Existing data volume and migration complexityMoving relational rows into vertices and edges requires mapping keys, deduplicating entities and reloading. Large or dirty source tables add cleansing and reconciliation work.Row counts per source table, the mapping specification, reconciliation method and rerun plan.
Query patterns and openCypher coverage gapsApache AGE implements openCypher, but the team's queries may use features that need rewriting, splitting or moving to SQL. Each gap adds design and testing time.A query inventory with a coverage check against the team's features, and the fallback approach for unsupported patterns.
PostgreSQL version and upgrade planThe extension must be built and paired with a specific PostgreSQL major version. A later major upgrade requires rebuilding and retesting the extension alongside the server.The target PostgreSQL major, the Apache AGE release paired with it, and the upgrade test steps for the extension.
Access control designGraph data sits inside the same database, so roles, schema privileges and row visibility need deliberate design. Mapping existing relational permissions to graph access is extra work.Role model, which graphs each role can read or write, and how privileges are tested after each change.
Backup and restore verificationGraph data is stored in PostgreSQL tables, so standard backup tools apply, but restores must be tested with graph queries, not only row counts.Backup method, restore test scope, and the graph queries used as acceptance checks after restore.
Team familiarity with graph modelingTeams new to graph modeling need time to learn vertex and edge design, traversal costs and index choices. Experienced teams shorten design and review cycles.Whether training or pairing is included, and who reviews the graph model before build.

How AGE connects to backups, pooling, monitoring and applications

Apache AGE stores graph data in ordinary PostgreSQL tables, so most of the operational tooling you already run for PostgreSQL applies to it. The cards below cover the integrations where adding graph objects changes behavior, and what your team should test before graph workloads reach production.

Backup and point-in-time recovery

Graph data lives in the same cluster as your relational data, so a base backup and archived WAL files cover it. The risk is assumed scope: confirm that restores bring back the graph schema, its labels and its data together, and that the extension version in the restored cluster matches the one that wrote the data. Test a point-in-time restore to a time between two graph writes, then run a graph query against the result.

Continuous archiving docs

Connection pooling with PgBouncer

Graph queries are sent through the same client connection path as SQL, but session state matters more for graph work. Confirm how PgBouncer's pooling mode interacts with the session settings your AGE client sets before each query, such as the search path that makes graph functions visible. Test concurrent graph and relational workloads through the pooler, and watch for session state leaking between clients.

Replication and failover behavior

Hot standbys can serve read-only queries, but whether AGE graph queries run correctly and read-only on a standby depends on the extension version and the query types used. Confirm this on your PostgreSQL and AGE version pair before routing graph reads to replicas. Failover itself needs an external tool, so test that the promoted primary still loads the extension and returns the same graph results.

Monitoring and logging graph load

Graph traversals can be expensive and hard to spot in aggregate metrics, because they often look like ordinary function calls. Add logging for slow statements and track query duration and connection counts for graph workloads separately where your tooling allows. Confirm which statistics views show AGE statements and set alert thresholds from your own baseline rather than from a generic number.

Audit logging and access control

Graph reads and writes must appear in the same audit trail as relational access if your compliance program requires it. Confirm with the pgAudit documentation for your PostgreSQL major version whether graph statements are captured by your chosen statement classes, and test that a graph write produces an audit record. Review role grants on the graph schemas, since access to graph data can be granted separately from access to the underlying tables.

Apache AGE site

Application drivers and query composition

Applications typically send openCypher through a SQL driver by wrapping it in a database function call. Check that your driver and ORM handle the wrapper, parameter binding and result parsing correctly, and that prepared statements behave as expected through the pooler. Test error handling for malformed graph queries, since failures can surface as generic SQL errors in application logs.

Questions teams ask before implementing Apache AGE

Does Apache AGE replace a dedicated graph database?

Not always. Apache AGE gives PostgreSQL users graph query modeling inside the existing relational database, so it fits when graph queries sit beside tables your team already runs, and the data volume, query shapes and latency targets are within what one PostgreSQL cluster handles. A dedicated graph database is the better fit when traversal depth, graph size or concurrency are the main workload. Test both with your own queries before deciding. Ask the implementation partner to document which queries were measured and on what hardware.

What does an Apache AGE implementation cost, and what drives it?

Cost comes from the people doing the work, not from the extension itself, which is open source under the Apache project. The main drivers are the number of graph models to design, how many relational sources feed the graph, the amount of openCypher query work, testing against production-like data, and the operational setup around backups and upgrades. Most work is one-time, while monitoring, upgrades and extension pairing recur. DeployOpen does not publish prices. Request a quote built from a written scope that lists each of these items separately.

How long does an Apache AGE implementation take?

The timeline depends on how well the graph model is understood and how many queries must be ported or written. Teams that already know their entities and relationships usually move faster than teams still debating what a node or edge represents. Other factors include data loading from existing tables, security review, performance testing and the change process for production. No duration is given here because none is supplied for this topic. Ask for milestones tied to specific deliverables in the written scope.

What must our team provide before an Apache AGE project starts?

Plan to provide access to a non-production PostgreSQL environment, sample or masked data that reflects real relationships, a list of the business questions the graph must answer, and the openCypher queries you expect to run. You also need named owners for database operations, security review and the application teams that will call the graph. Provide your current PostgreSQL version and the upgrade schedule, because the extension must be paired with it. Missing inputs are the most common cause of schedule slips, so confirm them during scoping.

Can an internal team implement Apache AGE alone?

Yes, if the team already runs PostgreSQL in production, can read and write Cypher-style queries, and has time to test extension behavior under load. The harder parts are graph modeling choices, query tuning against the graph storage layout, and planning upgrades that keep the extension and PostgreSQL in step. Many teams bring in a partner for the design and test phases, then run the system internally. Decide which parts you want to own after the scope is written, and confirm that your staff has the database skills the work requires.

How do we upgrade Apache AGE when PostgreSQL changes version?

Treat the extension as part of the PostgreSQL upgrade, not a separate task. Check the project's documentation and the Apache AGE repository for the extension version that supports your target PostgreSQL major version before you change anything. PostgreSQL major upgrades use pg_dumpall and restore, pg_upgrade, or logical replication, and each path must account for the extension objects. Test the full path in a staging copy and record the rollback steps. Ask your partner to include extension pairing in the upgrade plan and the retest of graph queries.

Which operational caveats should we test before production?

Test backup and point-in-time recovery with graph data included, confirm that restores return identical query results, and measure query latency under expected concurrency. Check how the extension behaves during failover to a standby, how monitoring reports graph workload, and how schema changes to the graph are rolled out. Review the project's open issues and release notes for your chosen version. Ask for a written test plan that names each check, the environment it runs in and the acceptance result required before go-live.

Who is responsible for security and access control in an Apache AGE deployment?

Access control for graph data is handled through PostgreSQL roles, authentication and privileges, so the graph inherits your existing database security model. Review which roles can create, read and alter graphs, how application accounts connect, and how audit logging captures graph queries. Compliance teams will want evidence of these controls, and DeployOpen prepares that evidence without issuing audit reports. Ask the implementation scope to include a privilege review and a list of the roles and grants used by each application.

How DeployOpen scopes and delivers Apache AGE implementations

DeployOpen approaches Apache AGE as one part of a self-hosted PostgreSQL platform in your infrastructure. We scope which graph workloads move into AGE, which stay relational, and how the extension is versioned and operated alongside your PostgreSQL cluster.

How we scope

  • Inventory the graph questions your applications ask and decide which belong in AGE versus relational tables
  • Confirm the PostgreSQL major version and the AGE release that pairs with it before any build starts
  • Define the written scope, deliverables and timeline for Apache AGE in a fixed-scope agreement agreed in writing
  • Document the data model, graph names, owners and the openCypher queries that will run in production

How we build

  • Install and configure AGE in a staging cluster that mirrors your production PostgreSQL version and settings
  • Model vertices and edges, then load and query representative data to measure behavior before rollout
  • Test query plans, indexes and concurrent access from the application layer against agreed acceptance criteria
  • Pin extension and PostgreSQL versions in build records so upgrades can be planned rather than discovered

How we hand over

  • Deliver runbooks covering installation, upgrade steps, backup and restore checks for graph data, and rollback
  • Provide a documented test plan and results showing the graph workload was verified in your environment
  • Train your DBA and platform team on openCypher query review, monitoring of graph queries and extension troubleshooting
  • Hand over configuration, access controls and the list of open items with owners agreed in the written scope

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer for AGE and the PostgreSQL cluster around it
  • Plan AGE version changes together with each PostgreSQL major upgrade and retest graph queries before cutover
  • Review the extension against new PostgreSQL releases and the Apache AGE project before scheduled maintenance windows
  • Confirm with your team which support levels, response expectations and upgrade responsibilities the retainer includes

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.