Bỏ qua menu, vào nội dung chính
Edge Cloud Platform

Cloudflare Workers + Pages

Pitch ngắn

Cloudflare là platform deploy mặc định của Alodev cho web app + API. Cloudflare Pages cho Next.js static export, Workers cho edge functions, R2 cho object storage (rẻ hơn S3 80%), D1 SQLite global. Free tier rộng, scale tự động, latency edge thấp cho user VN.

2+ năm production
Kinh nghiệm đội
10+ dự án
Dự án đã làm
Edge Cloud Platform
Phân loại
01 · Tại sao Alodev

Vì sao chúng tôi dùng Cloudflare

Alodev chuyển sang Cloudflare từ Vercel + AWS từ 2024. Lý do: cost giảm 60-80%, free tier rộng (10M requests/tháng), zero egress fee R2, deploy nhanh + reliable. Đã deploy 10+ dự án trên Cloudflare bao gồm alodev.vn này.

02 · Use cases

6 use case phù hợp với Cloudflare

Mỗi use case kèm ví dụ cụ thể từ dự án thực tế.

01

Static site + landing

Cloudflare Pages: deploy Git push tự động, global CDN, free SSL, unlimited bandwidth. Phù hợp landing, blog, marketing site.

02

Next.js static export

Output Next.js (SSG) deploy lên Pages. Hỗ trợ ISR qua Workers KV cache. Performance đỉnh, cost gần 0.

03

Edge API + serverless functions

Workers chạy code Node.js/TypeScript tại edge (200+ cities). Latency <50ms từ VN. Phù hợp API auth, payment webhook, image proxy.

04

Media + file storage

R2 thay S3: cùng API S3-compatible, rẻ 80%, zero egress fee. Phù hợp media library, backup, CDN origin.

05

Global database with D1

D1 = SQLite distributed globally. Phù hợp app cần data global low-latency. Beta nhưng production-ready cho use case đơn giản.

06

Security + DDoS protection

WAF, bot management, DDoS L3-7. Free tier đủ cho SME. Production-grade security không cần config phức tạp.

03 · Năng lực kỹ thuật

6 năng lực chi tiết

Không phải "có biết Cloudflare" — đây là năng lực sâu, từ kinh nghiệm production.

01

Cloudflare Pages deployment

Git push → auto build → deploy global. Preview URL cho mỗi PR. Custom domain free. SSL auto.

02

Workers runtime

V8 isolate runtime, fast cold start (<5ms). Node.js compatibility layer. TypeScript first. Đã deploy edge functions cho 5 dự án.

03

R2 object storage

S3-compatible API, presigned URL, lifecycle rules, multi-region. Cost: $0.015/GB-month + zero egress.

04

Workers KV + Durable Objects

Distributed key-value cho cache + session. Durable Objects cho stateful (chat, collaboration realtime).

05

Pages Functions

Server-side functions trong Pages site. Cho dynamic routes, API endpoints, form handling — không cần Workers riêng.

06

Custom email routing

Email Workers — auto-process incoming mail. Tạo support@alodev.vn → forward + log + auto-reply tự động.

04 · Dự án đã làm

Production projects với Cloudflare

Click vào case study để đọc chi tiết bối cảnh + giải pháp + KPI.

05 · Tech ecosystem

Stack đi kèm

Các tech thường được dùng cùng Cloudflare trong dự án Alodev.

Cloudflare PagesWorkersR2D1 (SQLite)Workers KVDurable ObjectsWrangler CLI
06 · Khi nào dùng

Đúng / sai cho use case của bạn?

Không tech nào tốt cho mọi case — đây là khi Cloudflare phù hợp và khi không.

Dùng khi
  • Static site + landing page
  • Next.js app với traffic toàn cầu (low latency edge)
  • Cần free tier rộng cho POC / startup
  • API serverless với cold start fast
Không phù hợp khi
  • Database phức tạp (PostgreSQL) → cần managed service khác
  • Long-running tasks (>30s) → AWS Lambda lâu hơn
  • Yêu cầu data residency VN strict (Nghị định 13) → VNG Cloud / Viettel IDC
07 · FAQ

Câu hỏi thường gặp

Cloudflare vs AWS vs Vercel — chọn cái nào?

Vercel: best DX cho Next.js, deploy 1 click, đắt khi traffic lớn. AWS: feature đầy đủ nhất, complex, cost cao nếu không optimize. Cloudflare: edge global, free tier rộng, cost predictable, learning curve trung bình. Cho SME VN: Cloudflare ROI tốt nhất.

Cloudflare có data center VN không?

Có. Cloudflare có 2 PoP (Point of Presence) tại Việt Nam: HAN (Hà Nội), SGN (TP.HCM). Latency từ user VN <30ms cho static + edge functions. Tuy nhiên, origin server không ở VN — nếu cần data residency VN strict, vẫn dùng VNG Cloud / Viettel IDC làm origin.

Cost Cloudflare thực tế cho SME?

Pages: free tier unlimited bandwidth + 500 builds/tháng. Workers: 100k requests/ngày free, sau đó $0.50/1M. R2: $0.015/GB-month + zero egress. D1: free 5GB. SME web app ~50k user/ngày: $0-30/tháng. So với AWS tương đương: $200-500/tháng.

Workers có thay được full backend không?

Cho 70% dự án có. Limitations: max 30s execution time (free), 50ms CPU time. Không phù hợp: heavy computation (image processing), long polls. Phù hợp: API CRUD, auth, payment webhook, image transform, edge cache. Combine với managed DB (Neon, PlanetScale) cho full backend.

Migration từ Vercel/AWS sang Cloudflare khó không?

Tuỳ stack. Next.js static export: dễ (đổi deploy target). Next.js full SSR: cần adapter @cloudflare/next-on-pages. AWS Lambda → Workers: viết lại với Workers API (khác signature). S3 → R2: API tương thích, switch SDK + endpoint. Alodev đã làm 5 migration, mất 1-3 tuần/dự án.

Bước tiếp theo

Dự án Cloudflare của bạn?

30 phút tư vấn miễn phí — khảo sát yêu cầu kỹ thuật, đề xuất kiến trúc phù hợp, ước lượng scope + timeline. Đội senior Cloudflare sẵn sàng.