I pseudokode:
see if redis has the record by 'record_type:record_id'
if so return the result
if not then query postgres for the record_id in the record_type table
store the result in redis by 'record_type:record_id'
return the result
Dette skal muligvis være en tilpasset adapter til den forespørgselsmotor, du bruger.