Persisting interactions

Task:

How to process and store data so that:

  • Interactions should have a 90 day TTL (a daily/hourly retention policy is sufficient)

  • All interactions from one supplier should be possible to delete

  • Other systems should be able to load ranges of interactions based on supplier and a timestamp range

 

Focus on storing

Consideration:

Fast data lookup Vs. fast db write

The task can be solved using either relational- or graph database. In both cases there is a trade off between read and write

Overview:

 

pub/sub

Pre

Process

DB

  • Data reliable? Check this? Fix?
  • Transform (from json?)
  • Update DB (add new data and delete 90 days old)

 

  • Store data

 

Graph Db

 

Supplier

Interaction

-Timestamp

Using uniqueness constraints on supplier Id and Interaction Id, as well as index on timestamp ensures fast lookup.

Allows to only look through interactions connected to a specific supplier

Hour

Date

Allows fast delete of old records

Probably unnecessary as timestamp is indexed

Persisting_interactions

By jmmodin

Persisting_interactions

  • 179