Re:FoundationDB's Lesson: A Fast Key-Value Store Is Not Enough
by FeepingCreature on Thursday April 02, 2015 @03:36AM
(#9309134)
Hey, amateur here - but has anybody tried to do a database where your edge servers literally run jit code? Like, you'd define a predicate like an OpenCL kernel, as a small ball of code taking a predetermined set of constants or per-row variables, then presumably push this as LLVM bytecode and let the edges compile it into locally appropriate loops (probably with caching). Is the problem there that it would become hard to apply optimizations that depend on awareness of data structure at a higher-than-row level?
Re:FoundationDB's Lesson: A Fast Key-Value Store Is Not Enough
by jhugg on Thursday April 02, 2015 @09:07AM
(#9310438)
So there are plenty of systems that compile portions of a SQL plan to bytecode (LLVM or JVM) or machine code directly. Usually, the part you compile is the SQL plan and most importantly the predicate filters.
Common operations like networking, transaction management and even index walks (except the key comparisons) are already compiled to native code, so you don't need to go all in. You just optimize the stuff that needs it.
But the core idea of pushing predicates to edges seems reasonable. At one point, I built this sql engine that coordinated queries and pushed down queries to the edges. It assumed that each edge store implemented an iterator over all its values, with optional filtering and sorting (if not implemented on the edge store, then the engine/client would filter/sort). It works great, but I haven't yet published it for other reasons.