01_Definitions.md
February 22, 2022 ยท View on GitHub
What are Stores, AccessControllers and Indicies.
Before we start to implement
our custom store, access controller, and index
to allow our users to comment on each others
notes, we should probably define what a Store,
AccessController, and Index are and what
function they have in OrbitDB.
The Store
You have already worked with several
Stores in the Tutorial.
The docstore was used to store
the individual pieces (or rather their CIDs)
and the kvstore type was used to
represent a user.
Both of those were instances of a Store.
They calculated some state from ipfs-log and provided easy
functions to access them, like get, put or set,
with which you could easily interact with
the database itself.
The Index
But a store doesn't actually
store the current state of the database in the RAM,
because this is done in the Index.
The index parses the log of operations generated by the store while modifying the database and generates an easy to access and use representation of the current state of the database.
The index is then used by the Store
to implement its API.
The Access Controllers
Access Controllers or short ACL (Access Control List) were already discussed 02: Managing Data.
They are a piece of code that is invoked whenever you try to write to the database to ensure that you have the right to do so.
It is setup when you create a database
and stored in the Manifest of the database.
(The multihash zdpuAmQhKvDytoSn6NapRYZYTAWgqQpbJBfPLmUiSRBYgN7ah is refering to the
Manifest file./orbitdb/zdpuAmQhKvDytoSn6NapRYZYTAWgqQpbJBfPLmUiSRBYgN7ah/example)
Anyone, who supports this type of access controller, can follow the rules of the access controller.
But this also means, that you cannot change the type of your Access Controller, without changing the Manifest file and thus the OrbitDB Address.