5 ms·
Author here, if anyone has any thoughts or feedback. Bring it on!
by jamesgpearce 4y ago
Author here, if anyone has any thoughts or feedback. Bring it on!
- pbronez 4y agoCongratulations on shipping! Can you explain your motive for focusing on the combination of reactive data and local deployment? My first thought is that local-first = one user = I know what’s changing because I’m the only one using it. Perhaps valuable for monitoring external data feeds?
- jamesgpearce 4y agoYeah, I see your point. I've been assuming that local-first doesn't mean local-only. Even if it's just you, you could easily be polling something else to get data updates, as you suggest. (One original use case was a personal GitHub dashboard app that polled for new activity but provided local analytics). A couple of great essays I've enjoyed in this space are https://www.inkandswitch.com/local-first https://www.inkandswitch.com/local-first & https://riffle.systems/essays/prelude/ https://riffle.systems/essays/prelude/ I feel it should be possible to build certain types of apps that can view, query, and manipulate denormalized data without even being online. (Perhaps I shouldn't over-glamorize those days when one used to jam Access databases into Windows apps, but hopefully you get the point.) Reactivity just serves as a nice binding paradigm.
- 1egg0myegg0 4y agoHowdy! What are the rough edges when persisting to a server? What are the gaps relative to something like PouchDB?
- jamesgpearce 4y agoHonestly, just my personal confidence currently. There's very basic locking and store-wide read-write. I really aspire to some sort of CRDT implementation that can be considered a bit more state-of-the-art and tolerant to the innumerable challenges of that problem.
- mfbx9da4 4y agoI think that CRDT and OTs are a bit overkill for TinyBase. Most apps are not text editors or figma. Most apps are just forms. The general solution for forms is to track which fields on a record have been modified by the user. The user’s change is the source truth and never gets overwritten by the network. Other fields are free to be updated collaboratively from the network. Once the user has synced that field it is free to be updated by the network. This kind of solution can be built on top of TinyBase without CRDTs.
- fillest 4y agoThe font is unreadable, very thin
- jzcoder 4y agoI immediately close a page dense in text and using a thin font like Lato or Raleway.
- modzu 4y agoim never happy no matter what i do
- julienreszka 4y agoI agree.
- j-bos 4y agoI like the thin font on mobile.
- fillest 4y agoOn mobile it is indeed at least not blurry but still harder to read..
- jamesgpearce 4y agoOuch, tough crowd, but fair enough! I wonder if I should have a font-weight (or -family) toggle alongside the dark mode setting. Would be a shame for people to miss out on reading about the software because of the typography!
- klabb3 4y ago> Ouch, tough crowd Meta: hacker news is known for this, but it's really not personal (modulo very few mean folks). People have an adversarial mindset and will poke holes in everything, even things that are awesome. If the biggest critique against your project is the font (superficial) you can interpret is as an absence of more fundamental criticism. Fonts and fancy looking things in particular tend to be critizised extra hard if it interferes with accessibility or scroll (scroll jacking comes with capital punishment in the hacker news universe). If you want 0 critique the safest option is #000 Times New Roman on #fff background. Then you will please the hacker news zeitgeist (at the expense of everyone else).
- mfbx9da4 4y agoWait so can you actually connect tiny base to SQLite?
- jamesgpearce 4y agoNo, there's no _actual_ RDBMS involved. The query engine uses a functional style of query that has similar concepts to SQL, but all the evaluation (and reactivity) is first party, in the library itself. Of course it would be pretty easy/fun to persist your TinyBase content into a SQLite database, or pull a dataset from it. The demos load up TSV but you could easily do something similar from an actual database somewhere.
- mfbx9da4 4y agoIf I understand correctly the issue with storing and retrieving from SQLite is that it won’t be incremental?
- jamesgpearce 4y agoIt could be made to be. The current persistence implementations are all batch but I believe they could be row, or even cell-level, theoretically. Nice idea.
- mfbx9da4 4y agoThe main limitation I see with tiny base is that it has to load all data in one batch and modifying any record results in the whole data store being persisted to disk. Surely this can’t scale well…
- jamesgpearce 4y agoThe data is in memory, and the persistence strategy is kind of up to you. So it would scale reasonably if you put the sync/persist on a different schedule to the UI - perhaps when the browser is idle. BUT of course, this is not a library to be used with data sets of billions of rows! I'd recommend a proper RDBMS for that ;)
- mfbx9da4 4y agoYeah but I feel like it could be used for that, if only retrieval and storage could be done incrementally…
- mfbx9da4 4y agoYou’re 80% of the way there now that you have encoded SQL-like syntax now all you have to do is to translate that into raw SQL queries to be executed
- jamesgpearce 4y agoCorrect. I think this could be done, but I would need to think a little about how best to. Thank you for the idea!
- mfbx9da4 4y agoMy pleasure, happy to discuss how to architect if there’s a discord / GitHub issue. I know for a fact the react native community are pining for this.
- mfbx9da4 4y agoThis is how I see it could work: * Queries are encoded into sql and matcher functions * Whenever data is mutated a change set is emitted - eg similar to immer * This change set is used to generate SQL UPDATE statements * The change set is also sent to matcher functions, the matcher functions update the query results accordingly
- dreadlordbone 4y agoYou should set your scroll bars to auto (where needed) for us Windows users who see scrollbars: https://imgur.com/a/N6ee848 https://imgur.com/a/N6ee848
- meotimdihia 4y agoDid you use this package in your projects?