We are building a events data store on top of elasticsearch. Our goal is to provide real-time analytics with advanced segmentation on top of users & events. Our entities are
- Users or Visitors
- Events (Which is performed by Users, which will be above 100 - 1000)
"event_name": "Add To Cart",
"product_name": "IPhone X"
I tried 2 options
Nested Documents, a concern is user attributes will not be modified frequently. But, events will be performed very frequently. Let's say a user will perform 1000+ events, so the same doc will be updated more than 1000 times.
Parent-Child Relationship, not satisfying segmentation
- Give me the user ids, who is in the US and performed "Add To Cart" & product name is "iPhone X"
With nested documents, it is working out well. But parent-child, I couldn't able to perform the search on parent & child at the same time.