I need to create a system where the user creates dynamic filters based on our customer's attributes. There are more or less 30 possible filters and 30 millions of customers, but the number of customer increase every day and the attribute value can change every day too, so we have insert and updates in these set of data every day. Another thing is that I can create a new filter or remove.
This customer data that I will filter is data processed from other databases, so this data set is not the original, every day these data will be processed in another place and I'll load into Elasticsearch the processed data with all attributes values. If something changed from the customer I'll update the customer attributes or if it's a new customer, insert a new document. This process will run every day and I'll need to update or create thousands of customers.
This use case, is it a good fit to use Elastisearch? Because I can't create an index based on date or something like that and In this case I will have one index with all my customers.
I need to return a count of customers that match these filters at most in 1/2 seconds, also in the future I'll have to export all customer id that match the filters and I have to keep all my customers, so the retention period is forever.
Some attributes:
- Downloaded the app (boolean)
- Credit card limit (number)
- Last transaction (date)
- Status (text)
- Last access (date)
- How many times used the credit card (number)
- City (text)
- Average transaction value (number)
The user can use >, <, =, >=, <=
to filter or use IN
, like city IN ('New York', 'Seattle')
.
Thanks.