sociomantic-tsunami / dhtproto

Distributed Hash Table protocol definition, client, fake node, and tests
Boost Software License 1.0
5 stars 22 forks source link

Add channel cache #148

Open gavin-norman-sociomantic opened 6 years ago

gavin-norman-sociomantic commented 6 years ago

Two ideas here, from common use cases:

  1. A size-limited, expiring cache backed by Get requests. (Should also cache the fact that a record does not exist.)
  2. A size-unlimited, non-expiring cache (a map really) backed by a Mirror request.

Both of these are very common patterns in applications, so it makes sense to provide standard dhtproto components for these tasks. Whether they could or should be merged into a single component that can be configured for different use cases can be discussed.

gavin-norman-sociomantic commented 6 years ago

A size-unlimited, non-expiring cache (a map really) backed by a Mirror request.

This will be addressed in #82.

mihails-strasuns commented 6 years ago

A size-limited, expiring cache backed by Get requests. (Should also cache the fact that a record does not exist.)

This is becoming more important as ExpiringCache from ocean (which is most commonly used to implement this right now) is starting to hit its limits. See https://github.com/sociomantic-tsunami/ocean/issues/539 - having specifialized solution which understands concepts of "empty record" and "dht error" would make code much more simpler.

gavin-norman-sociomantic commented 6 years ago

This will be addressed in #82.

82 has turned out to be just about the load / dump to disk aspect of a mirrored channel.