Skip to content

KV Store Architecture.

Ravi Sawlani edited this page Jun 28, 2024 · 3 revisions

KV Store Architecture

Motivation

Yral has already cracked maintaining the canisters and handling all the storage including handling the upgrades for canister. Now idea is to have other third party apps to take advantage of it and use yral as managed service for storage.

How can a third party register with Yral to start using Yral infra.

Approval workflow

Every namespace should get themselves approved using the workflow in order to take advantage of the Yral infra.

sequenceDiagram
actor third-party-app
actor super-admin
box purple Yral
participant namespace-manager
actor super-admin
participant namespace-index
end
third-party-app ->> namespace-manager: requests for new namespace creation. Provides all the data necessary for the creation of namespace (name, description, etc)
note over namespace-manager: stores all the data and puts the namesapce for pending approval. 
namespace-manager -->> third-party-app: returns the namespace-id 
super-admin ->> namespace-manager: approves the namespace id
namespace-manager ->> namespace-index: creates a namespace-index canister with profile owner set as third-part-app principal
note over namespace-manager: updates the namespace canister as approved and stores the canister-id
third-party-app ->> namespace-manager: requests the canister id for namespace-index
namespace-manager -->> third-party-app: returns the namespace-index canister-id
third-party-app ->> namespace-index: make subsequent calls to store data.

Loading

Namespace-Index Canister

These canister serves as entry point to all the operations for that namespace and it can only be accessed using principal that was set as the principal of the third-party-requesting the namespace. Below is workflow of a basic write operation for a key value pair for a namespace.

sequenceDiagram
actor third-party-app

box purple Yral
participant yral-auth
participant third-party-index
participant individual_canister_c1
end

third-party-app ->> yral-auth: requests canister-id for a user
note over yral-auth: creates a canister for the user  if not present already.
yral-auth -->> third-party-app: returns the canister-id
third-party-app ->> third-party-index: store key and value for indivdual canister c1
third-party-index ->> individual_canister_c1 : creates a namespace if not already present and write to key value pair
individual_canister_c1 -->> third-party-index: returns result
third-party-index -->> third-party-app: returns result
Loading