from Hacker News

Supabase Vault

by traviskuhl on 8/20/22, 2:31 PM with 70 comments

  • by zaroth on 8/20/22, 4:26 PM

    One thing I think missing from this write-up is to walk through how the Restore process will work with encrypted data under pgsodium.

    Namely what will happen when you first restore some data into a new Postgres instance which booted with its own randomly generated root key (the wrong key) and then how you are supposed to patch in the correct key and be able to start reading secrets again?

    Also, how does the decrypted view look if you try to read it with the wrong key loaded?

    Do you have to worry about a race condition where you boot an instance with some encrypted data but forget to put the key file in place, and then end up with a new random key, saving some new data, and now you have a mix of rows encrypted with two different keys? Or will the whole subsystem block if there’s data stored that can’t be decrypted with the resident key?

  • by brap on 8/20/22, 6:03 PM

    I’m really impressed with everything Supabase does, but… They market themselves as the “open source alternative to Firebase”. Which is great, mainly because you don’t have to worry about vendor lock-in (to an extent).

    Yet one of the main selling points of Firebase (at least in my humble opinion) is that you don’t have to concern yourself at all with implementation details and stuff like that. The learning curve is small, you get a database without having to think about databases.

    Yet everything I read about Supabase is heavily centered around Postgres, it seems like you really need to know the ins and outs of the database. I wouldn’t really feel comfortable adopting Supabase without taking a class in Postgres first.

    I’m wondering if Supabase plans to stay “low level” or give a higher level of abstraction to those who want it.

    Edit: just want to clarify, I’m not saying “sql bad”, I’m saying there’s a not-so-small market (mostly beginners) who would see this as a big adoption barrier, which I think is understandable. I don’t know if Supabase wants to (or even should) cater to both markets.

  • by jackconsidine on 8/20/22, 7:39 PM

    I'm so excited for Supabase. As soon as they move Realtime Subscriptions out of alpha / beta, I will replace Firebase on all new projects. The Firebase / Firestore analog - Snapshot Listeners - give your application a real-time backend for free and simplifies state management drastically since your subscriptions are your store.

    Supabase being built on SQL is interesting to me- I love PSQL and the row-level security rules are incredible. But the historical SQL v NoSQL debate involves the trade-offs of Consistency, Availability, and Partition Tolerance [0]. With Firebase (and typically NoSQL) you lose Consistency and you get a bit of redundance by virtue of using onWrite listeners as opposed to Joins. That model scales really well since it's amenable to sharding seamlessly. What will scaling a Supabase backend look like?

    [0] https://www.bmc.com/blogs/cap-theorem/

  • by nicoburns on 8/20/22, 4:28 PM

    Hmm... I feel like secrets are the one thing I don't want to be in Postgres... because I want to store my Postgres credentials in the secrets vault! And I certainly don't want to have to update the configuration for every service which accesses my secrets vault every time I upgrade my Postgres database (and the access URL changes).

    IMO nobody's doing secret management for small companies / products particularly well, so there's definitely a niche to be filled here. But I'm not quite convinced this is it...

  • by tmd83 on 8/20/22, 5:41 PM

    What I don't understand (perhaps I haven't found the right docs to read) is how to safeguard the secret if a client machine of the secret is compromised. Say I have a web server that's connecting to the database and the database credential are stored in some separate value. If someone get's access to the web server machine can they not access the value from there?
  • by vbezhenar on 8/20/22, 5:13 PM

    Is there any solutions for postgres database encryption at rest (other than using OS-level encryption)?
  • by wizwit999 on 8/21/22, 5:52 AM

    Why put everything in your database?
  • by throwgawag1 on 8/20/22, 4:27 PM

    > Vault is a thin usability-layer on top of pgsodium.

    Cloudflare and Duck Duck Go also add a bunch of names to routine things that already exist. It's better to just not name it.