Skip to main content

One post tagged with "Cloud Infrastructure"

View All Tags

· 8 min read
Arkin Eliezer Julijanto

Meta Description: A real-world migration from DigitalOcean to Hetzner cut monthly costs from $1,432 to $233 — with zero downtime. Here's the playbook and what every startup should know.

The Cloud Pricing Trap No One Talks About​

If you're running production workloads on DigitalOcean, AWS, or any major cloud provider, you might be overpaying by thousands of dollars a month — and not even realize it.

That's exactly what happened to Isa Yeter, a developer running a full production stack on DigitalOcean. His bill: $1,432/month for a single droplet. After migrating to a Hetzner dedicated server, he pays $233/month — saving $14,388 per year. And the new hardware is more powerful in every dimension.

This isn't a sponsored post. It's a pattern every bootstrapped founder and cost-conscious engineering team should understand.

The Numbers That Should Make You Rethink Your Cloud Bill​

Here's the side-by-side comparison:

DigitalOceanHetzner AX162-R
CPU32 vCPUAMD EPYC 9454P (48 cores / 96 threads)
RAM192 GB256 GB DDR5
Storage600 GB SSD + 2×1 TB volumes1.92 TB NVMe Gen4 RAID1
Monthly Cost$1,432$233

84% cost reduction. Better hardware. This isn't a subtle optimization — it's a fundamental pricing gap.

Why Cloud Providers Charge So Much More​

Cloud platforms like DigitalOcean, AWS, and GCP charge a premium for:

  • Elasticity — Spin up, scale down, pay per hour. Great for variable workloads.
  • Managed services — Databases, Kubernetes, object storage with zero ops overhead.
  • Global distribution — Deploy to 15+ regions instantly.
  • Ecosystem integrations — Monitoring, IAM, networking all wired together.

But here's the thing: most startups don't use most of these features. If you're running a steady-state production server that stays on 24/7, you're paying for elasticity you never use. If your database is self-hosted MySQL on the same box, you're not using managed services. If all your users are in one region, global distribution doesn't matter.

For steady-state workloads, dedicated servers from providers like Hetzner deliver significantly better price-to-performance. You're paying for hardware, not abstraction layers.

The Migration Playbook: Zero Downtime in 6 Phases​

