ส่วนหน้าและส่วนหลังใน Web3
เปรียบเทียบสถาปัตยกรรมแอปพลิเคชันแบบดั้งเดิมกับ DApps โดยเน้นบทบาทของสัญญาอัจฉริยะในฐานะส่วนหลังแบบกระจายศูนย์
ส่วนหน้าและส่วนหลังใน Web3 เป็นบทเรียน Web3 & DApp Development Fundamentals ฟรีบน CoddyKit นี่คือบทเรียนที่ 1 จากทั้งหมด 3 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Web3 & DApp Development Fundamentals และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Web3 & DApp Development Fundamentals มีบทเรียนทั้งหมด 3 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
Apps: Traditional vs. DApps
We interact with applications every day, from social media to online banking. But how are these apps built and structured?
In this lesson, we'll explore the two main architectural styles: traditional applications and Decentralized Applications (DApps). Understanding their differences is key to Web3!
Traditional App Structure
Think of a traditional application like a restaurant. It typically has three main layers:
- Front-end: What you see and interact with (the dining area).
- Back-end: The 'brains' that process requests (the kitchen).
- Database: Where all the information is stored (the pantry).
Each part has a specific role and works together.
Your View: The Front-end
The front-end is the user interface (UI) you see and interact with. This is the website in your browser or the app on your smartphone.
It's built using technologies like HTML, CSS, and JavaScript for web applications, or Swift/Kotlin for mobile apps. Its job is to display information and send user actions (like clicks) to the back-end.
The Server's Role: Back-end
The back-end is the server-side component of a traditional application. It's where all the complex business logic, user authentication, and data processing happens.
When you click a 'Login' button, your front-end sends a request to the back-end server. The back-end then verifies your credentials and sends back appropriate data or a response.
Centralized Databases
In traditional applications, data is stored in a centralized database. This database is typically owned, controlled, and maintained by a single entity, like a company.
Examples include databases like MySQL, PostgreSQL, or MongoDB. This centralization can offer efficiency but also creates a single point of control and potential failure.
DApps: A Decentralized Shift
Decentralized Applications (DApps) offer a different architectural approach. While they still have a front-end, their back-end and data storage are fundamentally different.
Instead of relying on a single, centralized server and database, DApps leverage a blockchain network to execute their core logic and store data.
DApp Front-end: Familiar Look
The front-end of a DApp often looks and feels very similar to a traditional web application. It's still built using web technologies like HTML, CSS, and JavaScript.
The key difference is how it communicates. Instead of sending requests to a centralized server, it interacts directly with a blockchain network, usually through a 'Web3 library' in your browser.
Smart Contracts: The DApp's Brain
Here's the biggest architectural shift: in DApps, the back-end logic is primarily handled by smart contracts.
- Smart contracts are self-executing programs stored directly on a blockchain.
- They contain the DApp's rules, logic, and state.
- Once deployed, they are immutable and run exactly as programmed, without needing a central server.
Blockchain: Decentralized Data
Instead of a centralized database, DApps store their critical data directly on the blockchain itself. This means:
- Data is distributed across thousands of computers globally.
- It is immutable: once recorded, it cannot be changed or deleted.
- It is transparent: anyone can verify the data.
This removes the need for a single entity to control or manage the data.
Architecture Comparison
Let's summarize the core differences:
- Back-end: Traditional uses centralized servers; DApps use smart contracts on a blockchain.
- Data Storage: Traditional uses private, centralized databases; DApps use public, distributed ledgers (the blockchain).
- Control: Traditional apps are controlled by a single company; DApps are governed by code and potentially their community.
- Availability: Traditional apps can go down if the server fails; DApps are highly available due to decentralization.
Quick Check: DApp Back-end
You've learned about the fundamental differences between traditional and decentralized application architectures. Let's test your understanding!
Recap: DApp Architecture
Excellent work! You now understand the fundamental architectural differences between traditional applications and DApps.
- Traditional apps rely on centralized servers and databases.
- DApps use smart contracts on a blockchain for their back-end logic and data storage, enabling true decentralization and immutability.
This shift is what makes Web3 so powerful! Next, we'll dive into how DApp front-ends actually connect to the Ethereum network.
คำถามที่พบบ่อย
บทเรียน “ส่วนหน้าและส่วนหลังใน Web3” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “ส่วนหน้าและส่วนหลังใน Web3” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Web3 & DApp Development Fundamentals ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Web3 & DApp Development Fundamentals มีบทเรียนทั้งหมด 3 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “ส่วนหน้าและส่วนหลังใน Web3”
เปรียบเทียบสถาปัตยกรรมแอปพลิเคชันแบบดั้งเดิมกับ DApps โดยเน้นบทบาทของสัญญาอัจฉริยะในฐานะส่วนหลังแบบกระจายศูนย์ คุณปฏิบัติ Web3 & DApp Development Fundamentals ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Web3 & DApp Development Fundamentals หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน Web3 & DApp Development Fundamentals บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 1 จากทั้งหมด 3 บทเรียน
บทเรียน “ส่วนหน้าและส่วนหลังใน Web3” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน Web3 & DApp Development Fundamentals นี้ได้ไหม
ได้ บทเรียน Web3 & DApp Development Fundamentals ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- ส่วนหน้าและส่วนหลังใน Web3
- การเชื่อมต่อกับ Ethereum (Web3.js/Ethers.js)
- ตัวอย่าง DApp เบื้องต้น