Hey folks ![]()
Quick update on Bedrock! Just released v0.3.0-rc4 with some major API improvements based on community feedback.
What changed:
The transaction API got much cleaner. Instead of threading a transaction handle everywhere:
# Before - explicit transaction threading
transaction(fn tx ->
put(tx, "user:123", user_data)
get(tx, "config:app")
end)
# After - implicit context + Ecto-style returns
{:ok, config} = transact(fn ->
put("user:123", user_data)
config = get("config:app")
{:ok, config}
end)
Subspaces are no more! The new Keyspace system replaces the old Subspace concept and features built-in encoding support:
# Works great with the directory layer
{:ok, app_dir} = Directory.create_or_open(["app"])
users = Keyspace.partition(app_dir, "users", key_encoding: Tuple, value_encoding: BERT)
# Familiar things are still here
alice_key = users |> Keyspace.pack({"alice", 42}) # still makes keys, but you get more control over *how*
# gets / puts / etc. use the Keyspace as context for understanding how to encode and decode your data
%{name: "John", age: 23} = Repo.get(users, 42)
:ok = Repo.put(users, 42, %{name: "John", age: 23})
# Range operations will decode and values for you, too, if you want:
Repo.get_range(users) |> Enum.to_list()
[
{42, %{name: "John", age: 23}}
{63, %{name: "Jane", age: 25}}
]
Also simplified conflict management, improved error handling, and streamlined the range operations.
Why this matters:
These changes make Bedrock much more ergonomic for daily use while keeping all the other goodness intact. The API now feels more “Elixir-native” rather than being a direct port of FoundationDB patterns.
The encoding system is particularly nice - you can plug in custom serialization for keys/values while the keyspace handles encoding automatically. Great for when you want structured data but it gets out of your way if want to manage binary keys and values directly. It’s made the class scheduling example very succinct.
This version focuses on the concrete improvements users will see, shows before/after code examples, and explains why the changes matter for real applications. The suggestions here have been phenomenal, and I’ve tried my best to integrate them all.
Always interested in more feedback, especially if you’ve worked with FoundationDB or other distributed stores!






