The original migration (documented in detail on Isa's blog) moved a complex production stack — 30 MySQL databases (248 GB), 34 Nginx sites, GitLab EE, Neo4j, and live mobile app traffic — with zero user-facing downtime. Here's how:

Phase 1: Full Stack Mirror​

Replicate every service on the new server with identical configuration — Nginx compiled from source with the same flags, PHP with matching .ini files, MySQL 8.0, Neo4j, GitLab EE, Node.js, Supervisor, and Gearman. SSL certs were rsync'd from the old server and force-renewed after cutover.

Phase 2: File Sync with rsync​

65 GB of web files (1.5 million files) cloned with rsync --checksum for integrity. A final incremental sync right before cutover caught any changes.

Phase 3: MySQL Replication (The Critical Piece)​

Instead of dump-and-restore (which would mean downtime), they set up live master-to-slave replication. mydumper handled the initial bulk export with 32 threads, turning what would have been days of mysqldump into hours. The new server became a read replica, staying in real-time sync until the cutover moment.

Phase 4: DNS TTL Reduction​

All A record TTLs were dropped from 3600 to 300 seconds via the DigitalOcean API — without touching MX/TXT records (changing mail TTLs causes deliverability issues). After one hour, DNS changes would propagate in under 5 minutes.

Phase 5: Reverse Proxy Safety Net​

A Python script converted all 34 Nginx configs on the old server into reverse proxy configs pointing to the new server. During DNS propagation, any request hitting the old IP was silently forwarded to the new server. No user ever saw a disruption.

Phase 6: DNS Cutover​

One script hit the DigitalOcean API and flipped all A records in ~10 seconds. The old server stayed as a cold standby for one week, then was decommissioned.

The Tricky Problems You'll Hit (And How to Solve Them)​

Migrations never go perfectly. Here are the real problems encountered:

MySQL 5.7 → 8.0 schema mismatch. The mysql.user table had 45 columns instead of 51, breaking authentication. Fix: mysqld --upgrade=FORCE. The sys database also imported as tables instead of views — dropping it and re-running the upgrade resolved it.

SUPER privilege bypasses read_only. All 24 app users had SUPER privilege, which silently bypasses read_only = 1 on the replica. This meant writes were going through when they shouldn't. Revoking SUPER from all users fixed it.

Replication duplicate key errors. Because the dump was taken in two passes, binlog replay tried to insert rows that already existed. Fix: SET GLOBAL slave_exec_mode = 'IDEMPOTENT' to silently skip conflicts.

GitLab webhooks still pointed to old IP. After migration, many project webhooks were hardcoded to the old server. A bulk update script via the GitLab API fixed them all.

When Should You Actually Migrate?​

This approach isn't for everyone. Here's when it makes sense:

Migrate if:

  • Your workloads are steady-state (always-on, predictable resource needs)
  • You're self-hosting databases and services (not using managed offerings)
  • Your users are concentrated in one or two regions
  • Your monthly cloud bill exceeds $200-300
  • You have DevOps capacity to manage a bare-metal server

Stay on cloud if:

  • You need auto-scaling for variable traffic
  • You rely heavily on managed services (RDS, CloudFront, etc.)
  • You need multi-region deployment
  • Your team has zero ops bandwidth
  • Your infrastructure changes frequently (infra-as-code, ephemeral environments)

The Startup Math That Matters​

Let's make it concrete. If you're a bootstrapped startup burning $1,500/month on cloud:

  • Annual cloud cost: $18,000
  • Hetzner equivalent: ~$2,800
  • Annual savings: $15,200
  • That's 1-2 extra months of runway just from switching hosting

For funded startups, this is a rounding error. For bootstrapped founders, it's the difference between hiring a contractor or not. Between extending runway by a quarter or not. Between profitability and not.

Practical Steps to Evaluate Your Own Migration​

  1. Audit your current bill. Break down exactly what you're paying for. Identify steady-state vs. elastic resources.

  2. Check Hetzner's dedicated server pricing. Compare equivalent specs to your current setup. The gap might surprise you.

  3. List your cloud dependencies. Managed databases, load balancers, object storage — anything that would need a self-hosted replacement.

  4. Estimate migration effort. A simple LAMP stack? A weekend. A microservices architecture with managed everything? Weeks.

  5. Calculate the ROI. If the migration takes 40 hours and saves $1,000/month, it pays for itself in one month of a senior dev's time.

  6. Use the open-source playbook. Isa published all migration scripts on GitHub with DRY_RUN mode so you can preview changes safely.

Conclusion​

Three takeaways:

  1. Cloud pricing includes a massive "convenience tax" — if you're not using the convenience features, you're just paying the tax.
  2. Zero-downtime migration is achievable — MySQL replication + reverse proxy + scripted DNS is a proven pattern.
  3. For bootstrapped startups, infrastructure costs are a lever — cutting 84% from your hosting bill is the easiest runway extension you'll ever get.

Before your next cloud renewal, do the math. The savings might fund your next hire.

FAQ​

Q: Is Hetzner reliable enough for production workloads? A: Yes. Hetzner has been operating since 1997, runs multiple data centers in Germany, Finland, and the US, and is widely used in production across Europe. They offer enterprise-grade SLAs on dedicated servers.

Q: What about managed services like RDS or CloudFront? A: You'd need to self-host equivalents (MySQL/PostgreSQL directly, MinIO for S3-compatible storage, etc.). This adds ops overhead — factor that into your cost calculation. The break-even point depends on your team's capacity.

Q: How much downtime should I expect during migration? A: With the replication + reverse proxy approach described here, zero downtime is achievable. The critical path is: set up replication → convert old server to proxy → flip DNS. Users never see a disruption.

Q: Does this approach work for AWS/GCP too, not just DigitalOcean? A: Absolutely. The migration pattern (replication, proxy, DNS cutover) is cloud-agnostic. The savings will vary based on your current provider and instance types, but the gap between cloud pricing and dedicated servers is consistent across all major providers.


Arkin is a startup founder and developer building AI-powered products. He writes about infrastructure cost optimization, developer tooling, and the practical side of running production systems on a budget.