Reading geth code and various posts here, I think I have now a good understanding of how the data is stored in Ethereum (please correct me if I am wrong at some point).
At the lowest level we have a key-value database
At the next level we have a generic datastructure called trie
And at the Ethereum Blockchain level we have something like (only relevant parts named):
block -> state trie -> account* -> storage trie
[Q1]: For state trie the paths represent the account addresses. What are the paths in the storage trie? Storage indices?
[Q2]: If we have a simple contract of the form:
contract C {
uint256 public x = 100;
}
When we instantiate two instances of this contract. Will they have the same storage root hash? If yes, will they share exactly the same key/value pair in the database (at the lowest level), respectively the same trie node in the storage trie?