课程: Databases for Node.js Developers

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Using MySQL for our users and orders

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…

内容