Live data from Hacker News

TinyBase v2.0: reactive data store for local-first apps

tinybase.org

31–40 of 65 posts

Re: TinyBase v2.0: reactive data store for local-first apps

#31

Earlier quoted context omitted.

Yeah but I feel like it could be used for that, if only retrieval and storage could be done incrementally…

Correct. I think this could be done, but I would need to think a little about how best to. Thank you for the idea!

My 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.

Re: TinyBase v2.0: reactive data store for local-first apps

#32
post #30

Personally built similar but incomplete solutions in my projects way more times that I’d like to admit. Could you elaborate on your roadmap on CRDT / real time collaboration? If it’s in plan and will be executed correctly I’m completely sold. Anyway, congrats, looks awesome.

I do not want to take on CRDT lightly, since I want to make sure it doesn't balloon the library - it'd probably be an optional module. I feel like that's one of the next big things to tackle, so does v3.0 sound good? :)

In the meantime try opening up the drawing demo (https://tinybase.org/demos/drawing/) in two or more (of the same) browser windows and move things around. This is just via local storage but imagine how cool it would be to have that across broader collaboration...

Re: TinyBase v2.0: reactive data store for local-first apps

#33
post #7

Earlier quoted context omitted.

The font is unreadable, very thin

Ouch, 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!

> 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).

Re: TinyBase v2.0: reactive data store for local-first apps

#34
Pretty cool. I do a lot of game dev and have searching for solutions like CastleDB but built in the NodeJS ecosystem. This looks like it could check a lot of boxes for me.

What I want is to be able to define my tables with something like JSON schema, and automatically have the typescript typings available when querying. The data would be serialised to Git friendly json, and there would also be support for different media types which get saved and organised in the local file system.

For me, a game developer who wants to be very hands on with bespoke tooling/editor functionality, I only want a simple foundational base, something along the lines of Airtable, with the workflow centred around Git.

Re: TinyBase v2.0: reactive data store for local-first apps

#35
I've been looking for something like this but sadly I can't use it because I can't rely on JS. I wish there was some decent local-first event based db that was language agnostic. Very few projects are reactive/streaming.

If anyone's interested my current workaround is piping JSONL between my processes (and into files) and it works pretty well, but lacks more advanced features.

Re: TinyBase v2.0: reactive data store for local-first apps

#36

Earlier quoted context omitted.

Howdy! What are the rough edges when persisting to a server? What are the gaps relative to something like PouchDB?

Honestly, 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.

I 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.

Re: TinyBase v2.0: reactive data store for local-first apps

#37
A comparison to PouchDB would make a great reference point to help people understand the use case. From what I can see in 2 mins of reading it looks like it's more relational which should be a plus, but then on the downside there's much less of a story on the sync side, with remote persistence ending at offering you interfaces to persist your data but not an actual data store that works. By comparison, PouchDB connected to a server side CouchDB makes an amazing combo.

I didn't have much trouble binding PouchDB into a Vue reactive data store so the reactive part didn't seem as novel to me. What does seem novel is supporting a proper relational schema for this, whereas all the other options I know in this space are schemaless / key-value type approaches.

I wonder if t might be a high-value / low effort proposition to come up with an out-of-the-box setup with something like PostgREST that would then work end to end? This was the super compelling part for me with the Pouch/Couch combo, as with a couple of configs and barely any code your browser localStorage is suddenly sync'd and saved remotely in real time which is mind blowing when you first experience it.

Re: TinyBase v2.0: reactive data store for local-first apps

#39
post #35

I've been looking for something like this but sadly I can't use it because I can't rely on JS. I wish there was some decent local-first event based db that was language agnostic. Very few projects are reactive/streaming. If anyone's interested my current workaround is piping JSONL between my processes (and into files) and it works pretty well, but lacks more advanced features.

I'm working on an embedded event based DB, on top of an embedded key value store. Nothing usable yet but happy to swap notes.

Re: TinyBase v2.0: reactive data store for local-first apps

#40
post #30

Personally built similar but incomplete solutions in my projects way more times that I’d like to admit. Could you elaborate on your roadmap on CRDT / real time collaboration? If it’s in plan and will be executed correctly I’m completely sold. Anyway, congrats, looks awesome.

I do not want to take on CRDT lightly, since I want to make sure it doesn't balloon the library - it'd probably be an optional module. I feel like that's one of the next big things to tackle, so does v3.0 sound good? :) In the meantime try opening up the drawing demo ( https://tinybase.org/demos/drawing/ ) in two or more (of the same) browser windows and move things around. This is just via local storage but imagine…

I’m my limited experience, a reliable CRDT implementation necessitates a CDRT-first design baked into the core of any data / transaction model. Like I’ve heard some game developers say- multiplayer needs to come first because tacking it onto a single player game is a nightmare.

I need to revisit the space soon. Hopefully I’m wrong because I think CRDTs will play an important role in the next generation of applications. A smooth on-ramp for existing apps would do wonders for adoption.

Post reply on HN