Introduction to the Course
Get an overview of the course, its intended audience, and prerequisites.
We'll cover the following
Why Node.js is popular
Node.js is considered a game changer by many—possibly the biggest innovation of the decade in web development. It’s loved not just for its technical capabilities, but also for the paradigm shift that it introduced in web development and, in general, in the software development ecosystem.
First, Node.js applications are written in JavaScript, the most adopted language on the web and the only programming language supported natively by every web browser. This aspect enables scenarios such as single-language application stacks and the sharing of code between the server and the client. A single language also helps reduce the gap between the frontend and backend engineers, making backend programming extremely approachable and intuitive for the frontend developers. Once we are acquainted with Node.js and JavaScript, we can easily build software for a wide variety of platforms and contexts.
Node.js itself is contributing to the rise and evolution of the JavaScript language. People realize that using JavaScript on the server brings a lot of value, and they love it for its pragmatism, flexibility, event-driven approach, and hybrid nature, halfway between object-oriented and functional programming.
The second revolutionizing factor is Node.js’ single-threaded programming model and its asynchronous architecture. Besides obvious advantages from a performance and scalability point of view, this characteristic changed the way developers approach concurrency and parallelism. Mutexes are replaced by queues, threads by callbacks, and synchronization by causality. These abstractions are generally simpler to adopt than their traditional counterparts, but they’re still extremely powerful, allowing developers to be very productive while solving day-to-day challenges.
The last and most important aspect of Node.js lies in its ecosystem: the npm package manager, its constantly growing database of modules, its enthusiastic and helpful community, and most importantly, its very own culture based on simplicity, pragmatism, and extreme modularity.
However, because of these peculiarities, Node.js development gives us a very different feel compared to other server-side platforms, and any developer new to this paradigm will often feel unsure about how to tackle even the most common design and coding problems effectively. Common questions include: How do I organize my code? What’s the best way to design this? How can I make my application more modular? How do I handle a set of asynchronous calls effectively? How can I make sure that my application will not collapse while it grows? Or more simply, what’s the right way to implement this?
Fortunately, Node.js has become a mature platform and most of these questions can now be answered easily with a design pattern, a proven coding technique, or a recommended practice. The aim of this course is to guide us through this emerging world of patterns, techniques, and practices, showing us what the proven solutions to the most common problems are and teaching us how to use them as the starting point to building the solution to a particular problem.
What this course is about
In this course, we’ll learn the following:
The “Node way”: We’ll learn how to use the right point of view when approaching Node.js development. For example, how different traditional design patterns look in Node.js, or how to design modules that do only one thing.
A set of patterns to solve common Node.js design and coding problems: We’ll be presented with a versatile and all-encompassing set of patterns, ready to use in order to efficiently solve our everyday development and design problems.
How to write scalable and efficient Node.js applications: We’ll gain an understanding of the basic building blocks and principles of writing large and well-organized Node.js applications that can scale. We’ll be able to apply these principles to novel problems that don’t fall within the scope of existing patterns.
Code in “modern JavaScript”: JavaScript has been around since 1995, but a lot has changed since its inception, especially in these last few years. This course will take advantage of the most modern JavaScript features, like the class syntax, promises, generator functions, and async/await, giving us a properly up-to-date experience.
Throughout the course, we’ll be presented with real-life libraries and technologies, such as LevelDB, Redis, RabbitMQ, ZeroMQ, Express, and many others. They will be used to demonstrate a pattern or technique, and besides making the example more useful, these will also give us great exposure to the Node.js ecosystem and its set of solutions.
Whether we use or plan to use Node.js for our work, our side project, or for an open source project, recognizing and using well-known patterns and techniques will allow us to use a common language when sharing our code and design, and on top of that, it’ll help us get a better understanding of the future of Node.js and how to make our own contributions a part of it.
Who this course is for
This course is for developers who have already had initial contact with Node.js and now want to get the most out of it in terms of productivity, design quality, and scalability. Learners are only required to have some prior exposure to the technology through some basic examples and some degree of familiarity with the JavaScript language because this course will cover some basic concepts as well. Developers with intermediate experience in Node.js will also find the techniques presented in this course beneficial.
Some background in software design theory is also an advantage to understand some of the concepts presented.
This course assumes that learners have a working knowledge of web application development, web services, databases, and data structures.
What we need for this course
To experiment with the code, we’ll need a working installation of Node.js version 14 (or greater) and npm version 6 (or greater). If some examples require us to use some extra tooling, those will be described in place accordingly. We’ll also need to be familiar with the command line and know how to install an npm package and run Node.js applications. Finally, we’ll need a text editor to work with the code and a modern web browser.