Lộ trình cho người muốn ship API hoặc tool mà không quản máy chủ. Đọc bài kiến thức, rồi làm lab hub, rồi lab chính thức nếu có.A path for people who want to ship an API or a tool without running a server. Read the knowledge lesson, do the hub lab, then the official lab when one exists.ផ្លូវសម្រាប់អ្នកចង់ ship API ឬ tool ដោយមិនដំណើរការ server។ អានមេរៀនចំណេះដឹង រួចធ្វើ lab hub រួច lab ផ្លូវការ បើមាន។
Ba chỗ giữ dữ liệu, ba việc khác nhau. KV giữ cặp khóa và giá trị. D1 là SQL nhỏ. R2 giữ file. Chọn sai thì app chạy được lúc demo và hỏng lúc thật.Three places to keep data, three different jobs. KV keeps a key and a value. D1 is a small SQL database. R2 keeps files. The wrong pick works in a demo and breaks for real.Three places to keep data, three different jobs. KV keeps a key and a value. D1 is a small SQL database. R2 keeps files. The wrong pick works in a demo and breaks for real.
Cách hoạt độngHow it worksHow it works
KV đọc nhanh theo một key: cờ tính năng, session ngắn, bộ đếm. Nó không hợp giao dịch cần đúng từng dòng. D1 dùng câu SQL và migration. R2 giống kho file: PDF, ảnh, upload. Cả ba gắn vào Worker bằng binding.KV reads fast by one key: a feature flag, a short session, a counter. It is a poor fit for a transaction that must get every row right. D1 uses SQL and migrations. R2 is a file store: PDFs, images, uploads. All three attach to a Worker with a binding.KV reads fast by one key: a feature flag, a short session, a counter. It is a poor fit for a transaction that must get every row right. D1 uses SQL and migrations. R2 is a file store: PDFs, images, uploads. All three attach to a Worker with a binding.
Kiến trúcArchitectureArchitecture
Worker không giữ dữ liệu giữa các lần chạy. Binding là cửa ra ngoài. Một app thường dùng một kho chính: SQL thì D1, file thì R2, cờ thì KV. Đừng nhét bảng quan hệ vào KV.A Worker does not keep data between runs. A binding is the door out. An app usually has one main store: SQL in D1, files in R2, flags in KV. Do not put a relational table in KV.A Worker does not keep data between runs. A binding is the door out. An app usually has one main store: SQL in D1, files in R2, flags in KV. Do not put a relational table in KV.
Khi nào dùngWhen to use itWhen to use it
Đọc bài này trước khi tạo namespace, database hoặc bucket. Lab hub ở sau chỉ thao tác đúng loại bạn đã chọn.Read this before you create a namespace, a database, or a bucket. The hub lab after this page only operates the kind you already chose.Read this before you create a namespace, a database, or a bucket. The hub lab after this page only operates the kind you already chose.
Khi nào không dùngWhen not to use itWhen not to use it
Đừng dùng KV cho số dư tiền hoặc đơn hàng. Đừng dùng R2 cho một dòng cấu hình nhỏ. Đừng dùng D1 làm kho file.Do not use KV for a balance or an order. Do not use R2 for one small config line. Do not use D1 as a file store.Do not use KV for a balance or an order. Do not use R2 for one small config line. Do not use D1 as a file store.
Gói và giới hạnPlans and limitsPlans and limits
Số trên Free, kiểm tra 2026-11-15. KV: 100.000 lần đọc/ngày, 1.000 lần ghi/ngày, 1 GB. D1: 5 triệu dòng đọc/ngày, 100.000 dòng ghi/ngày, 5 GB, 10 database. R2: 10 GB-tháng, 1 triệu thao tác Class A và 10 triệu Class B mỗi tháng. KV và D1: vượt hạn Free thì lời gọi lỗi. R2: cần bật gói R2 qua bước checkout trong dashboard; phần vượt free tier bị tính phí. Bài này không báo giá. Nguồn: https://developers.cloudflare.com/kv/platform/pricing/ https://developers.cloudflare.com/d1/platform/pricing/ https://developers.cloudflare.com/r2/pricing/ https://developers.cloudflare.com/r2/get-started/Free-plan numbers, checked 2026-11-15. KV: 100,000 reads per day, 1,000 writes per day, 1 GB. D1: 5 million rows read per day, 100,000 rows written per day, 5 GB, 10 databases. R2: 10 GB-months, 1 million Class A operations and 10 million Class B operations per month. KV and D1: past the Free cap, calls fail. R2: you turn on an R2 subscription through the dashboard checkout flow; usage above the free tier is billed. This lesson is not a quote. Sources: https://developers.cloudflare.com/kv/platform/pricing/ https://developers.cloudflare.com/d1/platform/pricing/ https://developers.cloudflare.com/r2/pricing/ https://developers.cloudflare.com/r2/get-started/Free-plan numbers, checked 2026-11-15. KV: 100,000 reads per day, 1,000 writes per day, 1 GB. D1: 5 million rows read per day, 100,000 rows written per day, 5 GB, 10 databases. R2: 10 GB-months, 1 million Class A operations and 10 million Class B operations per month. KV and D1: past the Free cap, calls fail. R2: you turn on an R2 subscription through the dashboard checkout flow; usage above the free tier is billed. This lesson is not a quote. Sources: https://developers.cloudflare.com/kv/platform/pricing/ https://developers.cloudflare.com/d1/platform/pricing/ https://developers.cloudflare.com/r2/pricing/ https://developers.cloudflare.com/r2/get-started/
Không phải báo giá. Đối chiếu docs và dashboard. Kiểm tra lần cuối: 2026-11-11.Not a price quote. Check the docs and the dashboard. Last checked: 2026-11-11.Not a price quote. Check the docs and the dashboard. Last checked: 2026-11-11.
Thuật ngữGlossaryGlossary
KVKVKVi
Kho khóa-giá trị. Đọc theo một key, không phải bảng SQL.A key-value store. You read by one key, not with a SQL table.A key-value store. You read by one key, not with a SQL table.
MigrationMigrationMigrationi
File SQL đổi cấu trúc D1. Chạy local rồi mới chạy remote.A SQL file that changes the D1 shape. Run it locally, then on the remote database.A SQL file that changes the D1 shape. Run it locally, then on the remote database.
Lab nằm ở bài riêng. Đọc ý chính trước, rồi mở lab.Labs live on their own pages. Read the main ideas, then open a lab.Labs live on their own pages. Read the main ideas, then open a lab.
Ví dụ chính thức từ Cloudflare Resources — gợi ý theo chủ đề bài học trong lộ trình này.Official examples from Cloudflare Resources — matched to this lesson within this path.Official examples from Cloudflare Resources — matched to this lesson within this path.
Trong phần 2, Kristian mở rộng trên môi trường hiện có được xây dựng trong phần 1, bằng cách cho bạn thấy cách tích hợp các mô hình AI mới và giới thiệu các thông số mới cho phép bạn tùy chỉnh cách images được tạo ra.
In part 2, Kristian expands upon the existing environment built in part 1, by showing you how to integrate new AI models and introduce new parameters that allow you to customize how images are generated.
នៅក្នុងផ្នែកទី 2 Kristian ពង្រីកលើបរិស្ថានដែលមានស្រាប់ដែលបានសាងសង់ក្នុងផ្នែកទី 1 ដោយបង្ហាញអ្នកពីរបៀបបញ្ចូលគំរូ AI ថ្មី និងណែនាំប៉ារ៉ាម៉ែត្រថ្មីដែលអនុញ្ញាតឱ្យអ្នកប្ដូរតាមបំណងពីរបៀបដែល images ត្រូវបានបង្កើត។
Học xong hoặc muốn đổi hướng?Finished or want a different path?Finished or want a different path?
Ba lộ trình độc lập — mỗi lộ trình chỉ gồm bài học và tài liệu trong phạm vi đó. Chọn lộ trình khác khi sẵn sàng, không cần học song song.Three independent paths — each includes only lessons and materials for that scope. Switch when you are ready; no need to study paths in parallel.Three independent paths — each includes only lessons and materials for that scope. Switch when you are ready; no need to study paths in parallel.