Introduction to databases
- Databases are systems that allow us to store and retrieve different types of data. Databases offer a variety of guarantees related to data storage, among which is durability – a guarantee that all records and any related data changes will be persistent over time. A durability guarantee helps ensure that the data stored in a database won’t be lost in case of various events such as software and hardware restarts, which are pretty common for microservices.
- Databases help solve lots of different other problems related to data storage. Let’s illustrate one such problem using the metadata service that we created in Chapter 2, Scaffolding a Go Microservice. In our metadata service code, we implemented an in-memory repository for storing and retrieving the movie data that provides two functions,
Get
andPut
. If we have just one instance of the metadata service, all its callers would be able to successfully write and read metadata...