Reading Assignment: Multi-Index Database API

  1. to store and view saved data later on

  2. Querying an entry with .find

  • Creating new entries with .emplace
  • Modifying existing entries with .modify
  1. Iterators simplify the way to go through the elements of lists or the records of a table.
1 Like

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?

  • 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 iterate through it to retrieve the next item
  • The iterator can return a reference or object instance
1 Like
  1. Why do we need to have persistant storage?
    to save data we need to keep

  2. What are the functions to manage a database?
    Querying, Modifying and Creating

  3. What are the benefits of having iterators instead of a traditional key-value storage option?
    to create different tables from the same

1 Like
  1. We need to have persistant storage to store data

  2. find, emplace, modify

  3. Iterators allow us to step backwards and forwards through a data structure

1 Like

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.

1 Like
  1. To be sure that the submitted data to storage stays stored.

  2. find - emplace - modify.

  3. To create multiple views of the same table.

1 Like

Multi-Index Database API.

  1. We need to have persistent storage in order to be able to make comparison within a new data that is to be inserted.

  2. The functions to manage a database are:

  • create -

  • query

  • modify

  • delete

  1. The benefits to have iterators instead of the traditional key - values storage options.
    You can implement an iterator interface for any custom class, making iterator a common way to traverse data.
1 Like
  1. 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.

  2. What are the functions to manage a database?

  • Querying an entry with .find
  • Creating new entries with .emplace
  • Modifying existing entries with .modify
  1. What are the benefits of having iterators instead of a traditional key-value storage option?
    You can get back certain info, see diff views of the tables, and it’s an easier way to manipulate data.
1 Like
  1. Why do we need to have persistant storage?
    To store data for later access

  2. What are the functions to manage a database?
    .find (to query an entry)
    .emplace (to create an entry)
    .modify (to modfy existing entries)

  3. 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.

1 Like
  1. why do we need persistent storage? to access data at any time in the future
  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? iterators can help manipulate the data for different viewpoints
1 Like
  1. So that a smart contract can store data between executions.

  2. .find, .emplace, .modify

  3. It’s more efficient.

1 Like

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.

1 Like

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! :slight_smile:

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.

1 Like
  1. 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.

  2. 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

  3. With iterators we can have multiple table views (the table can have
    multiple secondary indexes).

1 Like
  1. 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.

  2. 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
  1. By using iterators to find values instead of traditional key-value storage, we can multi-iterate to find the next or previous item in the database. There are also some extra features involving multi-index.
1 Like
  1. Why do we need to have persistant storage?
    To store data that is going to be needed in future actions performed by the contract.
  2. What are the functions to manage a database?
    find, modify, emplace
  3. What are the benefits of having iterators instead of a traditional key-value storage option?
    It’s more efficient.
1 Like
  1. Why do we need to have persistent storage?
    To view and possibly modify, delete saved 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
  1. What are the benefits of having iterators instead of a traditional key-value storage option?
  2. Iterators allow multiple table views which in turn allow for multiple secondary indexes.
1 Like
  1. Why do we need to have persistant storage?
    to structure, view and modify 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?
    Iterators allow us to multi-iterate in order manipulate and find the previous or next item in the database.

1 Like
  1. Persistent storage is critical to have memory, especially in EOS, where contracts are dependent on RAM.
  2. Some of the functions are table(struct) in uint64 format, EOSLIB_Serialize, and modifying(.modify), creating(.emplace), and querying(.find) the table.
    3.The iterator makes it easier to look at multiple objects, thus get multiple views on the table.
1 Like