Case Study I. E-Commerce

For this case study, imagine that you want to build dimestore, an online store. You use Couchbase Server to store variety of different data – everything from product details, and customer information, to purchase and review histories.

ScreenShot

Now, lets look at how N1QL can be used to solve some typical e-commerce scenarios. For the sake of this tutorial, let is assume that the data for our application is kept in 4 different couchbase buckets : There are 2 types of users of our application :
Counting all the products
Don shops online at dimestore. When he visits the homepage, it displays a count of all the products.
SELECT 
  COUNT(*) AS product_count 
    FROM product