Garamond.jl icon indicating copy to clipboard operation
Garamond.jl copied to clipboard

Consider using alternative to JuliaDB

Open jpsamaroo opened this issue 5 years ago • 3 comments

JuliaDB is more-or-less in maintenance mode, and has received very little in the way of bugfixes and performance improvements. While it might be hasty for me to say "don't depend on JuliaDB", I think at a minimum it would be a good idea to consider allowing other alternatives into Garamond's core. We could maje JuliaDB optional, and (try to) adopt the official Tables.jl interface so that other table implementations could be used. I'm not sure how indexing would work here, but I feel like it might be worth investigating approaches that aren't inherently tied to JuliaDB/IndexedTables.

Speaking as a maintainer of Dagger.jl, making JuliaDB optional would also make it possible to use newer versions of Dagger (since JuliaDB only works on old versions of Dagger) for parallelism and accelerator offload, and could make it possible for Garamond to operate as a distributed cluster of engines.

jpsamaroo avatar Nov 23 '20 00:11 jpsamaroo

This is a big can of worms; I have not been following Tables.jl at all however I think that is supports some generic query syntax; this is critical as any query is decomposed into a intermediary data representaion from which functions operating on the table are built (or composed). This is still informal at this stage in the engine. At this point I have no ideea what such a transition would require...

Is there a formalization of querying a Tables.jl -compatible data structure?

zgornel avatar Nov 23 '20 10:11 zgornel

The Tables.jl interface is pretty simple and straightforward to use and implement (https://tables.juliadata.org/stable/#Using-the-Interface-(i.e.-consuming-Tables.jl-compatible-sources)-1), and IndexedTables already implements it. I forgot that we also need DB-like operations, but thankfully DBInterface.jl provides that (it makes executing SQL queries uniform across DB implementations). I started working on an SQLite backend for Garamond, and while I haven't yet tested it, it's been pretty easy going given how things have been abstracted out in src/data/db.jl. Thanks to DBInterface.jl, the work I'm doing may also generalize to other DBs like Postgresql and MySQL with minimal effort. I'll post a PR once I have things in a mostly-working state.

jpsamaroo avatar Nov 23 '20 13:11 jpsamaroo

Sounds good, any db interface is useful. Ill leave this issue open as this is quite relevant;

zgornel avatar Nov 23 '20 16:11 zgornel