Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Corda - Difference between ledger, vault and storage service

Tags:

database

corda

I have just started learning Corda. I am not clear with difference between ledger, vault and storage service. My queries are with regards to following documents I went through:

  1. Corda technical paper(https://docs.corda.net/_static/corda-technical-whitepaper.pdf): It states "The vault contains data extracted from the ledger that is considered relevant to the node’s owner, stored in a form that can be easily queried and worked with. It also contains private key material that is needed to sign transactions consuming states in the vault."

  2. Corda docs(https://docs.corda.net/key-concepts-node.html): It mentions persistence layer having two parts - vault and storage service.

Queries

  1. Are ledger, vault, storage service separate components?
  2. Are vault, ledger, storage service part of same database under a node?
  3. Does ledger contain everything - all consumed and unconsumed states, transactions, attachments, flow checkpoints etc. relevant to a particular node?
  4. Does vault only contains consumed and uncosumed states relevant to a particular node? Does this mean that vault is a subset of ledger, and fetches information from the ledger everytime a transaction is recorded into the ledger?
  5. Does storage service contains all data other than consumed and uncosumed states i.e. transactions, attachments, flow checkpoints etc ? Does this mean that storage service is a subset of ledger, and fetches information from the ledger everytime a transaction is recorded into the ledger?

Can anyone please help me giving clear picture of database architecture used in corda(I could not clearly understand the diagram at https://docs.corda.net/vault.html)? I don't see "storage service" anywhere in this diagram.

like image 323
Manindra Avatar asked Dec 24 '22 06:12

Manindra


1 Answers

  1. The storage service is the database backing the node. The vault is a table in that database that tracks states that are relevant to the node. The ledger is a figurative "global log of transactions" that stores every transaction performed by every node (in practice, each node only sees and stores a subset of the transactions on this ledger)

  2. The storage service is another name for the database. The vault is a table in that database. The ledger is just a figure of speech

  3. The ledger is just a figure of speech. The storage service stores everything known to the node

  4. Yes, the vault stores consumed and unconsumed states. Every time a transaction is recorded, the node grabs the relevant states and stores them in its vault too

  5. The storage service contains everything known to the node, including the vault

like image 161
Joel Avatar answered Jan 19 '23 00:01

Joel