FoundationDB Flow Tutorial: Asynchronous Programming with Promises and Futures
By
SchwKatze
Hand-rolled, kettle-boiled, baked to perfection. Worth every minute at the bakery.
Summary
This article is a tutorial on Flow, a programming framework used in FoundationDB (Apple's open-source distributed transactional key-value store). It explains Flow's asynchronous message-passing system built around Promise<> and Future<> data types, which enable components to communicate without blocking. The tutorial covers Flow's new keywords, flow controls, and design patterns for C++ programmers working with FoundationDB's distributed architecture.
Key quotes
· 4 pulledThe essence of Flow is the capability of passing messages asynchronously between components.
The basic data types that connect asynchronous senders and receivers are Promise<> and Future<>.
The sender holds a Promise<X> to, sometime in the future, deliver a value of type X to the holder of the Future<X>.
Flow introduces some new keywords and flow controls. Combining these into workable units also introduces some new design patterns to C++ programmers.
You might also wanna read
Optimizing .NET APIs for High Throughput: Techniques for 1M Requests Per Minute
Article discusses techniques for designing high-throughput .NET APIs capable of handling 1M requests per minute. It covers horizontal scalin
SQLite as a Viable Alternative for Durable Workflow Execution
The article argues that SQLite can replace complex orchestration systems for durable workflow execution in many cases. It builds on DBOS's a
JWT vs Opaque Tokens: A Technical Comparison for API Security Architecture
This article compares JWT (JSON Web Tokens) and opaque tokens for API security, clarifying the common confusion between bearer tokens and JW
How Frontend State Management Becomes a Distributed Monolith as Apps Scale
This article discusses how frontend state management in growing applications can evolve into a "distributed monolith" — where state becomes
A Field Guide to Production-Ready AI Agents: Context Windows, Security, and Drift Monitoring
Karl Mehta presents a field guide for building production-ready AI agents, focusing on four key engineering challenges: context-window disci
The Convergent Architecture of Frontier Agentic Systems
This article from Veso Research analyzes the emerging universal architecture across frontier agentic systems (Claude Code, OpenAI Codex, Gem
