API Reference¶
Complete reference for FoundationDB client libraries. Choose your language to get started.
-
Python
Official
Pythonic API with decorators and context managers. Best for rapid development and scripting.
-
Java
Official
Java client with CompletableFuture async support. Ideal for JVM-based applications.
-
Go
Official
Idiomatic Go bindings with error handling. Perfect for microservices and cloud-native apps.
-
C
Official
Low-level C API for maximum control. Foundation for all other bindings.
-
Ruby
Official
Official Ruby bindings shipped with the FoundationDB source. Maintained by Apple.
-
Rust
Community
Community-maintained Rust bindings with async support.
-
Node.js
Community
Community-maintained Node.js bindings.
-
.NET
Community
Community-maintained .NET client library.
API Versioning¶
All clients must specify an API version at startup. This is required before any other FDB operations:
Why API Versioning?
API versioning ensures your application continues to work correctly even as FoundationDB evolves. Code written for API version 710 will behave identically whether running on FDB 7.1 or 7.3.
Common Operations¶
Opening a Connection¶
Writing Data¶
Reading Data¶
Atomic Increment¶
Common Concepts¶
All language bindings share these core concepts:
| Concept | Description |
|---|---|
| Database | Connection to the FDB cluster |
| Transaction | Unit of work with ACID guarantees |
| Keys/Values | Byte strings (arbitrary binary data) |
| Futures | Handles for async operations |
| Tuple Layer | Type-aware key encoding |
| Directory Layer | Hierarchical key organization |
Transaction Guarantees¶
Every transaction in FoundationDB provides:
- Atomicity: All operations succeed or fail together
- Consistency: Database moves between valid states
- Isolation: Transactions don't see each other's uncommitted changes
- Durability: Committed data survives failures
Transaction Limits
- 5 second default timeout
- 10 MB transaction size limit (covers writes and conflict range keys, not read values — see details)
- 10 KB max key size
- 100 KB max value size
Error Handling¶
All bindings handle transient errors through automatic retry:
| Error Code | Name | Action |
|---|---|---|
| 1007 | past_version | Retry automatically |
| 1009 | future_version | Retry automatically |
| 1020 | not_committed | Retry automatically |
| 1021 | commit_unknown_result | May need manual check |
| 2000 | client_invalid_operation | Fix code |
See individual language pages for error handling details.