From the course: Databases for Node.js Developers

Unlock this course with a free trial

Join today to access over 24,400 courses taught by industry experts.

Using MySQL for our users and orders

Using MySQL for our users and orders - Node.js Tutorial

From the course: Databases for Node.js Developers

Using MySQL for our users and orders

- [Instructor] In this chapter, we are going to handle users and orders in our system using MySQL. Why are we using MySQL here? So we have structured data. Users and orders follow a clear structure with well-defined relationships. We want to maintain data integrity because we need to ensure that orders are always linked to valid users. And we also want to maintain asset compliance. This will become important when we later want to create an order. So in our application, we already have a section to manage users and also to manage orders. The order management as such will come then a little bit later in the process because we will need to have our shopping basket to finalize that, but we will at least create the schemas for that. And for these schemas, we will use Sequelize, which is an object-relational mapper, and ORMs, letters similar to ODMs like Mongoose, interact with the data base using JavaScript object instead of writing raw SQL queries. So by the end of this, we'll have a…

Contents