Looking back, I've spent nearly a decade tinkering with blogs and various websites. While maintaining 0xFFFF, I've experimented with different hosting solutions. The services I currently use have evolved into what I believe is an optimal setup for balancing speed and cost.
If you're looking to build your own website on a budget while maintaining solid performance, this guide might give you some useful ideas.
Running a website requires two main capabilities: domain and DNS resolution, plus servers to handle browser requests. The server side breaks down into several distinct roles:
Traffic handling - Gateways and reverse proxies receive user traffic and route it to the right services
Static pages - HTML pages and server-side rendering for Jamstack applications
Assets - JavaScript and CSS files, typically distributed via third-party CDN domains to speed up page loads and reduce dependency on the main site
Media files - The biggest bandwidth consumer, usually hosted on object storage and distributed through CDN
Dynamic services - When your site needs interactivity, you need services to handle API endpoints
Dynamic services split into two types: stateless services that can be created and destroyed anytime, and stateful services that require persistent data storage. Some services need database support like MySQL, PostgreSQL, or Redis for caching.
Cloud computing has matured enough that there's a service for practically everything. The goal here is to share what I'm currently using and the reasoning behind these choices.
For DNS, I went with DNSPod. The key advantage is their mainland China resolution nodes, and their professional tier supports global server resolution at a reasonable price. What really matters is their fine-grained geographic routing capability. This is incredibly valuable for overseas-hosted sites - you can deploy optimized routes specifically for mainland users. It's more flexible than Cloudflare or ClouDNS in this regard.
For the gateway layer, the priority is getting as close to users as possible. You want to use optimal routes for different geographic regions to minimize network uncertainty and maintain stable connections. Your options are: CDN services with dynamic request optimization, cloud servers with good network conditions, or modern edge computing providers like Vercel and Fly.io that often optimize links between edge nodes.
I combine approaches two and three. An Alibaba Cloud Hong Kong lightweight server handles mainland traffic, while Fly.io picks up traffic from other regions. DNSPod handles the geographic routing. As of late 2023, Alibaba Cloud HK lightweight servers have excellent network quality - mainland access latency stays under 50ms. Fly.io brings a global edge computing network to the table. Theoretically, I only deploy services in desired regions, and other regions can receive requests through edge nodes before internally forwarding to the service instance location, making network requests more predictable. Together, they complement each other's strengths inside and outside mainland China.
When it comes to managing high-performance content delivery at scale, 👉 Bunny's edge network provides robust infrastructure for global reach. Their platform handles the complexity of worldwide distribution while keeping costs manageable for independent site owners.
For reverse proxy software, I use Caddy Server. Whether on lightweight servers or Fly.io, simple configuration enables traffic forwarding and automatically handles HTTPS certificate issuance. It's straightforward and convenient.
Most websites and web apps are essentially static HTML pages combined with various scripts, stylesheets, images, and audio resources. Hosting static pages and resources is the most basic website need.
There's no real barrier here - it's mainly about maintenance costs. Whether you choose Vercel, Fly.io, GitHub Pages, Cloudflare Pages, or run your own HTTP server, they all work fine. Some services even provide edge nodes optimized for static page rendering.
I mostly use Vercel these days. This blog and 0xFFFF Wiki both live there. It's simple, direct, and convenient - push code and it automatically triggers builds and deployment. Zero hassle.
After browsers download HTML, they typically need to load scripts, stylesheets, and images, creating additional traffic consumption. Gateway layer bandwidth is relatively expensive and access speed can be unpredictable. Usually, you'll separately cache resources outside HTML based on access patterns. This is a major CDN use case - CDN uses high bandwidth and low cost to offload source traffic and improve user experience.
For this, I primarily chose Bunny CDN, plus Tencent Cloud CDN for mainland static resource acceleration. The former excels in price and speed; the latter, combined with registered domains, delivers better mainland access experience. Speed improvement is the main consideration here.
Website static resources typically split into two parts. One part is integral to the site's business logic - this can be preprocessed and handed to hosting services. The other part includes user uploads and backend-processed images generated during operation. This type of data fits perfectly in object storage.
Personal webmasters don't have many choices. The pioneer is naturally Amazon S3, though it's notoriously expensive - not something typical students can afford. Then there are domestic giants' COS/OSS services, Cloudflare R2, and Backblaze B2.
Cloudflare R2 is an excellent choice. Its free traffic mechanism suits newcomers perfectly for experimentation. However, Cloudflare requires bound domains to point NS records to their DNS servers, which conflicts with DNSPod's routing strategy. Reluctantly had to pass.
After trying various options, I discovered Blackblaze B2. This service has tremendous cost advantages. While not as sweet as Cloudflare's CDN-free traffic, pairing it with 👉 Bunny's content delivery network produces excellent results. After two weeks of heavy use on the main 0xFFFF site, traffic only hit around 2GB, costing $0.04.
Bunny CDN and Backblaze B2 have a partnership that optimizes the integration experience. B2 even provides tutorials and articles - quite thoughtful and detailed.
For more powerful websites, static files won't cut it. You need backend services, which typically provide these capabilities:
Dynamically generate HTML
Generate responses based on API requests to drive business logic
Generate other resources as needed (images, downloadable files, etc.)
As mentioned earlier, dynamic services come in two flavors:
Stateless services - Fly.io fits better here. It can deploy Docker images as Firecracker virtual machines with one click and rapidly deploy to appropriate regions, reducing network latency impact
Stateful services - A dedicated VPS works better. I continue using Alibaba Cloud Hong Kong lightweight servers. For modest business scale, one machine suffices. Many options exist: Tencent Cloud, AWS LightSail, Vultr, Linode - what matters most is stability and reliability
A viable direction is making services as stateless as possible. Deploying to edge nodes offers speed advantages (though you need to consider state sharing between different regions).
I originally preferred deploying website databases locally, but after accidentally causing forum data loss, I've become more cautious. Daily backups need strengthening, and I'm considering handing database maintenance to professional DBA services.
These services are typically very expensive, but thanks to the internet, low-cost serverless hosted database solutions exist. Currently, TiDB Cloud and PlanetScale free tiers provide adequate coverage. The slight downside is public network database access increases latency, requiring good caching solutions. Currently, only Singapore and Tokyo data centers serve the Asia-Pacific region, which might require moving compute instances to Singapore (the gateway layer can stay put).
Some sites depend on Redis for caching or as a database. Then you need backup and hosting solutions. Upstash Redis looks promising - Fly.io partnered with them for an internal solution.
If your business involves heavy SQL queries (blogs, forums, etc.), you still need single-machine database deployment, so focus on backups. My approach: add scheduled tasks to database containers, regularly mysql dump the latest SQL, gzip compress for backup, then save to a dedicated backup object storage bucket. I recommend Duplicati for backup software and use Tencent Cloud COS for storage buckets.
Building a personal website doesn't require breaking the bank. By strategically combining services that excel in their specific roles, you can achieve professional-grade performance while keeping costs minimal. The key is understanding what each service does best and how they work together.
Geographic routing, edge computing, and smart caching transform user experience from acceptable to excellent. Start simple, monitor what matters, and scale the components that need it most.