

Now that we extracted the different database entities, we can extract the different relationships between them: What are the relationships between these entities? Articles: they have a title, body, and minutes of reading.Įach entity represents a database table.Users: they have a name, email, password (hash) and a profile picture URL.One way of looking at these requirements is to group them based on the following entities/atoms: What entities can we extract from these requirements? Each article can belong to one or many categories. Articles can be organized into categories.An article can also have one or many authors. A user can write one or many articles.It's also important to keep track of when an article is created or modified. Each article has a title, body, and minutes of reading.

It's also important to keep track of when a user account is created or modified. Each user has a name, email, password (hash) and a profile picture URL. Our blog requirements can be summarized in the following points: Therefore, the first step should be to clearly define our blog's requirements. The schema indicates how this usually designed prior to building the database in order to best fit the application's requirements. The database schema is the blueprint of how the database will be organized. Let's do this! 🎁 Gift: Here's a nice Spotify playlist to listen to while doing this. How to use the Sequelize ORM to perform migrations, seeds, and queries on the database. What an ORM is and what makes it better than using direct SQL queries.How to visualize & interact with the database with pgAdmin.How to quickly create a Postgres database based on that schema with 1 command. What a database schema is and how to design it.Just by targeting that goal, we will learn: We have 1 goal: set up a production-ready NodeJS backend for a blog. You might want to find a nice place to sit for an hour and follow the tutorial.

Notice: Before you jump in and start reading, it's important to understand that this is not a tutorial you'd read while sitting in public transportation or on your toilet seat.
