How KonnectBox uses this product authentication trick in the E-commerce web development that can increase speed of searching the product by users
This blog will discuss Product CataLog Module on Konnectbox in detail. A Seller can publish various items which an end user can see on his search page. Some Key points :
- Authentication Service was needed on the seller side to make product addition because sellers can have multiple user groups and grant permission to them accordingly for example : one can add only product, One can add product category and product both.
- Search has to be fast and item addition can be taken care of in near real time.
KonnectBox Search Engine uses various Open stack components and Microservices to render its search page. Below is the flow diagram for data :
So, We thought of exposing a service for authentication for the seller which will assign a role when he is entering into the system.To avoid DB calls we choose JWT based token so that Public Private Key encryption can serve the purpose.
Once a seller enters after Auth, he can add inventory into the system which will be saved in Mysql. Now we wanted to segregate our search API because it has nothing to do with Mysql. It works on inverted index i.e Elastic search. So once any CRUD request comes on catalog service the same is being published on Kafka Topic. We have two Kafka Listeners on this topic. One updates the elastic search and the other also keeps the same data in aerospike.
Once a user searches for any product, the same is being served from elastic search and finally the listing page is being rendered. Aerospike is being used for the detail page where we can show everything for that product. So we thought of choosing only cache/Nosql on our search page and listing page to make it faster.
But once a user moves ahead to buy an inventory we need RDBMS to meet ACID compliance so we choose mysql to confirm the transaction. So Pricing Service and Cart Service don’t rely on cache and put everything on Mysql only. In case the user does not perform the transaction within a time frame the same is being released into the main pool and cache is being updated.
For deployment we are using EC2 instances with Kubernetes. Every service is a micro service and deployment happens with CICD from Jenkins pipeline only.