Week 4 of learning Solana, and Solana breaks my belief again. Solana programs don't store their own data. And I was like "whaaatt? 🫨"
All my time in Web2, data has lived closely to the application — in some DB row, tightly coupled to the application. Even when I explored development on Ethereum, data was natively part of the smart contract.
But here I came to understand that Solana treats data separate from the executable. The application state lives separately in its own account, just like the executable. i.e. both live on the same unit structure = Account.
Ok but... what even IS an Account?
Every account on Solana has the same structure:
| Field | Description |
|---|---|
lamports |
think of this like the account's wallet balance, but in the smallest unit. 1 SOL = 1 billion lamports. Yes, billion |
data |
raw bytes — could be your application's state, or the executable code itself if it's a program account |
owner |
the one with the authority to modify the account state |
executable |
a flag (true/false) suggesting if the data stored on the account is an executable |
rent_epoch |
deprecated, although previously it was used to calculate the storage rent on the network |
So if data lives separately... 🤔
Now I know what you might be thinking — "Ok so if data lives as a separate entity, how does one know what program a data account belongs to? What links them?"
I had the same curiosity. So I tried:
See the owner field on this account? The address on that field is of the executable program. The link between the application and its state.
That field also suggests that no one else than the owner can alter anything within the account. Only the program account has the access to modify the state of its data account.
Why though? Why take this different approach?
Now that was a lot of talking, let's get to the point. Why separate an executable from state? Well, this surely isn't a design quirk. It is this idea that makes Solana fast, composable and open by default.
Storing data as an entity of its own is what makes it composable and scalable at the same time. No need for APIs, contracts, integrations. Two apps can easily share data, as it already lives in its own account. Right permissions is all you need.
Also, making programs stateless makes parallelization easier. The Solana runtime knows upfront which accounts a transaction will touch.
This mental shift — from data-inside-the-app to data-as-its-own-entity — is my biggest takeaway from Week 4.
Part of my #100DaysOfSolana journey with MLH. Following along? Drop a comment — always better to get lost together 🙂

Top comments (0)