-
to store and view saved data later on
-
Querying an entry with .find
- Creating new entries with .emplace
- Modifying existing entries with .modify
- Iterators simplify the way to go through the elements of lists or the records of a table.
to store and view saved data later on
Querying an entry with .find
1. Why do we need to have persistant storage?
to be able to access data persistantly and keep records
2. What are the functions to manage a database?
.find
.emplace
.modify
3. What are the benefits of having iterators instead of a traditional key-value storage option?
Why do we need to have persistant storage?
to save data we need to keep
What are the functions to manage a database?
Querying, Modifying and Creating
What are the benefits of having iterators instead of a traditional key-value storage option?
to create different tables from the same
We need to have persistant storage to store data
find, emplace, modify
Iterators allow us to step backwards and forwards through a data structure
1. Why do we need to have persistent storage?
To ensure data submitted to storage persists or stays in storage for tasks such as querying, modifying, deleting and potentially provide context to other actions that may depend on such data.
2. What are the functions to manage a database?
- Querying an entry with
.find
- Creating new entries with
.emplace
- Modifying existing entries with
.modify
3. What are the benefits of having iterators instead of a traditional key-value storage option?
You can loop through a set of objects inside a table in a simplistic manner.
To be sure that the submitted data to storage stays stored.
find - emplace - modify.
To create multiple views of the same table.
Multi-Index Database API.
We need to have persistent storage in order to be able to make comparison within a new data that is to be inserted.
The functions to manage a database are:
create -
query
modify
delete
Why do we need to have persistent storage?
Because this is how data can be saved and used later on in the code and so EOSIO doesn’t create new data.
What are the functions to manage a database?
.find
.emplace
.modify
Why do we need to have persistant storage?
To store data for later access
What are the functions to manage a database?
.find (to query an entry)
.emplace (to create an entry)
.modify (to modfy existing entries)
What are the benefits of having iterators instead of a traditional key-value storage option?
Iterators can return the current object by object dereference or object instance plus can return next or previous objects.
So that a smart contract can store data between executions.
.find, .emplace, .modify
It’s more efficient.
There is a problem with the link of the blog post.
I tried to load the site with different browsers and on different devices, but the page
does not load.
The site loads just partially and then it freezes.
Can you help me?
Thanks.
Update:
I’ve found the cached text-only version of the blog post on google chrome.
I hope it’s enough to complete the reading assignment.
Hey @Cryptofun85, hope you are great.
The link works good, maybe you’r having an issue with your browser, try to open it with another one (firefox, opera, chrome…)
https://medium.com/fueled-engineering/exploring-the-eos-multi-index-database-557769b1b7a6
If you have any more questions, please let us know so we can help you!
Carlos Z.
Why do we need to have persistent storage?
To have access to information that last beyond the time frame of the smart contract. It is important to persist data using the smart contract itself.
What are the functions to manage a database?
Specific functions include but not limited to;
Storing index data on the blockchain.
Segregation of responsibilities
Functions required to manage entries eg. ( .emplace .find .modify)
What are the benefits of having iterators instead of a traditional key-value storage option?
Iterators enables the retrieval of an item by moving backwards several times. It also acts as a building blocks to an update. It provides a unique feature to walk through the table.
In EOSIO we need to have persistent storage in order to store data beyond the time of
the execution of transactions’ actions.
In order to achieve this we use tables, formatted by struct data type.
To manage a database in EOSIO we need 3 functions:
.find -> to query an entry of the database
.emplace -> to create a new entry on the database
.modify -> to modify an existing entry on the database
With iterators we can have multiple table views (the table can have
multiple secondary indexes).
We need persistent storage because EOS smart contracts don’t store values by default. Once an EOS smart contract has finished executing, all variables that were defined in the contract are forgotten.
To manage a database, we use the following basic functionality:
- Querying an entry with
.find
- Creating new entries with
.emplace
- Modifying existing entries with
.modify
Why do we need to have persistent storage?
To view and possibly modify, delete saved data
What are the functions to manage a database?
.find
.emplace
.modify
Why do we need to have persistant storage?
to structure, view and modify data
What are the functions to manage a database?
Querying an entry with .find
Creating new entries with .emplace
Modifying existing entries with .modify
What are the benefits of having iterators instead of a traditional key-value storage option?
Iterators allow us to multi-iterate in order manipulate and find the previous or next item in the database.