3 ms·
The typical way to solve this problem would be to keep the data stored in a normalized relational database. There would be a Customer table and a Visits table.
by hnruss 8y ago
The typical way to solve this problem would be to keep the data stored in a normalized relational database. There would be a Customer table and a Visits table. Since the data is normalized, the Customer table would contain only one entry per customer. There would be no need to dedupe the data if it is kept in this format.
If moving the data into a normalized relational database is not an option, the next best option that I can think of is to use a hash table (as mentioned elsewhere in the HN comments). However, I can't imagine working on a system where it would make sense to write a custom solution for each type of data query (unless I was working on a database system).