Using a database
Databases allow web applications to read and write data, which can be used to generate responses for HTTP requests. There are many types of database, with choices about how data is stored and queried, how the database software is deployed, and how changes to data are handled.
The database market is competitive and innovative, and there are excellent commercial and open-source products, but my advice is that the best database is one that you already understand and have worked with before. Most projects can use most databases, and the benefit that a particular database technology confers will be undermined by the time taken to learn and master that technology.
If you don’t have a database, it is easy to get lost in the endless options, and my advice is to start with something as simple as possible. For small applications, I recommend SQLite, which is the database I will use in this chapter. For larger applications, especially where multiple instances...