

x
Kasun Vithanage
CTO/Co-Founder

About Me
- Co-Founder/CTO of WaveZync 🌊
- GSoC Mentor at Joomla! (2018)
- Interested in Functional Languages
- I ❤️ OpenSource
- I watch Anime


- All-in-One Platform for Data Analytics
- Data Analytics Courses
- Remote Code Execution 🔥
- Career Roadmaps
- 50,000+ students 🤯
- Makes learning fun

Alex Freberg
Founder of AnalystBuilder

Our Journey from

to

Quest for an Auth Provider

- We did not want to roll our own auth
- There were lot of existing auth providers
- Most of these providers were really
expensive when scaling - Firebase allowed integrating OAuth providers
without an additional cost - Firebase had a balanced pricing when
we started(around 2022)

But it was
not perfect
- Firebase was missing Linkedin as an OAuth
provider, which we wanted so bad - It was a pain for the user when linking
multiple identities with same email from
different providers - You are not allowed to customise certain
email templates(like signup confirmation) - Its quite heavy(on frontend)
But we decided
to
Keep it for launch!

Managed Databases

- We were using PostgreSQL(because its awesome 🙌)
- Our Infra is hosted on AWS EKS
- We were initially looking into AWS RDS for Managed DB
- It was really costly with connection pooler(pg-bouncer) 🤑
- AWS RDS has lot of pitfalls 😶🌫️

to rescue

- Reasonable pricing(25$ for starter) 😌
- Cloud Deployments
- We deployed it in same AWS cloud region as our
prod cluster
- We deployed it in same AWS cloud region as our
- Built in Connection Pooler 🤯
- Automated backups
- SQL Studio
- Lot of cool tools
Thats not Just DB
We get Auth as Well


We launched
the beta

Everything was fine
Until it wasn't

Firebase horror Stories
- We have integrated GitHub as OAuth
provider, for some of users it wasn't working - Terrible loading times
- People had trouble linking identities
- No way to observe auth audits or logs
- We had a problem with Email provider
and the only way was to guess what was it
- We had a problem with Email provider

We decided to move on

The Migration

- We were in a closed public beta with 7000 users
- Some of our apps were still using Firebase
- We wanted to have a seamless migration to
Supabase while keeping Firebase
Flexible DB Schema
Migrating Users
- We used a script provided by Supabase team
with few modifications to export users from
Firebase to a JSON file(with a modification) - Imported all users to Supabase Auth(its just SQL 😎)
-
Populated
user_providerstable with SQL - We decided to drop existing passwords and
requested beta users to reset their passwords - To be backward compatible we used a special header
x-auth-providerto use Supabase auth with firebase
auth
Good Bye

99% of login related
issues were resolved
with

- Blazing fast authentication 🚀
- More social providers(we enabled Linkedin) 🤟
- Automatically linking accounts with multiple
identity providers 🤯 - Free 50K MAUs 🎉
- Audit Logs 🤖
- Customisable Email Templates for all actions 🤩
- Better observability with Logs 📜
- ⬇️ Bundle Size
- Allowed us to write Analytical Queries
on auth data 📈

Everyone was Happy
Issues we faced with Supabase Auth
- Clock Skews
- We observed some customers logout immediately
after login 🙁 - The problem was their System Clock, which is
used by GoTrue(Supabase) to create tokens 💡 - Fixing system clock resolved the issue ⏱️
- Kudos to Supabase Support Team ❤️
- We observed some customers logout immediately
- Sometimes clearing cookies help 🍪
- Redirect on timeout could be better
- When this happen it redirect to the supabase api
route
- When this happen it redirect to the supabase api
But we are more
than
Happy

With Supabase
we reached 50K+

💡 for using Supabase
as your
Database

- Supabase act as a great Database Provider
- Supabase uses RLS(Row Level Security) to protect
data - By default your data is public for unauthenticated users who can query through generated REST/GraphQL APIs
- Supabase warns about this
- You may need to run few SQL queries to disable
access for anon key (https://shorturl.at/jOGmk) - I hope Supabase team will make this process easier
Conclusions
- Supabase helped AnalystBuilder to Scale Up ⬆️
- Reduced Costs 💰
- Allowed doing great stuff with their Postgres
based workflows ⚡️ - Lot of Good Stuff like Edge Functions 🤩
- Great community 😇
- Awesome support 🙌
Thank You

May The Postgres
Be With You


:end

Analyst Builder's Journey from Firebase to Supabase
By Kasun Vithanage
Analyst Builder's Journey from Firebase to Supabase
Analyst Builder's Journey from Firebase to Supabase
- 415
