TLDR DevOps · OPINIONS & TUTORIALS

SOLVING THE 1+N QUERY PROBLEM

acadia.engineering7 min read

Summary from the TLDR DevOps newsletter

Acadia eliminates the N+1 query problem by design: its query language has no general-purpose loops or recursion, so developers cannot accidentally turn a relationship lookup into one query followed by N additional database calls. Inspired by Datalog, Acadia instead expresses relationships through operations like intersect that compile into set-based SQL, while also guaranteeing that queries terminate in polynomial time relative to the size of the data.