Member-only story

Object eversion, ZigZag, and the RDBMS

John Ohno
3 min readJan 1, 2019

Object eversion was an idea we* invented for ZigZag (a generalization of tabular databases from 2 to n dimensions) but it occurs to me that it might be a convenient alternative to object-relational wrappers for codd-style RDBMS in prototype languages like JavaScript and lua (and languages that just support metatables like python), if you don’t mind fragging all your tables.

The idea is basically this:

An object doesn’t contain attributes, but is instead a point where the values of its attributes intersect. (Sort of like words in vector space.)

Traditional objects (left) vs everted objects (right)

In RDBMS terms: an object corresponds to some foreign key, & valid object members are rows in any tables where that foreign key is present (where the name of the member corresponds to the table name). So, in a language that lets you lookup if a property exists at runtime, that’s your object member lookup.

In ZigZag terms: an object is some cell, and valid object members (other than value) are any cells connected poswardly along some dimension (where the name of the member correponds to the dimension name).

This is fast in ZigZag where it’s just named linked lists so you’re doing a hash lookup + pointer dereference. In an actual RDBMS, this is liable to be slow, but importantly, it does not break the idiomatic style of RDBMS table layout.

--

--

John Ohno
John Ohno

Written by John Ohno

Resident hypertext crank. Author of Big and Small Computing: Trajectories for the Future of Software. http://www.lord-enki.net

Responses (1)