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

Cayley — Open-Source Graph Database Inspired by Google's Knowledge Graph

Cayley is an open-source graph database written in Go, inspired by the graph infrastructure behind Google's Knowledge Graph. It supports multiple storage backends and query languages for flexible graph traversal.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 96/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Knowledge
Instalación
Single
Confianza
Confianza: Established
Entrada
Cayley Graph Database
Comando de instalación directa
npx -y tokrepo@latest install 4c55125e-46ca-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

Introduction

Cayley is a graph database written in Go, originally created at Google and open-sourced for community use. It provides a flexible query layer supporting Gizmo (JavaScript-based) and GraphQL, backed by pluggable storage engines ranging from in-memory to PostgreSQL and MongoDB.

What Cayley Does

  • Stores and queries graph-structured data using subject-predicate-object triples (quads)
  • Supports multiple query languages: Gizmo (JS), GraphQL, and MQL
  • Pluggable backend storage: BoltDB, PostgreSQL, MongoDB, in-memory, and more
  • Provides a built-in web UI for visual graph exploration and query execution
  • Imports and exports standard RDF formats (N-Quads, JSON-LD, Turtle)

Architecture Overview

Cayley uses a quad store model where each fact is stored as a quad (subject, predicate, object, label). The query layer compiles traversal expressions into an iterator-based execution plan that operates against a pluggable backend. Storage engines implement a common interface, allowing swaps between BoltDB for embedded use, PostgreSQL for durability, or in-memory stores for testing.

Self-Hosting & Configuration

  • Install via Go toolchain or download prebuilt binaries from GitHub releases
  • Configure storage backend with --dbpath flag or YAML config file
  • Default HTTP port is 64210; override with --host and --port flags
  • Load initial data with cayley load --quads=<file> supporting N-Quads and JSON-LD
  • Deploy with Docker using the official cayleygraph/cayley image

Key Features

  • Multiple query languages let teams pick what fits their mental model
  • Pluggable backends mean you can start embedded and scale to PostgreSQL later
  • Built-in web visualizer for interactive graph exploration
  • Native Go library for embedding directly into Go applications
  • RDF-compatible data model aligns with linked data standards

Comparison with Similar Tools

  • Neo4j — More mature with Cypher, but requires JVM and commercial license for clustering
  • Dgraph — Distributed GraphQL-native DB with higher operational complexity
  • ArangoDB — Multi-model but heavier; Cayley is lighter for pure graph workloads
  • Apache Jena — Full semantic web stack in Java; Cayley is simpler and Go-native

FAQ

Q: What query language should I start with? A: Gizmo (JavaScript-based) is the most documented and flexible for traversals. GraphQL works well if you already know your schema.

Q: Can Cayley handle large datasets? A: Yes, with PostgreSQL or MongoDB backends it handles millions of quads. For billions, consider a distributed graph DB instead.

Q: Is Cayley still maintained? A: The project has slower release cadence but remains functional and accepts contributions.

Q: Can I use Cayley as an embedded library? A: Yes, import the Go packages directly and use the graph API without running a server.

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