This question is answered here by an authoritative figure in the Ethereum community, so I will refrain from addressing it except to say that either you probably don't have that much data or certainly couldn't afford to store as much as the blockchain could "take". That said, since each node stores a copy of the blockchain's data, if you could afford it, you would burden each of the nodes and possibly cause fewer nodes to exist since running a node would cost more because the size of the data would be so huge.
Storing data on-chain is very expensive relative to centralized solutions.
Storing 1 kB costs
640,000
gas640,000
gas costs$0.08
-$0.90
using current ether prices depending on how quickly you would like your transaction to be mined/confirmedIf the price of ether continues to rise, the price of storing your data will increase with it, assuming a commensurate decrease in the accepted gas price miners are willing to take does not happen.
Every change to the blockchain, no matter how small, costs gas (or "money" in legacy parlance)
- For instance, sending ether with the built-in
send()
method costs21,000
gas - From the yellow paper 4:
Gtransaction 21000 Paid for every transaction.
So every tx costs at least21,000
-- that is the minimum cost [yellow paper]
- For instance, sending ether with the built-in
Getting data from the blockchain is free though:
- We can get data from the blockchain a few ways:
- Getter functions that are automatically created for us for each
public
variable in our contracts- For instance, the line:
uint public numRestaurants = 42;
creates a function we can call from our contractthis.numRestaurants()
- In
web3
client we could call this function withcontractInstance.numRestaurants.call()
- For instance, the line:
- Contract functions that promise to not modify state can be declared
constant
orview
functions-
return a * (b + 42) + now; // does math but doesn't change state! }```
-
- Events are data that are stored in the blockchain
LogUpdateRestaurant('mandalay', 8.7, 'restaurant')
in the function that will store your restaurant data- We define events with
event LogUpdate(indexed string restaurantName, uint8 rating, TypeEnum type);
- Getter functions that are automatically created for us for each
- We can get data from the blockchain a few ways: