In this chapter, we've covered a lot to do with databases. We started by creating a plain connection to PostgreSQL. After that, we added a pool of connections with the r2d2 crate and used the rayon crate to execute SQL statements in parallel. We created a tool to manage our users database, and reimplemented it for our MySQL database.
We have also mastered some ways of interacting with NoSQL databases, in particular, Redis and MongoDB.
The last database we explored was DynamoDB, which is part of Amazon Web Services and can be scaled very easily.
For all examples, we run database instances in containers, because it's the simplest way to test interactions with databases. We haven't use database connections in microservices yet, because it requires a separate thread to avoid blocking. We will learn how to use background tasks with asynchronous...