Database / Supabase Intermediate to Advanced Interview Questions
When should you use a JSONB column instead of creating additional relational tables?
JSONB makes sense when the data's shape is genuinely variable or unknown ahead of time — user-defined custom fields, a webhook payload from a third-party service, or app configuration that changes per customer — where forcing a fixed table structure would mean constant migrations just to add new fields.
It's a poor fit when the data has a stable, well-understood shape and you'll need to filter, join, or aggregate on individual fields frequently, since those operations are more efficient and more expressive against dedicated columns with proper types and indexes. A reasonable middle ground many teams use is normalizing the fields that are queried often and filterable, while keeping a JSONB column for genuinely miscellaneous or long-tail data that doesn't justify its own column.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
