Things are worse than I thought in some posts above: independently of the new pay for POST, the datamap will not be stored directly in the directory object anymore:
Master branch:
pub struct File {
id: XorName,
metadata: FileMetadata,
datamap: DataMap,
}
Dev branch:
pub struct File {
size: u64,
created: DateTime<UTC>,
modified: DateTime<UTC>,
user_metadata: Vec<u8>,
data_map_name: XorName,
}
The datamap is now stored as a name pointing to an immutable data in the network. This means that updating a small file (less than 3KB), which was free beforehand, will cost 2 units from the put balance: one unit to update the directory and another one to store the datamap. For a medium file (between 3KB and 3MB) the update cost, which was 3 units for the new chunks, will become 5 units (directory + datamap + 3 chunks).
The price increase is related to the increase of the number of requests sent to the network, but that’s not a justification because the implementation could remain the same with less traffic and no increased costs. For GET requests this is even totally illogical because these requests are free and Maisafe should try to reduce their number instead of increasing it.
Here is a table to have a global vision of the evolution:
| | Previous implementation | New implementation |
|----------------------------------|-------------------------|--------------------|
| Update cost of small file | 0 units | 2 units |
| Update cost of medium file | 3 units | 5 units |
| Requests to update a small file | 1 POST | 1 POST + 1 PUT |
| Requests to update a medium file | 1 POST + 3 PUTs | 1 POST + 4 PUTs |
| Read cost of any file | 0 units | 0 units |
| Requests to read a small file | 1 GET | 2 GETs |
| Requests to read a medium file | 4 GETs | 5 GETs |