Fork me on GitHub
#hyperfiddle
<
2024-03-16
>
Nikolas Pafitis22:03:12

Hello guys. I'm trying electric with different databases. In your experience, what database makes it easier to work with in electric, particularly when creating a flow from a database for 'live' queries. I know of this https://github.com/hyperfiddle/electric-fiddle/blob/28b875d3eaa77f2d8b4716f383ba8f5ed2e1b92e/src/xtdb_demo/xtdb_contrib.clj with XTDB although it only works when xt node is in-process. What other options are there?

Dustin Getz22:03:39

we have personally only used datomic using the tx-report-queue in the simplest unoptimized configuration

Dustin Getz22:03:16

database usage (including crud patterns) likely going to be a major work area for us in the back half of this year, it’s a weak point today

Dustin Getz22:03:30

broadly it is the database/data layer responsibility to inform electric via events when queries have changed - see rama, materialized for data layers that natively support query subscriptions. for batch databases, there is always going to be some impedance at this boundary. missionary gives you the tools you need to manage it. you can always fallback to SPA/REST semantics where queries are polled on navigate for the most part except for specific realtime views (e.g. chat views) which likely aren’t going to be stored in postgres anyway, you’d use an event store which offers native topic subscriptions

Nikolas Pafitis10:03:26

Thanks for the answer @U09K620SG

Nikolas Pafitis10:03:56

Has anyone tried out surrealdb and live queries?

Nikolas Pafitis10:03:13

I guess it could be made to work nicely with missionary flows