Fork me on GitHub
#hyperfiddle
<
2022-08-02
>
Dustin Getz19:08:38

Great youtube coverage of Hyperfiddle https://www.youtube.com/watch?v=cZy7SfLAjXA. Contains one mistake – we no longer depend on Datomic or immutable database, the model supports any dbs/backends (Video is simple and high level, not worth if you understand Photon, this is beginner marketing)

🙌 1
🎉 3
Daniel Jomphe19:08:03

Ok, you were used to say that Hyperfiddle would be impossible to implement without an immutable DB like Datomic, and if I understand you well, this requirement got dropped. 🙂

🙂 1
Daniel Jomphe19:08:02

1h23 minutes of interesting stuff!? Are they sufficiently knowledgeable to be that interesting that long!? 🙂

Daniel Jomphe19:08:41

If we've been following hyperfiddle for the past years do you think we'll learn something, does it connect well with all sorts of external concerns, or is it much more about beginning to understand hyperfiddle? Always a lot of resistance before starting to invest time in youtube videos.

1
🚫 1
Daniel Jomphe20:08:01

I've listened to the first 15 minutes now and they are indeed knowledgeable.

Daniel Jomphe21:08:24

I've listened to the whole discussion while multi-tasking (I'm a bad multi-tasker). They brought a lot of interesting concepts to the table. Their strength seems to be about relating general concepts. They didn't explain in details how Photon and Missionary are implemented.

Dustin Getz22:08:28

Yeah not worth, its just hype

Dustin Getz22:08:46

Hyperfiddle's staging area takes advantage of database-as-a-value, but the staging area is not mandatory. Also we can probably just add LOC to deal with it. We have LOC budget to spare 🙂

❤️ 1
Daniel Jomphe13:08:35

Your last sentences are what finally made it click for me about why you used to say that Datomic's immutability is key to Hyperfiddle. ...for its staging area feature. Thanks!

zeitstein20:08:48

I'm looking over the https://gist.github.com/dustingetz/fdd18563eb6195d3da39e6f520e33508. Looking at Todo-list, it seems that after any tx at least 3 db reads (2 q + entity for each todo) need to happen for the DOM to update. Is that right? If so, how does this scale for large UIs with a lot of db reads? Short of the db providing 'materialised views' (which can be a tall order), I'm failing to imagine how one achieves 'granular reactivity' here. Main concern being the amount of db reads required to refresh the UI.

1
❤️ 2
Dustin Getz21:08:36

thank you for asking this; short answer is either use a streaming database (most modern cloud data layers provide reactive subscriptions) or localize the updates (reactive update interval aka sampling frequency can be manipulated locally with standard missionary frp primitives). we will provide solutions when we reach the scale that is worth investigating this

Dustin Getz21:08:17

there are several promising infra startups that abstract over query diffing and generalized incremental maintenance on top of arbitrary data sources

Dustin Getz21:08:02

https://readyset.io is one; hasura also solves this in a great way

Dustin Getz21:08:12

you can always degrade to whatever todays CRUD apps are doing, this is a problem with relational databases not Photon so the problem is not unique to us. for example you can also just pin time as if it was a server rendered page and refresh at key interactions like clicking a link or submitting a form; i believe this is Phoenix LiveView model

Dustin Getz21:08:18

your backend can also do intelligent things in the query layer, your queries are written in clojure/java/js not photon and it's BYO database so this is in your control to deal with

Dustin Getz22:08:44

https://abulasar.com/building-realtime-liveview-app-using-phoenix-pubsub - LiveView makes you write out the pubsub to implement the server push as a special case

zeitstein05:08:34

I see your point about this not being Photon's problem. However, in the traditional SPA architecture there would be a UI cache layer between the DOM and the db, and this layer can more easily do 'granular reactivity' (and optimistic updates). (So similar in spirit to the abstraction your brought up.) Most of the time one doesn't really need to run full-scale db queries to update the UI. Of course, this layer increases complexity. Anyway, thanks for the detailed response! I'm looking forward to seeing solutions for those of us 'stuck' with clj datalog dbs.

🙂 1
Dustin Getz10:08:28

are you talking about client side database/orm architectures? that can be built in userland in photon. even more interesting than that - datascript/datomic can be rebuilt in Photon and now the “DAG slice” can cut right through the query engine and it's internal data structures, such that indexes are partially on the client and the final stages of query filtering are on the client- a distributed database with managed network

Dustin Getz10:08:33

that's like 3 man months for someone like Tonsiy to reimplement datascript in photon if he types fast as the clojure reference implementation is mostly reusable

zeitstein13:08:20

> a distributed database with managed network That would be a https://www.youtube.com/watch?v=ewoFTfAQnUI 🙂

yes 2