惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
F
Fortinet All Blogs
J
Java Code Geeks
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
M
MIT News - Artificial intelligence
腾讯CDC
Last Week in AI
Last Week in AI
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Proofpoint News Feed
博客园 - 叶小钗
Recent Announcements
Recent Announcements
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理
L
LangChain Blog
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Solana Accounts Explained to a Web2 Developer
Hope · 2026-05-22 · via DEV Community

If you are coming from a traditional Web2 background (like building with Node.js, databases, or cloud servers), your first look at a blockchain can be confusing. You hear terms like smart contracts and state transition, but how does data get saved?

On Solana, Everything is a file.

Well, Solana calls them Accounts, but they act just like files in a computer operating system. Let's break down how Solana stores data using terms you already know.

1. The Big Idea: Everything is a File (Account)

In Web2, you might use a Linux server. On that server, you have executable files (programs) and data files (such as .json or .txt).

Solana works the same way. Instead of a hard drive, Solana uses a giant, flat key-value store.

  • The Key: A 32-byte string called a Public Key (like So11111111111111111111111111111111111111112). This is your file name or path.
  • The Value: The account itself. This is the actual file contents and metadata.

Whether it's a user wallet, a piece of code, a token balance, or a picture of an NFT—on Solana, it is always an account.

2. The 5 Fields Inside Every Account

Just like a file on your computer has a size, an owner, and permissions, every single Solana account contains the same five pieces of information:

Field What it means in Web2 terms
Lamports The bank balance of the file. A lamport is a tiny fraction of a SOL coin (1 SOL = 1 billion lamports).
Data The actual contents of the file. A flat array of bytes where you can save any information.
Owner The specific program (app) that is allowed to change this file's data.
Executable A true/false switch. If true, this file is a program (code). If false, it's just data.
Rent Epoch A background field used by the network (mostly system maintenance data).

Here is what it looks like if you inspect a real account using the Solana command line:

{
  "lamports": 2039280,
  "data": ["SGVsbG8gV29ybGQ=", "base64"],
  "owner": "11111111111111111111111111111111",
  "executable": false,
  "rent_epoch": 18446744073709551615
}

Enter fullscreen mode Exit fullscreen mode

3. Programs are Stateless

This is the biggest surprise for Web2 developers.

In Web2, your app server usually holds some data in memory, or your code handles its own database connections. On Solana, programs (smart contracts) cannot store data inside themselves. They are stateless.

Think of it like this:

  • The Program Account: This is your compiled code. Its executable flag is set to true. It sits there like a web server application, ready to run.
  • The Data Account: This is your database row. Its executable flag is false.

When a user wants to interact with an app, they pass both the Program (the code) and the Data Account (the file) to the network. The program reads the data file, updates it, and saves it back.

4. The Golden Rule: App Security

How do we stop people from changing your data account and giving themselves a million tokens? Solana has a very strict security rule built into its core:

Only the program listed as the "Owner" of an account can change its data.

If Program A tries to modify a data file owned by Program B, the Solana network rejects the change. However, anyone is allowed to send money (lamports) into any account. You can deposit money into a friend's bank account, but only the bank's system can update their account status.


5. Rent: Paying for Storage Space

On a cloud platform like AWS, you pay a monthly fee to keep your files stored on a hard drive. If you stop paying, AWS deletes your files.

Solana manages storage similarly, but with a twist. To keep a file on the blockchain, the account must hold a minimum amount of SOL coins. The bigger your data file, the more SOL you need to leave in it. This is called being Rent-Exempt.

For a basic wallet account with no extra data, it costs a tiny fraction of a cent (around 0.00089 SOL) to stay on the network forever. If you ever close the account and delete the file, you get all that SOL back!

Wrapping Up

To survive and build on Solana, just remember these four rules:

  1. Everything is a file called an account.
  2. Code and data live in completely separate files.
  3. Programs are stateless; they just read and write to data accounts.
  4. Only the owner program can modify a file's data.

Once you view the blockchain as a giant, secure file system, writing applications becomes much easier to visualize!