Live data from Hacker News

Supabase Local Dev: migrations, branching, and observability

supabase.com

51–57 of 57 posts

Re: Supabase Local Dev: migrations, branching, and observability

#51
post #3

Earlier quoted context omitted.

Thank you so much for taking the initiative to learn and grow from that experience. My team is in the fledging stages of using Supabase to rebuild a mission-critical application for our company. We were initially disappointed with what we found in terms of CI/CD and local development but we liked Supabase enough for other reasons to keep moving forward with it. I'm really glad we did because I think this has the pote…

> I get the impression that you're making really good calls as it relates to your roadmap we receive feedback from a lot of channels so it's often hard to figure out what to build. In the early days it was about reaching feature-parity with other tools. now we have a bit more breathing-room to focus on "day 2" problems. I think our team is excited about this phase since it means we get an opportunity to build somethi…

[dead]

Re: Supabase Local Dev: migrations, branching, and observability

#52

Earlier quoted context omitted.

> if your latest migration is destructive - you want to seed data and then run the next migration. We have added supabase migration up [0] command that runs only pending migrations (ie. those that don't exist in local db's migration history table). You can use that to test destructive migration locally with data from seed.sql. After testing, you want to update your seed.sql with a data-only dump [1] from your local d…

Thanks, appreciate this. A few comments: I like being able to call supabase db dump (data only) and not touch code in the file at all - I get that adding SET session_replication_role = replica; is one line, but still my preference is to avoid. But like I said I already disable triggers ahead of the seed script running. I currently use supabase db reset quite frequently as I make changes in development. Using supabase…

Thank you for the helpful feedback.

> Using supabase migration up would mean moving the latest migration out of the migrations folder, running supabase db reset, moving the file back in and then calling supabase migration up.

We can definitely do a better job here. I'm adding support for db reset --version flag [0]. This should allow you run migration up without moving files around directories.

> I wasn't really sure what the actual outcome would look like If I have something like this in a migration script

Agree that we can do a better job with the documentation for squash command. I will add more examples.

The current implementation does a schema only dump from the local database, created by running local migration files. Any insert statements will be excluded from the dump. I believe this is not the correct behaviour so I've filed a bug [1] to fix in the next stable release.

[0] https://github.com/supabase/cli/pull/1369

[1] https://github.com/supabase/cli/issues/1370

Re: Supabase Local Dev: migrations, branching, and observability

#53

hey hn, supabase ceo here a few months ago one of customers migrated away from supabase and they wrote a blog post about it. That blog post appeared here[0] on hacker news. many of the issues they encountered were related to local development. we made several promises to improve based on that feedback and the various comments in the HN thread today’s launch delivers on many of those promises. We’ve added better suppo…

[deleted]

Re: Supabase Local Dev: migrations, branching, and observability

#54
post #47
post #38

Earlier quoted context omitted.

100% agree... I've been using super base for a new project for a few months and while overall I'm impressed, there are just too many bugs and partially rolled out features. Here's my current gripe list: - features/ui missing from local development - more secure triggering of edge functions from database (currently have to hardcode key in SQL) - template URL support for edge function - source maps are broken in edge f…

Hey @cjonas, I'm a developer on Supabase Edge Functions team. We do have plans to improve the current database trigger behavior. Will share more updates on this in the coming months. Can you explain what do you mean by template URLs? Do you mean route params like `/v1/functions/users/:id`? If so, you can use a framework like Oak[1] to handle them. Edge Functions will make the full path including querystring available…

> We do have plans to improve the current database trigger behavior. Will share more updates on this in the coming months.

Excited to hear more! Being able to trigger functions from DB & cron triggers without having to hardcode a secret (which causes them to end up in migrations files) will be a huge improvement.

> Can you explain what do you mean by template URLs?

Oh, I had no idea that the functions routes were "wild card"! I don't think that's mentioned anywhere in the documentation, btw.

> Source maps, is it broken during local dev or when you deploy the function?

Sorry, I actually mean "import-maps": https://github.com/supabase/cli/issues/1338

"Source maps" (does deno actually use source maps?) ARE broken as well. EG: The line numbers in runtime don't line up with the function code in the IDE or even that is in the docker volume.

Re: Supabase Local Dev: migrations, branching, and observability

#55
post #35

Earlier quoted context omitted.

I'm not the GP. Unrelated to DBs, I've been thinking about trying to roll my own system for magic links recently. Even though Supabase has some of the lowest costs for MAUs, they're still too high if you're only using magic links, especially considering the related email rate limits [1]. I don't even know if I'm reading that right. Is it 4 auth related emails per hour by default? I can run a Cloudflare Worker for $0.…

> Is it 4 auth related emails per hour by default? It's unlimited emails per hour, as long as you BYO SMTP provider. The default email service is only for testing, and not recommended for production. I usually recommen AWS SES or Resend[0] for unlimited emails > This isn't just a Supabase issue either. The entire auth industry is similar. Agreed - the industry prices on MAU, which isn't a great heuristic. for social…

> There are a lot of other things that you're _not_ paying for which we have to price in - regular security audits, zero-day support, etc.

Yeah. I was hesitant to toss examples of actual costs in there because I knew it wasn't really a fair comparison, but I wanted to try to make my point even though I don't have the ability to calculate the real costs.

