5 ms·
Building data-centric apps with a reactive relational database
- mhlakhani 5y agoThis is really interesting - at a high level it reminds me of some of the approaches taken in Facebook's messenger app: https://engineering.fb.com/2020/03/02/data-infrastructure/messenger/ https://engineering.fb.com/2020/03/02/data-infrastructure/me... The relevant content is touched on briefly in the "Use SQLite" section. I'd be curious to learn more about the differences in the two approaches.
- kureikain 5y agoanyone how what tool we can use to make those chart? It looks friendly.
- brundolf 5y agoThis is a very similar philosophy to the MobX library (normally paired with React), and also to the programming language I'm building: https://github.com/brundonsmith/bagel https://github.com/brundonsmith/bagel
- gklitt 5y agoYeah, MobX is a great tool for fine-grained reactivity + managing state outside UI tree. I haven't seen anyone try relational querying in MobX, would be curious if that's a thing.
- aidos 5y agoI've just skimmed the article but I'm definitely going to give it a proper read. We've built an architecture somewhat like this where we're using MobX objects in the frontend (a graph of the db objects effectively) that's patched by subscriptions to tables via hasura. So we effectively have all the data on hand locally all the time and use the reactivity on top of that. We actually played around with sqlite in wasm because I really really miss having a real relational db in the frontend. We decided that there was just a few too many unknowns to proceed further with the idea. Initially we were using indexdb as a frontend cache but dropped that since without adding more layers to it it doesn't provide much value. (Also played around with using Solid's direct mobx -> jsx library without having react inbetween https://github.com/ryansolid/mobx-jsx https://github.com/ryansolid/mobx-jsx but, again, too much unproven tech to build on). The work you're doing here is super exciting. The developer experience of what we currently have is pretty nice and I can definitely see your model working out well in the future.
- brundolf 5y agoThat is an interesting question. Theoretically it should work - it's all just data - assuming you could implement relational querying efficiently in JavaScript itself
- michael_j_ward 5y agoIf you are interested in this, they are presenting at an upcoming indi-conference: "Have You Tried Rubbing A Database On it". https://www.hytradboi.com/ https://www.hytradboi.com/
- whiddershins 5y agoSo … would this pair even better with Svelte, so we become even more reactive through the whole stack?
- gklitt 5y agoYeah, Svelte or Solid is probably a more natural fit than React. But at the end of the essay we propose a weirder alternative, which is to implement the UI templating itself as just part of a DB query.
- acidbaseextract 5y agoI've always had a soft spot in my heart for PHP style "raw query in the template". Even as we've moved away from that I feel like GraphQL recapitulates a lot of the reasons why having queries tightly bound to views is convenient. It feels like "put the template in the query" is a great Uno reverse to "put the query in the template" and the associated issues it brings, but I'll have to think on the consequences more. Thought provoking article!
- gillytron 5y agoWhy should I care about this?
- rmah 5y agoFrom what I can tell, it sounds sort of like a simplified spreadsheet as a code library.
- intrepidhero 5y agoAn event driven, local-first, UI that automatically reacts to changes in the underlying database is a pretty old idea. https://docs.microsoft.com/en-us/dotnet/api/system.data.datatable?view=net-6.0 https://docs.microsoft.com/en-us/dotnet/api/system.data.data... https://doc.qt.io/qt-5/qsqltablemodel.html https://doc.qt.io/qt-5/qsqltablemodel.html Am I missing something novel in the article? I really feel like I'm missing something.
- hackerfromthefu 5y agoI agree with your assessment, and it's just the younger generation catching up to older established wisdom. The tragic irony is how hard many of that generation badmouthed the old ways of doing things. For instance ADO.NET with datatables/dataviews was often looked down upon, but through working more with people who did so it turned out that they just didn't understand it, so often that it's basically ten times out of ten.
- ripley12 5y agoHow is DataTable an example of that? It’’s a class that’s usually used to hold the contents of a relational database table, nothing to do with UI.
- intrepidhero 5y agoBecause you usually link it to a DataView and then the DataView updates when the underlying data changes. Same for QSqlTable, it links up with a QTableView.
- catlifeonmars 5y agoHow is this different than Apollo GraphQL with an SQL backend?