Live data from Hacker News

Supabase (YC S20) – An open source Firebase alternative

supabase.io

251–260 of 374 posts

Re: Supabase (YC S20) – An open source Firebase alternative

#251
post #229

Earlier quoted context omitted.

Who does the same app over and over, and if then why not just copy it? With new tech there are a lot of churn, who knows Google will announce the shutdown of the db service tommorow, and next week you need to rewrite the app in the latest version of the framework. Meanwhile old boring tech will still work just fine 20 years from now.

I can't copy code I wrote at the previous employer. It's best to learn and stick to a framework, or write something yourself once you can steal from. I'm doing the latter with code generation.

Modern programmers don't get paid to write down the code per say, you both write code as well as do the engineering part. Or maybe if you are using a framework you are just typing code? I dunno. But if you have already solved a problem, it will take significantly less time to re-write, and you could probably make it better too as you know the weakness of the old implementation.

Re: Supabase (YC S20) – An open source Firebase alternative

#252

Earlier quoted context omitted.

To me there's a sliding scale between productivity, where you use a heavy framework like Django and Rails to do everything for you, and control, where you write boilerplate to stitch all your favorite single-purpose libraries together using your preferred patterns. They each have their purposes. Django will get you to market fast with all the features you need, and keep you there for a long time. But it forces (throu…

Can you provide a more detailed critique of Django’s “Fat Models” recommendation? How would you prefer to manage this logic?

TL;DR Django models are the database, which makes them the wrong choice for presenting a service-layer interface to the persistence. They are inherently unable to hide, encapsulate, and protect implementation details from consumer that don't care or shouldn't be allowed to access.

The Django model is a representation of the database state. It's an infrastructure-layer object. It's is _very_ tightly coupled to the database.

Your business needs should not be so coupled to the database! While it is very helpful for an RDB to accurately model your data, a database is not an application. They have different jobs.

(The TL;DR of the following paragraph is "encapsulation and interfaces") Your business logic belongs in the "service layer" or "use case layer". The service layer presents a consistent interface to the rest of the application - whether that is a Kafka producer, the HTTP API views, another service, whatever. Your service layer has sensible, human-understandable methods like "register user" "associate device with user", whatever. These methods are going to contain business logic that often needs to be applied _before_ a database model ever exists, or apply a bunch of business logic after existing models are retrieved in order to present a nice, usable, uncluttered return value. Your service layer hides ugly or unnecessary details of the database state from the rest of the application. Consumers shouldn't care about these details, they shouldn't rely on them (so you can fix or change without breaking the interface) , and they very probably should not be presented direct access to edit whatever they want.

If you do not do this and instead choose the fat models method all of the following will happen:

1. You will repeatedly write that business logic everywhere where you use the models. You'll write it in your serializers, your API views, your queue consumers/producers, etc. You'll never write it the same way twice and you damn sure won't test it everywhere.

2. You'll get tired of writing the same thing and you will add properties or methods on the model. This is the Fat Model! This might be appropriate for convenience property or two that calculates something or decides a flag from the state of the model, but that's it. As soon as you start reaching across domains and implementing something like "register device for user" on the user model, or the device model, you are just reinventing a service layer in a crappy way that will eventually make your model definition 4000 lines long (not even remotely an exaggeration).

3. Every corner of your application will be updating the database - via the model - however it wants. They will rely on it! Whole features will be built on it! Now when it's time to deprecate that database field or implement a new approach, too bad. 20 different parts of your app are built on the assumption that any arbitrary database update allowed by the model is valid and a-ok.

Preferred approach:

1. Each domain gets a service layer, which contains business logic, but also presents an nice reliable interface to anything else that might consume that domain. This interface includes raising business logic errors that mean something related to our business logic. It does not expose "Django.models.DoesNotExist" or "MultipleObjectsReturned". It returns an error that tells the service consumer what went wrong or what they did wrong.

2. The service layer is the only thing that accesses or sees the Django models aka the database state. It completely hides the Django models for its domain from the rest of the application. It returns dataclasses or attrs, or whatever you want to use. The models are no longer running rampant all over the application getting updated and saved willy nilly. The service layer controls what the consumers in the rest of the application can know and do.

You will write more boilerplate. It will be boring. You will write more tests. It will be boring. But it will be reliable and modular and easier to reason about, and you can deliver features and changes faster and with much less fear of breakage.

Your business logic will live one place, completely decoupled, and it can be tested alone with everything else mocked.

How your consumers (like API views)turn service responses and errors into external (like HTTP) responses and errors, lives in one place, completely decoupled, and can be tested alone with everything else mocked.

Your models will not need to be tested because they are just a Django model. They don't do anything that's not already 100% tested and promised by the Django framework.

Re: Supabase (YC S20) – An open source Firebase alternative

#253
post #251

Earlier quoted context omitted.

I can't copy code I wrote at the previous employer. It's best to learn and stick to a framework, or write something yourself once you can steal from. I'm doing the latter with code generation.

Modern programmers don't get paid to write down the code per say, you both write code as well as do the engineering part. Or maybe if you are using a framework you are just typing code? I dunno. But if you have already solved a problem, it will take significantly less time to re-write, and you could probably make it better too as you know the weakness of the old implementation.

