Squeezing every millisecond: How we rebuilt the Datadog Lambda Extension in Rust
Datadog rewrote its AWS Lambda Extension from a Go build of the full Datadog Agent into a purpose-built Rust sidecar (Project Bottlecap), cutting cold start overhead from about 450 ms to 70 ms, memory from 128 MiB to 77 MiB, and binary size from 55 MB to 7 MB. The team benchmarked every PR against cold start overhead and hand-wrote AWS API calls and signatures instead of using SDKs. To cover both API-style and batch workloads, the extension supports configurable flush strategies: flushing at the end of an invocation, racing it, flushing periodically, or combining these. Rollout used a roughly 4 ms startup check that fails over to the bundled legacy extension when it detects unsupported configurations, with telemetry on fallbacks guiding which features to support next.
Related posts
- Benchmarking AWS Lambda Cold Starts Across JavaScript Runtimes
Deno mediumAdeptAcross Express, Fastify and Hono URL-shortener apps deployed to AWS Lambda via Docker and the Lambda Web Adapter, Deno 1.45 showed lower cold-start Init Duration than Node 22 and Bun 1.1, with the Lambda-managed Node runtime included as a reference. Cold starts were forced by changing an environment variable between invocations and measured from CloudWatch. Hyperfine runs on a GCP VM confirmed the gap: Deno started 1.33–1.77x faster, with Hono at about 58 ms versus roughly 100 ms for Node and Bun. The key optimization is to prepopulate Deno's caches (npm/JSR modules, module graph, transpiled TypeScript, V8 code cache) during Docker image build by running the app once with a timeout. Graviton was slower than x86_64 for all runtimes, and the benchmark comes from Deno's own team.
- How to Migrate from AWS Lambda to Railway
Railway mediumAdeptAn AWS Lambda function can be moved to Railway by packaging it as a container image built on the AWS Lambda Node.js base image and pushing it to Docker Hub. Railway then deploys it as a Docker Image service with a generated public domain. The function is invoked through the Lambda Runtime Interface Emulator path (/2015-03-31/functions/function/invocations), can be tested locally with docker run and curl, and can scale to zero with Railway's App Sleep. Railway has no built-in timeout or retry configuration, so the application must handle these itself, and environment variables and external dependencies have to be recreated in Railway Variables.
- Deno 1.20 Release Notes
Deno mediumAdeptDeno 1.20 cuts JavaScript-to-Rust op call overhead by up to ~60% by using Rust proc macros to generate a dedicated V8 binding per op, eliminating op routing and skipping deserialization of unused arguments; a 1 MB base64 roundtrip drops from ~125 ms to ~3.3 ms. The release also adds automatic gzip/brotli compression of non-streamed HTTP responses, an unstable `deno bench` subcommand (1000 warmup plus 1000 measured iterations by default), and a cross-platform `deno task` runner using a POSIX-like shell subset. Other changes include import maps in the config file, in-memory TLS certs, `Deno.upgradeHttp()`, FFI global statics, opt-in `--trace-ops` for test leak tracing (made opt-in because of a performance regression), `AbortSignal.timeout()`, and stricter default permissions for tests and workers, plus TypeScript 4.6 and V8 10.0.
- How to build a 30M RPS CDN in 30 days with Rust and WASM
Railway mediumAdeptRailway built Hikari, its own CDN with 60 POPs and 180+ nodes, in 30 days. It serves ~1M RPS at peak, has absorbed 30M RPS DDoS attacks, and benchmarks to ~150M RPS. The design centers on safe deployment: a Rust reconciliation-loop sidecar (hikari-keeper) replaces Ansible for node config, BGP announcement and fd-handoff binary upgrades, while per-request business logic runs as versioned wasmtime/WASI guests that can be swapped in seconds without dropping connections. It also covers anycast routing pitfalls with global transit networks, mitigated by BGP community tagging, and a thread-per-core tokio design with thread-local warm guest pools that avoids the ~10μs cold-instantiate cost and cross-core contention.
- Migrating our Messages API to Rust
Anthropic Engineering mediumAdeptAnthropic migrated its production Messages API from Python to Rust, using the live Python service as an oracle because tests were incomplete and the API kept changing. Rust passed about 98% of tests but initially matched only about 24% of production inputs, so they ran the model once and replayed its output to Rust, comparing every pre- and post-model checkpoint piece by piece. Privacy-safe fingerprints grouped differences and dispatched Claude agents to fix them. A partial Rust rewrite of output parsing cut CPU only 8–10% while adding cross-language overhead, so they completed the full rewrite; the Rust API now uses about 70% less CPU per request and cuts median time to first token by about 20%, with no service outage or feature freeze.