Live data from Hacker News

Show HN: InstantDB – A Modern Firebase

github.com

261–270 of 308 posts

Re: Show HN: InstantDB – A Modern Firebase

#264
post #171

Looks great! How is the migration story when schema changes are needed? How do you deal with old clients?

> Looks great! How is the migration story when schema changes are needed?

We have an admin API you can use to write migration scripts. The process is a bit manual though, and a more integrated solution is on the roadmap

> How do you deal with old clients?

Instant treats the the backend the source of truth. If there's an inconsistent cache, we drop the cache and fill it from scratch. We tend to write code that's backwards compatible, and suggest the GraphQL ethos: make sure when changing schema that active clients won't break

Re: Show HN: InstantDB – A Modern Firebase

#265

I'm curious if something like this would be good for multiplayer games?

We have basic example demonstrating how you can use Instant to make games [1] and a live iOS app built with Instant and React Native [2]

[1] https://www.instantdb.com/examples?#8-merge-tile-game

[2] https://github.com/jsventures/stroopwafel

Re: Show HN: InstantDB – A Modern Firebase

#266
post #199

Earlier quoted context omitted.

Exactly. I would really like an answer to this. I don't understand how you can even build something without support for this. They have a "Instant on the server" section in the docs but that's just about querying and writing to the database from an external server. Nothing about middlewares or whatever the solution would be.

Our permission system [1] can work like middleware. > Let's say I want moderation I am not 100% sure what you mean by moderation. There could be two ideas: Moderation 1: 'some people can see all posts, or delete other people's posts' You can write a rule that allows 'moderators' full access to chat, while, 'users' can only see the channels they blog too, and crud their own messages Moderation 2: 'I want to validate t…

Thank you for your response. While permissions sound like they can cover a lot of cases let's say I want to moderate with a list of banned words that are defined in a JSON or fetched from a service.

Ideally I would like exactly what you provide but be able to insert arbitrary server-side code that is run before the change is committed to the database.

I remember having the same "problem" with Firebase back in the day and ended up having to use a Cloud Function that listened on changes and updated records, but it was not a nice experience.

Re: Show HN: InstantDB – A Modern Firebase

#267
post #157
post #55

This looks great. We use our own version of something much more naive which allows for the various benefits you have (but yours does more). Ours is also based on Linear but we go all in on mobx like they do too. It’s a great model where we have optimistic updates and a natural object graph to work with in typescript. I’ll have a play with this to see if it could eventually be used as a replacement. Noticed in your do…

I didn’t clock the use of “triples” as the store on first read. That’s a non-starter for existing dbs and pretty much a dead end for anyone who eventually wants a db structure they can use outside of this model.

We are working on a Postgres adapter. If you have an existing app and would be interested in using Instant with it, please send us a note: founders@instantdb.com

The way the Postgres adapter would work: You give us your database url [1], and Instant handles the real-time sync. [2]

For roll-out, we'll test it ourselves first and then take on beta users.

[1] Encrypted at rest: https://github.com/instantdb/instant/blob/main/server/src/in...

[2] Here's a fun 'pg introspection' function: https://github.com/instantdb/instant/blob/main/server/src/in... . You can take sneak peak through codebase by searching 'byop'.

Re: Show HN: InstantDB – A Modern Firebase

#268

Earlier quoted context omitted.

Thanks for creating Firebase! It's really the definition of an managed database/datastore. Do you see InstantDB as a drop in replacement ? To be honest I don't want to have to worry about my backend. I want a place to effectively drop JSON docs and retract them later. This is more than enough for a hobbyist project, though I imagine at scale things get might not work as well.

For what it's worth, we designed Instant with this in mind. Schema is optional, and you can save JSON data into a column if you like. If you wanted to store documents, you could write: ``` useQuery({docs: {}}) // get documents transact(tx.docs[docId].update({someKey: someValue}); // update keys in a doc transact(tx.docs[docId].delete()) // delete the doc ```

Thanks for the response.

2 questions.

How hard is it to swap our firebase for instant? I've had an amazing time with firebase, but I sorta want to switch to using a completely local solution.

I have a small lyric video generator, and while I don't care about my own songs potentially leaking, I would never want to take responsibility for something else's data. I basically use firebase for the lyrics afterwards I transcribe them .

Second, do you offer your own auth or just integrate with other solutions.

Re: Show HN: InstantDB – A Modern Firebase

#269

Earlier quoted context omitted.

For what it's worth, we designed Instant with this in mind. Schema is optional, and you can save JSON data into a column if you like. If you wanted to store documents, you could write: ``` useQuery({docs: {}}) // get documents transact(tx.docs[docId].update({someKey: someValue}); // update keys in a doc transact(tx.docs[docId].delete()) // delete the doc ```

Thanks for the response. 2 questions. How hard is it to swap our firebase for instant? I've had an amazing time with firebase, but I sorta want to switch to using a completely local solution. I have a small lyric video generator, and while I don't care about my own songs potentially leaking, I would never want to take responsibility for something else's data. I basically use firebase for the lyrics afterwards I trans…

Glad I could be helpful.

> How hard is it to swap our firebase for instant? I've had an amazing time with firebase, but I sorta want to switch to using a completely local solution.

It should be relatively straightforward to switch. If you have any questions, you could always reach to us on Discord [1]

The only caveat though: Instant is like Firebase; it is not a completely local solution. If you are worried about exposing some data over the internet, I would store the same kind of stuff you were thinking about with Firebase.

> Second, do you offer your own auth or just integrate with other solutions.

We offer our own auth. You have magic code emails and Google Sign in out of the box. We also expose auth functions in admin SDK, in case you want to create a custom solution. [2]

[1] https://discord.com/invite/VU53p7uQcE [2] https://www.instantdb.com/docs/auth

Re: Show HN: InstantDB – A Modern Firebase

#270
post #266

Earlier quoted context omitted.

Our permission system [1] can work like middleware. > Let's say I want moderation I am not 100% sure what you mean by moderation. There could be two ideas: Moderation 1: 'some people can see all posts, or delete other people's posts' You can write a rule that allows 'moderators' full access to chat, while, 'users' can only see the channels they blog too, and crud their own messages Moderation 2: 'I want to validate t…

Thank you for your response. While permissions sound like they can cover a lot of cases let's say I want to moderate with a list of banned words that are defined in a JSON or fetched from a service. Ideally I would like exactly what you provide but be able to insert arbitrary server-side code that is run before the change is committed to the database. I remember having the same "problem" with Firebase back in the day…

That's a great point Kiro. Down the road, we could look into introducing a more turing complete language, which you could use before a transaction runs. We decided to go with CEL for the sandboxing benefits.
Post reply on HN