Understanding data modeling in Solidity
Data stored in Ethereum has a fixed schema and layout. Once a smart contract is created with global storage and deployed, it cannot be modified. Its layout is determined, and it remains the same for the lifetime of the contract.
All data required by a decentralized application can be stored within a single smart contract. However, managing such a smart contract can easily become a nightmare and there can be more than one reason for versioning the smart contract and redeploying. A better strategy is to divide all the required data into smaller data buckets and put them in separate smart contracts. This will ensure that even in the case of changes, only part of the application and smart contract will be redeployed instead of the entire application.
However, this approach poses a different set of challenges, such as how should related data be retrieved together from multiple smart contracts, how can we put related data in multiple smart contracts...