Datalog is the dream. But SQL with a good query builder like Clojure's honeysql is not so bad.
That and SQLite seems to be able to scale to almost any problem, is disgustingly fast and with litestream incredibly resilient.