Initial draft at SQLite Backend#21
Conversation
| (map-indexed (fn [i s] | ||
| (assoc s :sheet-name (str "Trial " (inc i)))) | ||
| @outputs)}))) | ||
| (jdbc/with-db-connection [db (sqlite/db-spec ":memory:")] |
There was a problem hiding this comment.
Could we move this down to the creation of the SQLiteBackend? I think that would make it easier to review by not changing the indent, and that's the only time we need the DB to be created.
Also, what are your thoughts on using memory vs. disk-backed DB. I feel like backing with disk is more interesting to trigger the IO behavior we might encounter.
There was a problem hiding this comment.
Yeah memory was nice while getting started so I didn't have to worry about resetting the schema.
I didn't actually mean to submit a PR so early but thanks for your comments. I'll refactor the db lifecycle. This was just the easiest way to see some quick results. I'm not sure how to interpret that spreadsheet though.
| (defn delete-key [db k] | ||
| (jdbc/delete! :hh-key ["k = ?" k])) | ||
|
|
||
| (defn add-refs [db {:keys [parent children]}] |
There was a problem hiding this comment.
I like how you managed to get refcounting into SQLite, but I'm worried that the refcounting IO overhead might cause issues. On the other hand, maybe it won't. Have you ever profiled a JVM application? I'd be happy to teach you how to do so--the benchmarking tool makes it really easy.
There was a problem hiding this comment.
Not something low-level like this. Would welcome the tutoring :-)
There was a problem hiding this comment.
Great! Once you're able to run the benchmark, let's jump on a hangout and I'll walk you through some of the techniques I use to identify perf bottlenecks--we'll look for operations that use too much CPU, too much I/O, or cause weird cross-interferences :). You should have my google account from invite I requested on drive.
|
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? |
|
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 |
|
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 |
That would also work but I thought |
|
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. |
cbc0763 to
5c5d756
Compare
No description provided.