Inferensys

Glossary

Physical Schema

A physical schema is the concrete implementation of a logical schema within a specific graph database system, detailing how data is stored, indexed, partitioned, and accessed on disk or in memory.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
GRAPH DATABASE SCHEMAS

What is Physical Schema?

The concrete implementation blueprint for a graph database, detailing how data is physically stored and accessed.

A physical schema is the concrete, system-specific implementation of a logical schema within a graph database, detailing precisely how data is stored, indexed, partitioned, and accessed on disk or in memory. It translates abstract entity and relationship definitions into storage engine formats, index structures, and data distribution strategies optimized for a specific database like Neo4j or Amazon Neptune. This layer determines performance characteristics, such as traversal speed via index-free adjacency, and enforces constraints like uniqueness at the storage level.

The physical schema defines operational parameters, including graph partitioning for horizontal scaling, the types of graph indexes (e.g., composite, full-text) used for property lookups, and the transaction management model (e.g., ACID with MVCC). It is distinct from the logical schema, which focuses on data meaning and structure, and is tightly coupled to the database's internal architecture. Engineers use it to optimize query performance and manage storage efficiency, making it critical for production deployment and scalability of enterprise knowledge graphs.

IMPLEMENTATION DETAILS

Key Components of a Physical Schema

A physical schema translates the abstract logical model into concrete storage and access mechanisms specific to a graph database system. It defines how data is physically organized on disk or in memory for optimal performance and scalability.

01

Storage Engine & File Format

The core component dictating how graph elements are serialized and persisted. This includes the on-disk file structure (e.g., adjacency lists, compressed sparse rows) and the binary format for nodes, edges, and properties. Choices here directly impact write amplification, compression ratios, and cache locality. For example, a system using index-free adjacency will store direct pointers to neighboring nodes, while others may use indexed lookups.

02

Indexing Strategy

Defines the auxiliary data structures created to accelerate specific query patterns without scanning the entire graph. Common index types include:

  • Label/Type Indexes: For fast retrieval of all nodes with a given label.
  • Property Indexes: B-tree or hash indexes on specific property values (e.g., Person.name).
  • Composite Indexes: On multiple properties.
  • Full-Text Search Indexes: For text property content.
  • Spatial Indexes: For geospatial queries. The physical schema specifies which indexes are created, their structure, and update policies.
03

Partitioning & Sharding Scheme

Determines how the graph is divided across multiple machines or disks in a distributed system. This is critical for horizontal scalability. Strategies include:

  • Vertex-Cut Partitioning: Edges are partitioned, and vertices are replicated.
  • Edge-Cut Partitioning: Vertices are partitioned, and edges crossing partitions create network overhead.
  • Property Graph Sharding: Sharding by label or a key property (e.g., tenant_id). The physical schema defines the partitioning key, replication factor, and data locality rules.
04

Memory Management & Caching

Specifies how graph data is loaded and managed in RAM. This includes:

  • Page Cache Configuration: Size and eviction policies for disk blocks.
  • Hot Data Caching: Prioritizing certain subgraphs (e.g., recent transactions) in memory.
  • Buffer Pool Management: For managing concurrent access to in-memory data pages.
  • Off-Heap Memory Allocation: For storing large property values or vector embeddings separately. These settings directly control latency and throughput for traversal-heavy workloads.
05

Transaction & Concurrency Model

The low-level implementation of data integrity and isolation guarantees. This component details:

  • Locking Granularity: Row-level vs. page-level vs. graph-level locks.
  • Multi-Version Concurrency Control (MVCC): How transaction snapshots and version chains are stored.
  • Write-Ahead Logging (WAL): The format and flush policy for crash recovery.
  • ACID Compliance Boundaries: What is guaranteed within a single partition vs. across the cluster. This ensures predictable behavior under concurrent load.
06

Compression & Encoding

Defines the algorithms used to reduce the physical storage footprint of the graph. This includes:

  • Property Value Encoding: Using dictionary encoding for repetitive string values (e.g., city names).
  • Delta Encoding: Storing only the difference between sequential numeric IDs.
  • Bit-Packing: For small integer properties.
  • General-Purpose Compression: Applying LZ4 or Zstd to entire data pages. Effective compression reduces I/O and increases effective cache size but adds CPU overhead for decompression.
IMPLEMENTATION

How a Physical Schema Works

A physical schema is the concrete implementation of a logical schema within a specific graph database system, detailing how the data is stored, indexed, partitioned, and accessed on disk or in memory.

A physical schema translates an abstract logical model into a concrete storage blueprint for a specific database engine. It dictates the on-disk layout of nodes, edges, and properties, including file formats, indexing strategies for property lookups, and partitioning schemes for distributed storage. This layer determines performance-critical factors like traversal speed via index-free adjacency and the efficiency of ACID transaction processing. It is the bridge between a conceptual data design and its operational reality.

The schema defines physical constraints like uniqueness and cardinality at the storage layer and implements them using native database mechanisms. It specifies how graph indices are structured to accelerate specific query patterns and how multi-version concurrency control (MVCC) manages simultaneous access. For RDF systems, it governs the storage of triples and named graphs, while for property graphs, it manages the storage of labels and property keys. This implementation directly impacts scalability, query latency, and data integrity.

GRAPH DATABASE SCHEMAS

Logical Schema vs. Physical Schema

A comparison of the abstract, conceptual data model and its concrete, system-specific implementation.

FeatureLogical SchemaPhysical Schema

Primary Purpose

Defines the conceptual structure and meaning of the data.

Defines how the data is physically stored and accessed.

Focus

Entities, relationships, attributes, and business rules.

Storage structures, indexing, partitioning, and access paths.

Independence

Implementation-agnostic; independent of any specific database system.

Implementation-specific; tightly coupled to a chosen graph database (e.g., Neo4j, Amazon Neptune).

Representation

Uses diagrams (ERD, UML) or formal languages (OWL, a Graph Schema Language).

Uses database-specific DDL, configuration files, and storage engine parameters.

Key Components

Entity/Vertex types, Relationship/Edge types, properties, cardinality constraints, inheritance hierarchies.

Disk layout, pointer structures (e.g., index-free adjacency), index types (B-tree, Lucene), shard keys, memory buffers.

Change Impact

Evolving the logical schema changes the business view of the data; requires analysis of semantic impact.

Evolving the physical schema changes performance and storage; may require data migration or re-indexing.

Optimization Target

Clarity, semantic richness, and alignment with business domain concepts.

Query performance, storage efficiency, and scalability for specific workload patterns.

Example Artifact

An ontology defining classes like Customer and Product and a property purchases.

A Neo4j index on the name property of Customer nodes and a decision to store properties in-lined vs. in a dynamic store.

PHYSICAL SCHEMA

Frequently Asked Questions

A physical schema defines the concrete, system-specific implementation of a logical data model, detailing how data is stored, indexed, and accessed on disk or in memory. This section answers common technical questions about its role in graph databases.

A physical schema is the concrete, system-specific implementation of a logical schema within a graph database, detailing precisely how data is stored, indexed, partitioned, and accessed on disk or in memory. It translates the abstract entities and relationships of a logical model—like Person nodes and KNOWS edges—into the low-level storage structures of a specific database engine, such as Neo4j, Amazon Neptune, or JanusGraph. This includes decisions about file formats (e.g., adjacency lists, compressed sparse rows), index-free adjacency for pointer-based traversal, the creation of graph indexes on property values, and graph partitioning strategies for distributed systems. The physical schema directly determines performance characteristics like query latency, write throughput, and storage efficiency, making it a critical concern for database administrators and data engineers.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.