Beyond Generic: Building a Blockchain-Native Load Balancer from Scratch

Kevin Dwyer
June 23, 2025
3 min read
In our last post, we explained how Ankr RPC migrated from Cloudflare to Asphere’s private global fiber network, gaining control, cutting latency by up to 80%, and improving users' privacy. But the physical network is only half the story.
The other half? A custom-built, Go-based load balancer, purpose-engineered for blockchain RPC.
Why We Built Our Own Load Balancer
Generic Layer 7 load balancers (like HAProxy, Envoy, or NGINX) are great for typical web apps. But blockchain traffic isn’t typical. We needed a system that could make routing decisions not just based on availability or region, but on protocol-specific context like:
- Is the node full or archive?
- What’s its latest block height?
- What’s the regional latency and consistency window?
- Is the request cacheable or stateful?
This level of decision-making simply isn’t supported by generic tools.
“We didn’t need a better proxy; we needed a smarter coordinator that understands blockchains at the protocol level. So we built one.”
— Peter Stewart, Head of Infrastructure, Ankr
Inside the Ankr RPC Load Balancer
Our new load balancer is written in Golang. It combines a proprietary core architecture with carefully selected open-source libraries. It's designed from the ground up with blockchain routing intelligence baked in.
Key Features
- Protocol-Aware Routing: It knows which nodes support full vs. archive queries, and routes accordingly – no unnecessary retries or timeouts.
- Block Height Tracking: Nodes that fall behind can be automatically deprioritized, even before health checks fail. This ensures users always hit the freshest data.
- Geo-Aware Latency Scoring: Combines real-time RTTs with region-aware thresholds to minimize response time and maintain data consistency across zones.
- Smart Caching for Public Endpoints: Common static calls (e.g., eth_chainId, net_version, or block headers) are cached intelligently to reduce unnecessary load on upstream nodes.
- Failover + Load Shedding: If a region’s capacity is strained, traffic can be rerouted cross-region with protocol-aware fallbacks, without dropping queries.
- Observability Built-In: All routing decisions are logged with metadata, enabling precise troubleshooting and per-endpoint metrics.
Tailored for Blockchain Reality
This isn’t a toy project or academic prototype. It was developed under fire, serving millions of live requests per minute, across dozens of chains, for some of the largest dApps and rollups in the space.
“We’ve built a system that doesn’t just route requests, it understands blockchain RPC workloads deeply. It knows how to prioritize freshness, region, and type of query in a way generic load balancers never will.”
— Stanley Wu, CTO, Ankr
What This Means for Users
- Faster Queries: Smarter routing reduces tail latency and minimizes stale responses.
- Fewer Errors: Fallbacks and height-awareness mean fewer retries and fewer 5xxs.
- Better Scaling: Caching common queries and distributing load by query type keeps the system stable under peak traffic.
Test Ankr’s endpoints now for 75+ blockchains →
Part of Our Larger Infra Evolution
This load balancer is part of Phase 4 of our infrastructure evolution, working in tandem with Asphere’s global fiber network to deliver high-performance, privacy-preserving blockchain RPC.
And we’re not done yet.
Soon we’ll integrate this system with AI-based traffic shaping, more advanced caching strategies (including optimistic block propagation), and decentralized telemetry from node operators.
Want to Go Deeper?
We’re planning a technical deep dive soon, including: Architecture diagrams, Performance benchmarks vs traditional L7 proxies, Lessons learned scaling Go in high-throughput environments, How to adapt this system to new protocols (e.g., Solana, Cosmos, zkEVM)
- Stay tuned for part 3: Inside the architecture
- Get started with Ankr RPC
- Work with the Asphere team
Join the Conversation on Our Channels!
Twitter | Telegram | Substack | Discord | YouTube | LinkedIn | Reddit | All Links
Similar articles.

Cloud Outages & Crypto: Improving Resilience & Decentralization for Unstoppable Systems

Kevin Dwyer
April 24, 2025
On April 15, 2025, a familiar fault line reappeared beneath the foundations of the Web3 ecosystem.
Amazon Web Services (AWS), the dominant force in global cloud...

Behind Our Global Fiber Network: Creating Smarter, Faster, Stronger Web3 Infrastructure

Kevin Dwyer
June 23, 2025
At Ankr, performance and privacy aren’t trade-offs; they’re prerequisites. That’s why, nine months ago, we made one of the most ambitious infrastructure upgrades in...