datacrypt-project / hitchhiker-tree

Functional, persistent, off-heap, high performance data structure
Eclipse Public License 1.0
1.19k stars 64 forks source link

Initial draft at SQLite Backend #21

Open cddr opened 7 years ago

dgrnbrg commented 7 years ago

This is awesome. I think this is pretty much ready to merge, except for one thing: could you write a bit about the schema/structure of the data in SQLite, so that we can understand how the data is encoded?

cddr commented 7 years ago

Cool!

Sorry for the extra changes but I also took the liberty of renaming the namespace to be "hitchhiker.jdbc" because there's nothing specific to sqlite in there so it should just work with any database you can find a jdbc driver for.

There might be one other thing which to surface the selection of a backend to the user through outboard/create but I can do that in a new PR. I was thinking of adding a multi-method that dispatches off the name passed to outboard/create and returns a "backend constructor" and adding a slot in OutboardConnection to hold it.

dgrnbrg commented 7 years ago

That looks great!

For Outboard, I had originally envisioned it as being a persistent in-memory backed data structure. Now that you bring it up, I can definitely see the value in extending the API to support plugging in alternate backends. Maybe the create function could take the backend as an argument, and then we could have namespaced functions like outboard.redis/create and outboard.jdbc/create for parametricity?

cddr commented 7 years ago

Maybe the create function could take the backend as an argument

That would also work but I thought create was supposed to be analogous to datomic's create-database (or would you want to avoid making the API exactly the same as datomic).

dgrnbrg commented 7 years ago

Outboard != datomic, API-wise. Outboard's a proof-of-concept API to make the HH trees usable by end-users. There will be a different API that mirrors the Datomic API.