Caching layer for DHT node responsibility resolution #24

Closed
opened 2020-05-26 11:59:18 +02:00 by schmittlauch · 1 comment
Owner

While triggering a key resolution should always cause network requests and a fresh key resolution (except for keys handled by the own nodes), not each resolution request by the ActivityPub layer on top needs to result in an actual DHT query to be made.

The interface between the ActivityPub service layer and the DHT shall cache associations from cache to node (data) for a certain amount of time.

While triggering a key resolution should always cause network requests and a fresh key resolution (except for keys handled by the own nodes), not each resolution request by the ActivityPub layer on top needs to result in an actual DHT query to be made. The interface between the ActivityPub service layer and the DHT shall cache associations from cache to node (data) for a certain amount of time.
schmittlauch added the
advanced features
DHT
labels 2020-05-26 11:59:18 +02:00
schmittlauch added this to the 1st round of experiments milestone 2020-06-03 00:55:40 +02:00
Author
Owner
  • input: key ID to look up

  • output: hostname, servicePort

    • returning the whole RemoteNodeState would be more future proof in case some other information like node ID were needed
    • but this helps providing a clean interface cut and enforce connection via hostname only
  • caching behaviour:

    • for concurrency: similar to NodeCache handling
    • data structure: tree map (Data.Map.Strict)
    • cache hit: check age, if expired trigger new lookup in DHT (requestQueryID) and schedule update, else return cached entry
    • cache miss: trigger new lookup (requestQueryID) and insert result into cache
    • cleaning: periodic cleaning is needed against atttacker triggering a cache fill up by requesting a large number of random hashtags just once
      • check on each access vs. short cleaning duration
- input: key ID to look up - output: hostname, servicePort - returning the whole RemoteNodeState would be more future proof in case some other information like node ID were needed - but this helps providing a clean interface cut and enforce connection via hostname only - caching behaviour: - for concurrency: similar to NodeCache handling - data structure: tree map (Data.Map.Strict) - cache hit: check age, if expired trigger new lookup in DHT (`requestQueryID`) and schedule update, else return cached entry - cache miss: trigger new lookup (`requestQueryID`) and insert result into cache - cleaning: periodic cleaning is needed against atttacker triggering a cache fill up by requesting a large number of random hashtags just once - check on each access vs. short cleaning duration
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: schmittlauch/Hash2Pub#24
No description provided.