If I had to sum it up in a way that translates into a good strategy for building mutually beneficial relationships, I'd say "don't profit off my losses". I want a partner like relationship, but the only thing anyone is currently offering is for me to be a customer. I have to make all the predictions on conversion rates, etc., so I'm taking all the risk while the platform owner (ie: you) makes a (high-margin) profit off every user I have, regardless of whether or not I'm generating revenue from that user.

> for social websites, 1M users might be a low number. For B2B SaaS even 1,000 MAU could be high

I would say it makes sense to bucket users into categories and split the feature set accordingly. I think that's what Firebase does [1A]. I think basic login types (magic links, password, social) are free and you only pay for users that need their identity platform.

However, there are a few problems with Firebase IMO. First, I don't like "free". It means my costs aren't realistic and I need to assess the risk of that offering disappearing. IMHO that's just another layer of complexity and risk and I'd rather pay fair value from the start. The second problem with Firebase is that it's going to take a decade of culture change at Google for me to trust any of their products, especially something that's "free".

Back to Supabase, what do you do if you want to add a significant feature that makes the current auth pricing unsustainable? Do you increase the price a tiny bit? What if I have a million free users and don't need that feature for them?

> and we're an order of magnitude cheaper than other Auth providers

This is a little unfair on my part because I don't know the true costs, but if that means you're only charging me 100x the underlying costs vs everyone else charging 1000x, that doesn't make it good value for me, does it?

I'd rather categorize my users and pay accordingly. I know this may not be realistic in terms of creating too many SKUs, but just to make the point (from my perspective)...

1. Free users get magic links. Pricing should be tied to real costs and be commodity like. Minimal cost (to me) is important. Long term, stable, predictable pricing is important. This comes out of my pocket, so I don't want you having a large margin on it and I don't want it fluctuating because small changes can have a large impact on me if I have a lot of free users.

2. Convertible users get passwords, social logins, TOTP, security keys, etc.. Basically they get anything that doesn't have external costs (to you). I'd be willing to subsidize these a bit, but not anything crazy.

3. Paying users get SMS, etc.. Basically they get things that have external costs (to you). I'd pay a large premium for these users and I'd be willing to take on all the external costs in addition to that premium (ex: I pay for all SMS costs).

4. B2B users get any B2B features and my (inexperienced) opinion is they fall into a category where the cost (to me) doesn't matter much.

The other thing that I don't like about having a uniform cost per user is that I know the cost per user isn't uniform and, if my costs aren't a function of your costs, that means you're taking on some risk in the prices you've set. What if your overall prices are too low even though my specific usage is already profitable? Do I have to endure a price increase?

Again, this is uninformed because I don't have a decent knowledge of the true costs, but for my use case (magic links only, bring your own email) the prices feel 100x too expensive, but for a B2B use case they feel 100x too cheap.

I'm sure it's difficult to accommodate all use cases in a way that makes everyone happy, so hopefully my perspective is useful feedback.

1A. https://github.com/255kb/stack-on-a-budget/blob/master/pages...

Re: Supabase Local Dev: migrations, branching, and observability

#56
post #54
post #47

Earlier quoted context omitted.

Hey @cjonas, I'm a developer on Supabase Edge Functions team. We do have plans to improve the current database trigger behavior. Will share more updates on this in the coming months. Can you explain what do you mean by template URLs? Do you mean route params like `/v1/functions/users/:id`? If so, you can use a framework like Oak[1] to handle them. Edge Functions will make the full path including querystring available…

> We do have plans to improve the current database trigger behavior. Will share more updates on this in the coming months. Excited to hear more! Being able to trigger functions from DB & cron triggers without having to hardcode a secret (which causes them to end up in migrations files) will be a huge improvement. > Can you explain what do you mean by template URLs? Oh, I had no idea that the functions routes were "wi…

> Oh, I had no idea that the functions routes were "wild card"! I don't think that's mentioned anywhere in the documentation, btw.

Good point! will update the docs.

> Sorry, I actually mean "import-maps": https://github.com/supabase/cli/issues/1338

I'll take a look at this issue. We've improved import map resolution in the last couple of CLI releases. But it looks like there are more edge cases.

Re: Supabase Local Dev: migrations, branching, and observability

#57
post #55

Earlier quoted context omitted.

> Is it 4 auth related emails per hour by default? It's unlimited emails per hour, as long as you BYO SMTP provider. The default email service is only for testing, and not recommended for production. I usually recommen AWS SES or Resend[0] for unlimited emails > This isn't just a Supabase issue either. The entire auth industry is similar. Agreed - the industry prices on MAU, which isn't a great heuristic. for social…

> There are a lot of other things that you're _not_ paying for which we have to price in - regular security audits, zero-day support, etc. Yeah. I was hesitant to toss examples of actual costs in there because I knew it wasn't really a fair comparison, but I wanted to try to make my point even though I don't have the ability to calculate the real costs. If I had to sum it up in a way that translates into a good strat…

I just want to share that this is a great write-up. I'm in the middle of Launch Week, so I don't have a lot of head-space to digest it all, but I promise I'll come back to this and give it the time it deserves next week.
Post reply on HN