I know that the eos blockchain saves the transactions generated data in a persistent database. It has methods to insert, modify and erase data. As the blockchain is supposed to be immutable, does the erase method really delete permanently the data or just flag it deleted? The same question related to the modify method. Does it keep the previous copy ?
There are two separate concepts: the blockchain and the database. The blockchain is an immutable log of transactions, e.g. transfer 5.0000 EOS from usera
to userb
. The database holds mutable state information, e.g. userb
has 10.0000 EOS. Contracts modify the database in response to actions. Even though the database is mutable, you can recreate it at any point in time by replaying the chain from the beginning.