#holochain #cascade #retrieve #dht #cache #local #cascading

holochain_cascade

Logic for cascading updates to Holochain state and network interaction

162 releases

new 0.3.0-beta-dev.42 Mar 27, 2024
0.3.0-beta-dev.37 Feb 28, 2024
0.3.0-beta-dev.29 Dec 22, 2023
0.3.0-beta-dev.26 Nov 29, 2023
0.0.2 Jul 29, 2021

#2152 in Magic Beans

Download history 50/week @ 2023-12-05 87/week @ 2023-12-12 27/week @ 2023-12-19 3/week @ 2023-12-26 1/week @ 2024-01-02 71/week @ 2024-01-09 69/week @ 2024-01-16 58/week @ 2024-01-23 89/week @ 2024-01-30 225/week @ 2024-02-06 106/week @ 2024-02-13 135/week @ 2024-02-20 476/week @ 2024-02-27 507/week @ 2024-03-05 336/week @ 2024-03-12 537/week @ 2024-03-19

1,884 downloads per month
Used in 8 crates (via holochain)

Apache-2.0 and AGPL-3.0 WITH mif-exception

2.5MB
58K SLoC

holochain_cascade

Cascade

Retrieve vs Get

Get checks CRUD metadata before returning an the data where as retrieve only checks that where the data was found the appropriate validation has been run.


lib.rs:

The Cascade is a multi-tiered accessor for Holochain DHT data.

Note that the docs for this crate are admittedly a bit loose and imprecise, but they are not expected to be incorrect.

It is named "the Cascade" because it performs "cascading" gets across multiple sources. In general (but not in all cases), the flow is something like:

  • First attempts to read the local storage
  • If that fails, attempt to read data from the network cache
  • If that fails, do a network request for the data, caching it if found

Retrieve vs Get

There are two words used in cascade functions: "get", and "retrieve". They mean distinct things:

  • "get" ignores invalid data, and sometimes takes into account CRUD metadata before returning the data, so for instance, Deletes are allowed to annihilate Creates so that neither is returned. This is a more "refined" form of fetching data.
  • "retrieve" only fetches the data if it exists, without regard to validation status. This is a more "raw" form of fetching data.

Dependencies

~99MB
~2M SLoC