A production engineering team at Trendyol shares their migration from Neo4j Enterprise to Apache AGE, a graph extension for PostgreSQL. Key decisions include consolidating multiple relationship types into a single discriminated HAS edge for simpler writes, using native SQL instead of Cypher for high-throughput writes, and replacing variable-length path queries (which bypass indexes in AGE and caused 3–5 second response times) with iterative fixed-depth traversals. Go goroutines parallelize multi-hop queries across intermediate nodes, and pointer-based map sets handle memory-efficient deduplication of overlapping results. The migration traded Neo4j's raw graph performance for PostgreSQL's operational advantages: unified infrastructure, CDC via logical replication, and predictable licensing costs.
Table of contents
Part 1: Why Apache AGE and How We WriteOpen-Source Graph Database AlternativesWhy We Migrated from Neo4j Enterprise to Apache AGEIllustrative ScenarioSort: