Book Image

Supercharging Node.js Applications with Sequelize

By : Daniel Durante
4 (1)
Book Image

Supercharging Node.js Applications with Sequelize

4 (1)
By: Daniel Durante

Overview of this book

Continuous changes in business requirements can make it difficult for programmers to organize business logic into database models, which turns out to be an expensive operation as changes to the database may result in errors and incongruity within applications. Supercharging Node.js Applications with Sequelize helps you get to grips with Sequelize, a reliable ORM that enables you to alleviate these issues in your database and applications. With Sequelize, you'll no longer need to store information in flat files or memory. This book takes a hands-on approach to implementation and associated methodologies for your database that will have you up and running in no time. You'll learn how to configure Sequelize for your Node.js application properly, develop a better sense of understanding of how this ORM works, and find out how to manage your database from Node.js using Sequelize. Finally, you'll be able to use Sequelize as the database driver for building your application from scratch. By the end of this Node.js book, you'll be able to configure, build, store, retrieve, validate, and associate your data from a database to a Node.js application.
Table of Contents (16 chapters)
1
Part 1 – Installation, Configuration, and the Basics
4
Part 2 – Validating, Customizing, and Associating Your Data
10
Part 3 – Advanced Queries, Using Adapters, and Logging Queries

Introduction to Sequelize and ORM in Node.js

Managing database drivers, managing schematics, maintaining a business’ workflow, and validating data can be daunting for any programmer. Along with perpetually changing business requirements, organizing the business logic into database models can be cumbersome. This usually entails the programmer finding all applicable references and updating queries manually. This could be an expensive operation for both the project and the programmer; without proper testing, the modifications could result in errors within the application or erroneous logic, leaving the programmer, the business, and the customer in a state of confusion.

This book will help guide you through the process of installing, building, maintaining, upgrading, extending, querying, and applying database schematics using an object-relational mapping (ORM) framework in a Node.js application using the Node.js runtime environment. The book can be read from start to finish in a sequential manner, or if you are more experienced, you can read the chapters that interest you directly. Each chapter complements the previous chapter since we will be creating an entire application from scratch. However, more experienced programmers can skip between chapters with the understanding that there may be “gaps” within their data model and what is shown within the chapter. The concepts and methodologies taught in each chapter, regardless of your data’s structure, will still be applicable.

The goal of this chapter is to help you become familiar with what Sequelize is and which capabilities are offered to you from using Sequelize. We will go over the necessary prerequisite steps for installing applicable libraries, frameworks, runtime engines, and database management systems (DBMS). By the end of this chapter, you will have acquired the knowledge and skillset of installing, configuring, and running an application, under the Node.js runtime with Sequelize, from scratch.

The first chapter of this book will cover the following topics:

  • Introducing Sequelize
  • Advantages of using Sequelize over other alternatives
  • Installing the necessary applications, frameworks, and tools to help get you started
  • Configuring Sequelize within an Express application