Let's implement the catalog and order process scenarios for our e-commerce application. In our use case, we will be selling only books on the portal that we are going to design. However, if the business wants to expand later to include other products, there will be enough flexibility in this design.
Our data model is shown in the preceding figure, this is, the database schema. However, in Couchbase, we don't need to create each domain object as a separate entity; the schema of the information goes along with the document. The data model is explained as follows:
For our use case, a customer can have only one cart. In it, the customer can add multiple products...