Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison with Supabase #53

Open
klavinski opened this issue Jun 21, 2022 · 8 comments
Open

Comparison with Supabase #53

klavinski opened this issue Jun 21, 2022 · 8 comments

Comments

@klavinski
Copy link

Supabase is another bridge between Postgres and the front-end. How does Thin compare with Supabase? This is the main question preventing me from choosing Thin, as Supabase is more mature, popular, and has many features.

@mpscholten
Copy link
Member

Thin is a bit higher level in certain aspects. E.g. thin has a few simple database operations (createRecord, updateRecord, deleteRecord, query).

This higher-level layer e.g. allows us to support optimistic updates. Optimistic updates make the UX a lot better as we never need to wait for the server response.

Thin also focusses much more on the realtime aspects as this allows us simplify the state management a lot (e.g. a thin app typically doesn't need a redux store for storing database entities locally).

Then there's also small things: Thin transforms under_score column names to camelCase identifiers when a database record is sent to the client. In Supabase you have to deal with under_score identifiers a lot, which feels a bit dirty in JS land :)

Thin delivers really great autocompletion and end to end type safety.

TL;DR:

  • higher level API / more idiomatic
  • optimistic updates
  • more realtime
  • uses camel case for JS identifiers
  • end-to-end type safety

Maybe give both tools a try for a little example app and let me know what you like better

@klavinski
Copy link
Author

Thank you for the thorough answer! Supabase has announced offline support without progress for two years. What are Thin's plans for offline support?

@mpscholten
Copy link
Member

We might add offline support in the future, but it's not being worked on right now 👍

@klavinski
Copy link
Author

I tried Thin, and did not find a way to build joins in queries (Supabase allows it, as it is a wrapper over PostgREST). How to do it?

@mpscholten
Copy link
Member

Joins are not supported yet, but will definitely be added in the near future.

@gukii
Copy link

gukii commented Aug 19, 2022

Can you comment on how Thin does data caching?

@mpscholten
Copy link
Member

Mostly Thin doesn't do any kind of caching. It fetches the initial data, and then watches for changes on the result set.

For better UX when going forwards and backwards between pages, the useQuery hook caches the results of a query. Before the initial data is received from the server, the useQuery hook then might show some of the previously cached data. This only applies if the query is exactly the same as a previous query and is only visible for around 30 - 100ms (then typically the server data has arrived). And the main goal of that cache is to avoid loading spinners when going back between pages in an app.

@kingingcole
Copy link

I could not find pricing details on the website. What would it cost me to use Thin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants