Using a database server
It should be clear by now that I am a huge fan of the SQLite database, which is packaged with features and is supported by every major package and framework. The main limitation of SQLite is that it can’t be readily shared between multiple Node.js servers, so it is time to move to a conventional database server that can be queried over a network. The database I am going to use in this chapter is PostgreSQL, usually referred to just as Postgres. As I noted in Part 2, all of the mainstream databases are good, but I picked Postgres because it is the most popular open-source database and because it is well supported by the Sequelize
ORM package.
The simplest way to use Postgres is by running the database server in a container.
Open a new command prompt and run the command shown in Listing 21.11 to download an image for Postgres and use it to create a new container. The command may take a few moments to complete because the image has to be downloaded...