hey hn, supabase ceo here the Val Town team were kind enough to share this article with me before they released it. Perhaps you know from previous HN threads that we take customer feedback very seriously. Hearing feedback like this is hard. Clearly the team at Val Town wanted Supabase to be great and we didn’t meet their expectations. For me personally, that hurts. A few quick comments 1. Modifying the database in pr…
Migrating from Supabase
91–100 of 136 posts
Re: Migrating from Supabase
#92Amazed they used scp instead of rsync
Re: Migrating from Supabase
#93hey hn, supabase ceo here the Val Town team were kind enough to share this article with me before they released it. Perhaps you know from previous HN threads that we take customer feedback very seriously. Hearing feedback like this is hard. Clearly the team at Val Town wanted Supabase to be great and we didn’t meet their expectations. For me personally, that hurts. A few quick comments 1. Modifying the database in pr…
Anyways, thank you. Supabase isn't perfect but it's pretty damn good.
Re: Migrating from Supabase
#94Earlier quoted context omitted.
> Row level security is their "foundational piece", but there is a reason why we moved away from database functions and application logic in database over a decade ago: that stuff in unmaintainable. Funny. In my experience, application-level authorization checks are very error-prone, easy to accidentally omit, and difficult to audit for correctness."Unmaintainable", I suppose. Whereas RLS gives you an understandable…
RLS is great, but it's not that hard to shoot yourself in the foot or miss stuff. E.g.: ALTER TABLE bookmarks ENABLE ROW LEVEL SECURITY; CREATE POLICY bookmarks_owner ON bookmarks USING (owner_id = auth.uid()); CREATE VIEW recent_bookmarks AS SELECT * FROM bookmarks ORDER BY created_at DESC LIMIT 5; The above may look fine at first glance, but recent_bookmarks actually bypasses RLS.
CREATE VIEW recent_bookmarks WITH (security_invoker=true) AS
SELECT * FROM bookmarks ORDER BY created_at DESC LIMIT 5;
Point taken though, it's not the default behavior.Re: Migrating from Supabase
#95How do people on HN like Row Level Security? Is it a better way to handle multi-tenant in a cloud SaaS app vs `WHERE` clauses in SQL? Worse? Nicer in theory but less maintainable in practice? fwiw, Prisma has a guide on how to do RLS with it's client. While the original issue[0] remains open they have example code[1] with the client using client extensions[2]. I was going to try it out and see how it felt. [0]: https…
I use a database that supports unlimited databases, tables, and views. Makes it easy to separate tenants.
Re: Migrating from Supabase
#96Earlier quoted context omitted.
(supabase ceo) To give context, Val Town have a particularly write-heavy setup, storing a lot of json strings. The nightly backups were causing write-contention, even at their relatively small size. We didn’t detect errors because they were application-level. We should have moved them to PITR as soon as they mentioned it since the timing was so obviously coinciding with backups. We’re investigating moving everyone to…
how does a backup cause write contention? are you backing up to the same disk? also why are backups using pg_dump? that’s not a backup.
Re: Migrating from Supabase
#97Re: Migrating from Supabase
#98Earlier quoted context omitted.
RLS is great, but it's not that hard to shoot yourself in the foot or miss stuff. E.g.: ALTER TABLE bookmarks ENABLE ROW LEVEL SECURITY; CREATE POLICY bookmarks_owner ON bookmarks USING (owner_id = auth.uid()); CREATE VIEW recent_bookmarks AS SELECT * FROM bookmarks ORDER BY created_at DESC LIMIT 5; The above may look fine at first glance, but recent_bookmarks actually bypasses RLS.
For that there's security invoker now: CREATE VIEW recent_bookmarks WITH (security_invoker=true) AS SELECT * FROM bookmarks ORDER BY created_at DESC LIMIT 5; Point taken though, it's not the default behavior.
Thanks for all your work on PostgREST, Steve! Do you think we'll see relational inserts in the near future, or is that still a bit down the road?
Re: Migrating from Supabase
#99Earlier quoted context omitted.
The main issue we've had with it is that it's just plain slow for a lot of use cases, because Postgres will check the security for all rows before filtering on the joins, doing anything with WHERE clauses, doing anything to even tentatively take LIMIT into account, etc. Imagine a 1-million-row table and a query with `WHERE x=y` that should result in about 100 rows. Postres will do RLS checks on the full 1 million row…
> because Postgres will check the security for all rows before filtering on the joins, doing anything with WHERE clauses, doing anything to even tentatively take LIMIT into account, etc. Note that the above only happens for non-inlinable[1] functions used inside RLS policies. Going from what you mentioned below, it seems your main problem are SECURITY DEFINER functions, which aren't inlinable. It's possible to avoid…