Let's take our product project developed in Chapter 2, Writing Your First Cloud-Native Application, forward. We will incrementally enhance it while discussing the concepts.
Let's think carefully about the database of our two services. getProduct returns the product information, while getProducts searches a list of products that fall into this category. To begin with, for simple and standard requirements, both queries can be answered by a single data model in a relational database:
- You would store a product in a product table with a fixed number of columns.
- You would then index the category so that the queries against it can run quickly.
Now, this design will be fine for most requirements for an average-sized company.