What Is a Graph Processing System?
A graph processing system executes iterative algorithms over large graphs that do not fit in memory on a single machine. Applications include PageRank, shortest paths, community detection, and graph neural network feature propagation. The system must partition the graph across nodes, coordinate synchronous iteration, and detect convergence so computation can terminate automatically.
Requirements
Functional Requirements
- Ingest graph data (vertices and edges) from object storage or a database.
- Execute user-defined vertex-centric compute functions across all vertices.
- Support synchronous superstep-based computation following the Pregel model.
- Partition the graph across worker nodes with configurable partitioning strategies.
- Detect global convergence and terminate the algorithm automatically.
- Write the resulting vertex values to object storage upon completion.
Non-Functional Requirements
- Support graphs with up to 10 billion edges distributed across a worker cluster.
- Minimize cross-machine message traffic, which is the primary performance bottleneck.
- Recover from worker failure by re-executing the failed superstep from the last checkpoint.
- Convergence detection must not require synchronizing fine-grained state across all workers.
Data Model
Vertex
- vertex_id (64-bit integer)
- value (generic type defined by the algorithm, e.g. float for PageRank, integer for label propagation)
- out_edges (list of (target_vertex_id, edge_weight) pairs, stored adjacency-list style)
- active (boolean: whether the vertex will compute in the next superstep)
Message
Messages passed between vertices carry a (target_vertex_id, message_value) pair. The message_value type is algorithm-defined. Messages are produced during one superstep and consumed at the start of the next. They are not persisted to disk between supersteps; they are buffered in memory on the receiving worker.
Core Algorithms
Vertex-Centric Compute (Pregel Model)
Each superstep proceeds as follows across all workers simultaneously:
- Each active vertex receives the messages sent to it in the previous superstep.
- The vertex executes the user-defined compute function: it reads its current value, processes incoming messages, updates its value, sends messages to neighboring vertices, and optionally votes to halt (setting active = false).
- After all vertices complete compute, workers exchange outgoing messages to the workers responsible for the target vertices.
- The coordinator advances the superstep counter and begins the next round.
A vertex that voted to halt becomes inactive and does not run compute in subsequent supersteps unless it receives a message, which reactivates it. The algorithm terminates when all vertices are inactive and no messages are in flight.
Edge-Cut Partitioning
Vertices are partitioned across workers using a hash of vertex_id modulo worker_count. This edge-cut approach guarantees that each vertex lives on exactly one worker, simplifying state management. The cost is that edges between vertices on different workers (cut edges) generate cross-machine messages. For typical power-law graphs where a small fraction of vertices have most edges, hash partitioning distributes vertices evenly but concentrates cross-machine traffic on high-degree vertices.
An optional preprocessing step applies FENNEL or streaming partitioning, which assigns vertices to workers while trying to minimize cut edges by placing connected vertices together. This can reduce cross-machine message volume by 30-60% for social graph workloads.
Convergence Detection
Global convergence requires knowing that all vertices are inactive AND no messages are in flight. Each worker tracks a local active_count and out_message_count. At the end of each superstep, workers report these counters to the coordinator via an aggregation tree: worker nodes aggregate counts from their subtree before forwarding to the parent, reducing coordinator load. The coordinator computes the global sum. When active_count = 0 and total in-flight messages = 0, convergence is declared and the job terminates.
Scalability
Cross-machine message traffic dominates performance. The system applies message combining at the sender: if the algorithm provides a commutative and associative combine function, multiple messages to the same target vertex are merged into a single message per superstep per sender worker. For algorithms like PageRank (where incoming messages are summed), this can reduce message volume by an order of magnitude.
Checkpointing occurs every N supersteps (configurable). Each worker serializes its vertex partition state to object storage. If a worker fails, the coordinator restarts from the last checkpoint and re-executes the lost supersteps. The cost is at most N supersteps of re-execution, traded against checkpoint I/O overhead.
API Design
- POST /jobs — submit a graph job with pointers to vertex and edge data in object storage, algorithm specification (built-in or UDF), partitioning strategy, and convergence criteria.
- GET /jobs/{job_id} — return job status, current superstep number, active vertex count, message count, and elapsed time.
- GET /jobs/{job_id}/metrics — return per-superstep time series of vertex count, message count, and compute time.
- DELETE /jobs/{job_id} — cancel a running job.
- GET /jobs/{job_id}/output — return a signed URL to the output file in object storage once the job completes.
Failure Modes
- Worker failure mid-superstep: The coordinator detects the missing heartbeat, declares the superstep failed, and rolls back to the last checkpoint. Surviving workers reload their checkpoint state, and the failed worker is replaced (or its partition redistributed) before re-execution.
- Infinite iteration: A maximum superstep count is configurable. If reached without convergence, the job terminates with a partial result and a warning. The caller may increase the limit or adjust the algorithm parameters.
- Memory pressure from large message buffers: If incoming message buffers exceed a per-worker threshold, the worker spills them to local disk. The superstep completes correctly but with higher latency.
Observability
Track superstep duration, cross-machine message volume per superstep, message combine ratio, active vertex count progression (should decrease monotonically for convergent algorithms), and checkpoint size and write latency. Plot active vertex count over supersteps to visualize convergence rate and detect algorithms that are oscillating rather than converging.
{
“@context”: “https://schema.org”,
“@type”: “FAQPage”,
“mainEntity”: [
{
“@type”: “Question”,
“name”: “What is the Pregel vertex-centric computation model?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “In the Pregel model each vertex runs the same user-defined compute function independently in each superstep. The function reads messages sent to that vertex in the previous superstep, updates the vertex's value, and sends messages along outgoing edges to neighbors for the next superstep. Vertices that have no pending messages and vote to halt become inactive, keeping computation local and avoiding global coordination.”
}
},
{
“@type”: “Question”,
“name”: “What is the difference between edge-cut and vertex-cut graph partitioning?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “Edge-cut partitioning assigns each vertex to exactly one partition and cuts edges that cross partitions, turning cross-partition edges into network messages. Vertex-cut partitioning assigns each edge to exactly one partition and replicates vertices that span multiple partitions, reducing message volume at the cost of maintaining replica consistency. Vertex-cut tends to perform better on power-law graphs where high-degree hub vertices would otherwise generate enormous cross-partition traffic under edge-cut.”
}
},
{
“@type”: “Question”,
“name”: “How does superstep synchronization work in a distributed graph processing system?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “All workers execute the compute function for their local vertices in parallel within a superstep. When a worker finishes, it signals the master. The master waits for all workers to finish (a global barrier), then delivers all messages generated in that superstep to their destination vertices and starts the next superstep. This bulk-synchronous parallel model simplifies reasoning about correctness but means one slow worker delays the entire job.”
}
},
{
“@type”: “Question”,
“name”: “How does a graph processing system detect convergence?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “Convergence is detected when all vertices have voted to halt and there are no messages in flight. Each worker reports its active vertex count and outgoing message count to the master at the end of each superstep. When the master sees that the sum of active vertices and pending messages across all workers is zero, it terminates the computation and triggers result aggregation.”
}
}
]
}
See also: Scale AI Interview Guide 2026: Data Infrastructure, RLHF Pipelines, and ML Engineering
See also: Databricks Interview Guide 2026: Spark Internals, Delta Lake, and Lakehouse Architecture