Revenir au blog

Follow and Subscribe

Disponible uniquement en anglais

Cette page n'est actuellement disponible qu'en anglais. Nous nous excusons pour la gêne occasionnée, merci de revenir sur cette page ultérieurement.

Unparalleled Performance: Bring Your C++ Logic to the Edge

Kat Marchán

Ingénieur logiciel principal, WebAssembly

Sy Brand

Ingénieur logiciel principal, WebAssembly

CODE - Fastly

We’re excited to announce the Beta release of the official C++ SDK for Fastly Compute.

For developers building the most demanding, performance-critical applications, C++ remains the gold standard. Today, we’re combining that unparalleled control and speed with the power of our global network and WebAssembly (Wasm) runtime. This new SDK is more than just another language option; it’s a direct unlock for anyone looking to achieve true near-native performance and deploy decades of highly optimized, battle-tested C++ code directly at the edge.

Familiarity: All the looks and feels of C++

The C++ SDK is designed to feel familiar to C++ developers while providing idiomatic bindings to Fastly’s powerful edge primitives like KV Stores, Config Stores, and external service calls.

Unlocking New Possibilities

The C++ SDK isn't just about micro-optimizations; it's about enabling entirely new capabilities by allowing core business logic to execute at the speed of the Fastly network. Additionally, it empowers development teams to manage the edge using the same language they use internally. This helps streamline workflows, enhances productivity, and accelerates time-to-market for business-critical applications. Here are some use case ideas to get your brain juices flowing:

Gaming: The C++ SDK lets you use the same language for your core, latency-sensitive logic, and deploy it globally for minimum player latency. Consider use cases such as edge-hosted, low-latency matchmaking APIs, player state synchronization, and custom authentication logic.

Industrial IoT & High-Tech: Processing vast, high-volume data streams from distributed devices requires maximum throughput and efficiency before the data even hits your origin. Use C++ logic for high-performance telemetry ingestion and filtering services, real-time data analysis, and predictive maintenance calculations at the ingest point.

Interactive Media: Leverage existing, hyper-optimized C++ libraries developed over decades, eliminating the need for costly rewrites in other languages. Cool use cases to consider include real-time manifest manipulation and ad-stitching API logic, complex cryptographic operations, and compression/transcoding algorithms.

Why C++ and Wasm are the Edge Computing Power Couple

At Fastly, our Compute platform is built on a modern, native WebAssembly runtime. This architecture provides microsecond cold-start times—orders of magnitude faster than traditional container or VM-based approaches. This is our core architectural advantage, and C++ allows you to leverage it to the fullest.

C++ compiles down to some of the smallest, fastest, and most efficient Wasm bytecode possible. This low-level control means that you benefit from:

  • Amazing Performance: C++ gives you the deterministic memory and CPU control necessary for the most demanding edge applications. For computationally intensive tasks, this means achieving the fastest possible execution time and the lowest latency for your users.

  • Enhanced Security: The inherent memory-safety features of the Wasm sandbox eliminate a primary class of security vulnerabilities often associated with native languages like C++. When you run C++ on Fastly Compute, the WebAssembly System Interface (WASI) isolates your code, keeps it memory-safe, and only allows it to access the precise capabilities you grant it. You get C++ speed with modern cloud security.

  • Reduced Operational Cost: Superior CPU efficiency means your application does more work with less compute time, resulting in lower costs on the platform.

A Polyglot Advantage

We believe in giving developers the right tool for the job. The C++ SDK fully supports a polyglot architecture. You can write your performance-critical data processing or computation components in C++, and seamlessly integrate them with networking or orchestration logic written in a language like Rust or JavaScript. This means:

  • Use C++ for the heavy lifting (e.g., image resizing logic).

  • Use JavaScript/TypeScript for the simple request/response handling.

  • Fastly’s implementation of Wasm allows these components to communicate efficiently.

Handling Asynchronous Requests

C++ on the edge must handle network operations asynchronously to maintain performance without blocking the event loop. Our SDK provides a clean, modern C++ interface for these operations.

ESI and VCL Compatibility

For customers migrating from VCL or integrating with our Edge Side Includes (ESI, see example) capabilities, the C++ SDK offers powerful control. The implementation of ESI support is an example of the polyglot nature of Wasm, wrapping up C++ callbacks to be called from Rust.

Get Started Today

The Fastly C++ SDK is now in Beta for your most demanding workloads. We encourage you to dive in and test its performance with your existing C++ code. Connect with other testers and submit any issues here.

Start building your first C++ Compute service today. Visit the GitHub repo.

Also, visit our docs, which include code examples to help you get started.