How to Understand Your Ruby on Rails Database Schema Using Nabubit
Published on Sep 13, 2024
Last updated on Sep 16, 2024
In Ruby on Rails applications, the schema.rb file acts as a representation of your database schema in Ruby code.
We're going to load the schema of Maybe.co, a Rails open-source personal finance app, and use Nabubit to understand how the database design is structured.
In the real world, this can be particularly useful when jumping into existing projects, as you need to get a bearing on how things work quickly because there are things to fix and features to add.
Let's get started!
We start by loading the db/schema.rb file into Nabubit.
After the the visual representation of our database has finished being built, let's start analyzing it. Here's a fullscreen view of all the tables. Nabubit groups the related tables closer together.
We can visualize all the fields in the tables and their relationships.
Ok, let's ask some questions about the database: like, how does it work?
We get a good overview about how the system is put together.
What about how the tables are related to each other?
These answers are a good start to grok how Maybe.co database is put together and there's much more you can do with Nabubit, go ahead and try it!
Happy Query-ing!