Until you forget it again. I'd like to never worry about the boilerplate class of problems again (CRUD, auth, auditing, filtering, pagination, etc.). That's what I'm working toward.

Re: Supabase (YC S20) – An open source Firebase alternative

#254

Earlier quoted context omitted.

I've seen this sentiment echoed a few times. What are the advantages, or class of advantages, you get by moving on from Firebase to something stronger/harder?

I’m very junior, so take what I say with a grain of salt. But when I was determining if I should use Firebase or not, my biggest hesitation was simply that if Firebase ended today, I have to completely transition my application’s architecture. Though that is unrealistic, even thinking about it was enough to make me want to be in full control of my application’s various layers.

This is not a junior consideration and it's not unrealistic that firebase ends in say, the next 60 days which in terms of porting your entire application is essentially today. You're right to weigh this as a concern in evaluating approaches and everyone should, regardless of experience.

All PaaS providers work hard to couple you to their platform not (necessarily) for nefarious reasons, but because that's how abstractions work. You need to be continuously vigilant and aware of when and how you are tied, do a cost/benefit analysis and have risk mitigations for things like your original thought, so good for you.

Re: Supabase (YC S20) – An open source Firebase alternative

#256
post #183

To be a Firebase alternative, you would expect a full-stack solution; DB, Auth, Cloud Functions, Analytics...etc. That's the main selling point of Firebase. This just seems to be an Open-Source implementation of Firebase's " Realtime Database ", which is kind of superseded by the new " Firestore ", which is much more popular. However it's a smart business move, as many products are locked into the " Realtime Database…

That's true. See my comments here: https://news.ycombinator.com/item?id=23320443 tldr: > We've been building furiously since January but (not surprisingly) we haven't yet reached feature parity. But we will :)

Feature parity with Amazon Firebase?

Let me assess this, with the tip of my napkin:

1. linkedin 'firebase' + amazon (current employer) -> 695 people.

2. 10% of above = 70 FTE

3. They started (googled): They founded Firebase as a separate company in September 2011 and it launched to the public in April 2012.

1+2+3 = It's impossible you will have feature parity in next 10 years.

BUT it's possible you can achieve pareto parity, leaving off the table most complicated 20%. Good luck :)

Re: Supabase (YC S20) – An open source Firebase alternative

#257
post #140

There is a database management company called Superbase, the names are confusingly similar. I read a bit perplexed about Superbase being a YC company. https://www.superbase.com

There's also a Nicki Minaj song called Super Bass, although i admit that is less likely to get confused with either of them: https://www.youtube.com/watch?v=4JipHEz53sU

Re: Supabase (YC S20) – An open source Firebase alternative

#258

Congrats, the project looks solid. It's obviously targeted to JS devs who are familiar with firebase or want an easy/similar abstraction for realtime apps. It's great to have several great frameworks tackling the same problem with different flavours (Hasura, Phoenix, Supabase, etc), all with postgres as first class citizen. I feel like the key is in the choice for the realtime backend (Phoenix/Elixir). I've built rea…

Realtime is definitely our strongest feature so right now. We started Supabase to solve a problem at our previous startup, where we built a chat application using Firebase. Within a few months we discovered our customers were receiving their chats out-of-order and it took another few more days to figure out it was due to some Firebase quirks.

We migrated to Postgres and started with Triggers/NOTIFY. But that also has some limitations (8000 byte payload limit), so we implemented the Elixir server: https://github.com/supabase/realtime

Re: Supabase (YC S20) – An open source Firebase alternative

#259
post #250

Earlier quoted context omitted.

Just this year, Google/firebase has dropped their flat monthly fee plan which increased the spark plans limits. Just this week cloud functions have been removed from the free spark plan, which will break a lot of peoples apps. These decisions are alienating to me. I've been working on migrating my heroku mern stack app to firebase but now I'm having serious second thoughts. I was initially attracted by the free and f…

Wow, did not know they dropped cloud functions from the free tier, but don't you get a free usage tier as long as you provide a credit card?

firebaser here

Both are indeed correct: you must now provide a credit card to use Cloud Functions, and you do get a free tier on the Blaze plan.

In fact, the Blaze plan comes with a free tier that is bigger than the limit of the free plan was, but you can no longer use it without entering a credit card.

This change came while adding support for newer node.js versions. Cloud Functions now uses Cloud Build to create its containers, and while Cloud Build does offer a free tier, you'll have to enter a credit card to use it.

Re: Supabase (YC S20) – An open source Firebase alternative

#260
The biggest feature I will be looking for in this is a true push to android mobile devices. It looks like you can use the subscribe function for this, but I'd need an android example to get up and running quickly. Right now it seems like firebase is the only game in town for that functionality unless you want to roll your own with websockets or some sort of MQ. Google also strongly encourages use of firebase for that in the TOS in the play store I believe. I'm very excited to see how this progresses.

I also went right to the pricing page to see if you would charge for on-prem hosting, but looks like it is still TBD. I would like the ability to host everything on-prem. Security and encryption would be next on my list of wants after that.

Post reply on HN