Supercharging Node.js Applications with Sequelize

BIRMINGHAM—MUMBAI

Supercharging Node.js Applications with Sequelize

Copyright © 2022 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Associate Group Product Manager: Pavan Ramchandani

Publishing Product Manager: Kushal Dave

Senior Editor: Mark Dsouza

Content Development Editor: Divya Vijayan

Technical Editor: Simran Ali

Copy Editor: Safis Editing

Project Coordinator: Sonam Pandey

Proofreader: Safis Editing

Indexer: Pratik Shirodkar

Production Designer: Aparna Bhagat

Marketing Coordinator: Anamika Singh and Marylou De Mello

First published: October 2022

Production reference: 2061222

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

ISBN 978-1-80181-155-2

www.packt.com

To my parents, brother, family, and friends. To Audrey, for teaching me that not all stories have to be boring. To those who have built all of the libraries, frameworks, and applications for making this book possible.

– Daniel J. Durante

Foreword

Sequelize is a modern ORM that supports many different SQL dialects. Sequelize was born during the early days of the JavaScript runtime Node.js. It was the first of its kind, and was presented as a tool for the Node.js community to connect against existing relational databases, or to embrace them in new projects despite the rising trend of document stores. Ever since its release, a strong team of driven engineers added battle-tested support for transactions, relations, eager/lazy loading, read replication, and so much more. Twelve years on, the Sequelize project is part of npm’s top 100, and sees wide adoption by huge enterprises and small pet projects alike.

Daniel Durante joined the team in 2013 and contributed immensely to the library’s Postgres support by improving the general stability, but also via features such as HStore capabilities and pooling. Furthermore, and maybe most importantly, he was also the one behind the introduction of hooks and object lifecycles, which is now one of the core mechanics used to interact with data objects.

This book will guide you through all the steps of app development, starting with the very ideation of an app, to the modeling of entities and definition of business requirements, all the way to the implementation and deployment of a project. Throughout this journey you’ll learn how to grow a small pet project into a stable and scalable application that is free of unwanted side-effects, that caters for auditing of user actions, and can be easily extended going forward.

Enjoy your ride and welcome to the world of databases!

Sascha Depold

Author of Sequelize, Creator of bitte.kaufen and Engineering Manager at eBay

Contributors

About the author

Daniel Durante has nearly a decade of experience in creating Node.js applications with Sequelize. He is currently working on setting up applications and infrastructures for blockchain and options trading analysis. He has been working with Genesis Volatility for the last three years, and currently works as a chief technical officer.

I want to thank Sascha Depold for not only being a great programmer but also a great mentor and leader. Always willing to give insightful input and a hand wherever it’s needed. I want to also thank everyone who has contributed to Sequelize. It’s been a great experience, and a blessing, to witness a project go from infancy to enterprise and through all of its trials and tribulations. I also want to thank the Packt team for doing an amazing job and keeping this project going during troubled times and extending deadlines and moving mountains. You guys did one heck of a great job, thank you!

About the reviewers

Sascha Depold is the original author of the first-of-its-kind Node.js ORM Sequelize. He is an experienced software engineer and engineering manager who has worked for companies such as DaWanda (now part of Etsy), Contentful, and eBay. In his spare time, he likes to collaborate with different tech schools, where he teaches software patterns and approaches as well as recent technology trends (such as GraphQL and Docker/Kubernetes). Sascha is also the creator of the platform-independent wishlist app bitte.kaufen, which makes heavy use of Sequelize under the hood.

Benjamin Coe works on the open source libraries yargs, nyc, and c8, and is a core collaborator on Node.js. He’s a manager of a team at Google that generates idiomatic client libraries for eight programming languages.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset