This is where the real revolution lies: a language that was originally intended to be executed only within the browser is now executed outside of it.
From this, numerous advantages arise, including:
But why is Node.js so beloved by developers?
In addition to the aforementioned advantages, Node.js is an open source, cross-platform environment that boasts a large community of developers worldwide. Furthermore, it is based on an asynchronous, non-blocking, single-threaded, event-driven I/O model, ensuring high performance and excellent execution speed. It manages requests from clients efficiently.
Within a Node.js project, you can exploit a range of free resources and tools created by other developers to incorporate additional functions, improve productivity, and facilitate your work.
npm, short for Node Package Manager, is the package manager for the Node.js platform. It allows you to install, remove, and manage packages —pre-built projects created by other developers that implement specific functionalities— through a command-line interface. Think of npm as a large online repository for Node.js packages, each with its own unique features.
Among the countless packages available, there are some dedicated to interacting with databases. As mentioned in the first article of this series, back-end programming encompasses all aspects that are not directly visible to the end user, including integration with a database. If an application needs access to external data, it will most likely do so through a database, where the data is stored for quick retrieval.
LPI’s Web Development Essentials specifically covers SQLite, a software library that implements a relational database management system (RDBMS). In this type of database, data can be stored in interconnected tables and queried using simple and intuitive queries.
Having a relational database at your disposal, you may wonder how to perform operations on it. SQL, which stands for Structured Query Language, is the querying language that allows you to manipulate data within a relational database. It is an extremely popular and user-friendly language that enables you to:
Now it becomes clear why a relational database is also called an SQL database, precisely because of its query language!
Developers use SQL because it integrates very well with different programming languages. For example, to use SQLite in Node.js, you simply need to install a module using the npm package manager mentioned earlier. Once it’s installed, you will have access to a set of functions that allow you to create and maintain a relational database.
In addition to relational databases, which store information in related tables, there are also non-relational databases, also known as NoSQL databases. These have more flexible schemas and can be equally used in back-end applications. Non-relational databases use storage models optimized for the specific application and data to be stored (for example, information can be stored as simple key-value pairs). Databases of this type are characterized by ease of development, high performance, and excellent flexibility and scalability.
The following table lists the most popular relational and non-relational databases commonly used in back-end applications:
|Microsoft SQL Server
Once you become familiar with the SQL language and the SQLite database, you can then, with some practice, try manipulating data within a non-relational database, discovering the pros and cons of such a solution.
What is yet to be explored is which learning resources can best prepare you for the actual certification exam. In the upcoming articles of this series, I will show you the essential study materials to pass the Web Development Essentials certification, along with supplementary materials, exam simulations, and some tricks that will surely help you in your learning journey.