2025-03-28 17:46:09 -04:00
|
|
|
# Design Notes
|
|
|
|
|
|
|
|
## Synchronization
|
|
|
|
|
2025-04-15 22:10:43 -04:00
|
|
|
We support several operations for Bootstrapping
|
2025-03-28 17:46:09 -04:00
|
|
|
|
2025-04-15 22:10:43 -04:00
|
|
|
* Fetch Bootstrap
|
|
|
|
* Fetch Reference
|
|
|
|
* Fetch Object
|
2025-03-28 17:46:09 -04:00
|
|
|
|
2025-04-15 22:10:43 -04:00
|
|
|
## Resource Datamodel
|
2025-03-28 17:46:09 -04:00
|
|
|
|
|
|
|
We assume all resources are content-addressable and form a merkle tree. We
|
|
|
|
maintain an index of path to content-addressable items.
|
|
|
|
|
2025-04-15 22:10:43 -04:00
|
|
|
Resource reference paths are rooted at a `/ref/` prefix for their path
|
|
|
|
namespace. They contain a payload with the `objectID`, `content_address` if
|
|
|
|
there is one, and a list of any dependent resources.
|
2025-03-28 17:46:09 -04:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2025-03-30 15:11:26 -04:00
|
|
|
"objectId": <merkle-hash>,
|
|
|
|
"content_address": <content-hash>,
|
2025-03-29 16:06:11 -04:00
|
|
|
"path": "/path/name0",
|
2025-03-28 17:46:09 -04:00
|
|
|
"dependents": [
|
2025-03-30 15:11:26 -04:00
|
|
|
{
|
|
|
|
"path": "path/name1",
|
|
|
|
"content_address": <content-hash>,
|
|
|
|
"objectId": <merkle-hash>, content: <payload>
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"path": "path/name2",
|
|
|
|
"content_address": <content-hash>,
|
|
|
|
"objectId": <merkle-hash>, content: <payload>
|
|
|
|
}
|
2025-03-28 17:46:09 -04:00
|
|
|
],
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Reserved References
|
|
|
|
|
2025-04-15 22:10:43 -04:00
|
|
|
* `/ref/all/<username>` The root of the resouce tree. List all sub
|
2025-03-28 17:46:09 -04:00
|
|
|
resources that the user has access too.
|
2025-04-15 22:10:43 -04:00
|
|
|
* `/ref/user/<username>` The user information.
|
2025-03-28 17:46:09 -04:00
|
|
|
|
|
|
|
### Content-Addressable Query API
|
|
|
|
|
|
|
|
The content addressable store is considered immutable. You do not delete from
|
|
|
|
it. We may garbage collect at some point as a storage optimization.
|
|
|
|
|
2025-04-15 22:10:43 -04:00
|
|
|
Content addressable paths are rooted at `/object/<content-hash>`.
|
2025-03-28 17:46:09 -04:00
|
|
|
|
2025-04-15 22:10:43 -04:00
|
|
|
Their payloads are whatever the contents serialize to in json
|
2025-03-28 17:46:09 -04:00
|
|
|
|
|
|
|
## Syncrhonization
|
|
|
|
|
|
|
|
### Bootstrapping
|
|
|
|
|
2025-04-15 22:10:43 -04:00
|
|
|
* Load `/ref/all/<username>`
|
|
|
|
* Follow the sub resources recusively to load the entire dataset locally making
|
|
|
|
sure to keep the content-addresses around for comparison.
|
2025-03-28 17:46:09 -04:00
|
|
|
|
|
|
|
# Benchmarking
|
|
|
|
|
|
|
|
## Bootstrapping benchmark tests
|
|
|
|
|
2025-04-15 22:10:43 -04:00
|
|
|
* Rest API
|
|
|
|
* WebSockets
|