Permazen VS foundationdb

Compare Permazen vs foundationdb and see what are their differences.

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
Permazen foundationdb
10 21
397 13,971
0.8% 1.3%
9.2 9.8
4 days ago 4 days ago
HTML C++
Apache License 2.0 Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

Permazen

Posts with mentions or reviews of Permazen. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-02-01.
  • ORMs are nice but they are the wrong abstraction
    7 projects | news.ycombinator.com | 1 Feb 2024
    The most interesting/fresh approach I've seen to this problem is Permazen.

    https://github.com/permazen/permazen/

    It starts by asking what the most natural way is to integrate persistence with a programming language (Java in this case, but the concepts are generic), and then goes ahead and implements the features of an RDBMS as an in-process library that can be given different storage backends as long as they implement a sorted K/V store. So it can sit on top of a simple in-process file based K/V store, RocksDB, FoundationDB, or any SQL database like PostgreSQL, SQLite, Spanner, etc (it just uses the RDBMS to store sorted key/value pairs in that case).

    Essentially it's a way to map object graphs to key/value pairs but with the usual features you'd want like indexing, validation, transactions, and so on. The design is really nice and can scale from tiny tasks you'd normally use JSON or object serialization for, all the way up to large distributed clusters.

    Because the native object model is mapped directly to storage there's no object/relational mismatch.

  • Permazen: Language-natural persistence to KV stores
    6 projects | news.ycombinator.com | 19 Sep 2023
    Ok, let's change to that from https://permazen.io/ above.

    Usually we go the other way and prefer the project page, but there's clearly not enough info there.

  • How FoundationDB works and why it works
    5 projects | news.ycombinator.com | 18 Sep 2023
  • Figma Is a File Editor
    3 projects | news.ycombinator.com | 13 Jul 2023
    You can use a scalable database that gives you serializable transactions whilst not requiring you to represent your document in the relational model.

    A good example of this architecture would be using FoundationDB [1] with Permazen [2]. In this design there are three layers:

    1. A horizontally scaling sorted transactional K/V store. This is provided by FoundationDB. Transactions are automatically ordered within the cluster.

    2. A network protocol that can serialize database transactions. Permazen has the ability to do this, you can do things like cache reads, HTTP POST transactions and so on. Stuff you can't easily do with SQL databases.

    3. A way to map in-memory objects to/from key/value pairs, with schema migration, indexing and other DB-like features. Permazen also does this.

    Permazen can be thought of as an ORM for KV stores. It's an in-memory library intended to execute on trusted servers (because the KV store can't do any business logic validation). However, for something like Figma where it's basically trusting the client anyway that doesn't matter. Additionally you can do some tricks with the architecture to support untrusted clients; I've explored these topics with Archie (the Permazen designer) in the past.

    The nice thing about this design is that it doesn't require sharding by "file", can scale to large numbers of simultaneous co-authors, and results in a very natural coding model. However, Permazen is a Java library. To use it from a browser would be awkward. That said it has fairly minimal reliance on the JDK. You could probably auto-convert it to Kotlin and then use Kotlin/JS or Kotlin/WASM. But frankly it'd be easier to do that architecture as a real desktop app where you aren't boxed in by the browser's limitations.

    The writeup mentions a couple of reasons for not using a database:

    1. Relational/object mismatch. Permazen+FDB solves this.

    2. Cost of a database vs S3. This is mostly an artifact of cloud pricing. Cloud is highly profitable but most of the margin comes from managed databases and other very high level services, not commodity byte storage. Given that FDB is free you could eliminate the cost gap by just running the database yourself, and especially, running it on your own metal.

    Because Permazen has a pluggable KV backend and because there are backends that write to files, you can have both worlds - a scalable DB in the cloud and also write to files for individual cases where people don't want to store data on your backend.

    https://www.foundationdb.org/ [1]

    https://permazen.io/ [2]

  • FoundationDB: A Distributed Key-Value Store
    13 projects | news.ycombinator.com | 3 Jul 2023
    You can do online schema changes with FDB, it all depends on what you do with the FDB primitives.

    A great example of how to best utilize FDB is Permazen [1], described well in its white paper [2].

    Permazen is a Java library, so it can be utilized from any JVM language e.g. via Truffle you get Python, JavaScript, Ruby, WASM + any bytecode language. It supports any sorted K/V backend so you can build and test locally with a simple disk or in memory impl, or RocksDB, or even a regular SQL database. Then you can point it at FoundationDB later when you're ready for scaling.

    Permazen is not a SQL implementation. Instead it's "language integrated" meaning you write queries using the Java collections library and some helpers, in particular, NavigableSet and NavigableMap. In effect you write and hard code your query plans. However, for this you get many of the same features an RDBMS would have and then some more, for example you get indexes, indexes with compound keys, strongly typed and enforced schemas with ONLINE updates, strong type safety during schema changes (which are allowed to be arbitrary), sophisticated transaction support, tight control over caching and transactional "copy out", constraints and the equivalent of foreign key constraints with better validation semantics than what JPA or SQL gives you, you can define any custom data derivation function for new kinds of "index", a CLI for ad-hoc querying, and a GUI for exploration of the data.

    Oh yes, it also has a Raft implementation, so if you want multi-cluster FDB with Raft-driven failover you could do that too (iirc, FDB doesn't have this out of the box).

    FDB has something a bit like this in its Record layer, but it's nowhere near as powerful or well thought out. Permazen is obscure and not widely used, but it's been deployed to production as part of a large US 911 dispatching system and is maintained.

    Incremental schema evolution is possible because Permazen stores schema data in the K/V store, along with a version for each persisted object (row), and upgrades objects on the fly when they're first accessed.

    [1] https://permazen.io/

    [2] https://cdn.jsdelivr.net/gh/permazen/permazen@master/permaze...

  • Warp: Lightweight Multi-Key Transactions for Key-Value Stores
    5 projects | news.ycombinator.com | 29 May 2022
  • Persism 1.0.1 released - A zero ceremony ORM for Java
    3 projects | /r/java | 2 Mar 2021
    Compare to https://github.com/permazen/permazen ?
  • Introducing Weightless, an extremely easy to use database mapping library for Java
    2 projects | /r/java | 31 Jan 2021
    Did you see https://github.com/permazen/permazen - it's in the same space

foundationdb

Posts with mentions or reviews of foundationdb. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-14.
  • Figma's Databases team lived to tell the scale
    5 projects | news.ycombinator.com | 14 Mar 2024
    Actually, Apple does this for iCloud! They use FoundationDB[1] to store billions of databases, one for each user (plus shared or global databases).

    See: https://read.engineerscodex.com/p/how-apple-built-icloud-to-...

    Discussed on HN at the time: https://news.ycombinator.com/item?id=39028672

    [1]: https://github.com/apple/foundationdb https://en.wikipedia.org/wiki/FoundationDB

  • Maybe Getting Rid of Your QA Team Was Bad
    1 project | news.ycombinator.com | 14 Dec 2023
    Is this the language in question? https://github.com/apple/foundationdb/blob/main/flow/README....
  • WASM by Example
    16 projects | news.ycombinator.com | 15 Nov 2023
    > I wondered if perhaps this WASM use case for a cross-language library was already just as possible and ergonomic using language bindings and maybe thats why this use case doesnt seem like a big deal to people.

    Yeah that’s the reason. You don’t notice it a lot of the time, but FFIs are everywhere already. The most common foreign function interface is basically the ability to call C code, or have functions made available to C code. C is used because everyone knows it and it’s simple. And most languages either compile to native code (eg rust) - which makes linking to C code easy. Or the runtime is implemented in C or C++ (eg V8, Ruby). In languages like that, the standard library is already basically implemented via a FFI to C/C++ code.

    I’ve got an iOS app I’m working on that’s half rust and half swift, with a touch of C in the middle. The bindings work great - the whole thing links together into one binary, even with link time optimizations. But the glue code is gross, and when I want to fiddle with the rust to Swift API I need to change my code in about 4 different places.

    Most FFIs are a one to many relationship in that if you write a clean C API, you can probably write bindings in every language. But you don’t actually want to call naked C code from Ruby or Javascript. Good bindings will make you forget everything is done via ffi. Eg numpy. I haven’t looked at the wasm component model proposal - I assume it’s trying to make this process cleaner, which sounds lovely.

    I maintain the nodejs bindings for foundationdb. Foundationdb bindings are all done via ffi linking to their C code. And the API is complex, using promises and things. I find it really interesting browsing their official bindings to go, Java, Python and Ruby. Same bindings. Same wrapped api. Same team of authors. Just different languages. And that’s enough to make the wrapper wildly different in every language. From memory the Java ffi wrapper is 4x as much code as it is in Ruby.

    https://github.com/apple/foundationdb/tree/main/bindings

  • JDK 21 Release Notes
    6 projects | news.ycombinator.com | 19 Sep 2023
    Isn’t apple server on C/C++?

    They have their own db in that

    https://github.com/apple/foundationdb

  • How FoundationDB works and why it works
    5 projects | news.ycombinator.com | 18 Sep 2023
    > Any meaningful technology is open source.

    Clearly untrue, however FoundationDB is open source, with a permissive license.

    https://github.com/apple/foundationdb

    So is much of the operational tooling for it:

    https://github.com/FoundationDB/fdb-kubernetes-operator

  • FoundationDB: A Distributed Key-Value Store
    13 projects | news.ycombinator.com | 3 Jul 2023
    I don't recall any of those details but the test involved injecting a bogus block device that always returns garbage, and noting that this results in garbage records returned from client queries. And I don't think those kinds of issues have been eradicated, browsing through their github issues there are people trying to recover corrupted clusters. https://github.com/apple/foundationdb/issues/2480
  • Apple/FoundationDB: FoundationDB
    1 project | news.ycombinator.com | 25 May 2023
  • FoundationDB Design Internals
    1 project | news.ycombinator.com | 19 Jan 2023
  • Install FoundationDB in Gentoo
    2 projects | /r/Gentoo | 3 Jul 2022
    For my current job, I have to install FoundationDB (they have a github repo) as a dependency for the project's code.
  • Anna: Key-Value Store for Any Scale
    2 projects | news.ycombinator.com | 29 Apr 2022
    To clarify, FoundationDB has some documented multi-region features, but it's not at all clear that anybody who runs it at scale relies on those multi-region features [1]. Even if they do, it's not obvious they run this Fearless DR mode at any appreciable latency.

    Geo-replication is an area where Anna really shines, and foundation pays severe costs. All of the concurrency control problems have contention footprints on the order of round-trips. Fully optimistic concurrency control needs to expose backoffs quite a few round-trips to be live. Even pessimistic concurrency control requires some number of round trips, probably at least 1.5 optimally, but in practice in most tuned systems, probably 3. A heck of a lot of use cases make sense at 0 global RTTs and don't at 1+. The ability to tell the database how to manage concurrency, and then providing causal is ultimately the best you can do. That's awesome.

    At the end of the day, I have to believe that there's a whole big mess of applications we'll build this, on systems in the portion of the design space Anna is choosing, one day. This is only recently not cutting edge research, but it's definitely still research. We don't know how to model these concepts at a high-level and in a composable way where the masses of software developers can engage with them.

    It's interesting to think about how long ago we were graced with BAYOU [2], that thing was ahead of its time. I suspect it's going to take a little while longer before these sorts of techniques make their way into data storage primitives we think of as part of the standard vernacular, but I believe we'll get there eventually.

    Databases are fun!

    [1] https://github.com/apple/foundationdb/wiki/Multi-Region-Repl...

What are some alternatives?

When comparing Permazen and foundationdb you can also consider the following projects:

Doma 2 - DAO oriented database mapping framework for Java 8+

swift-evolution - This maintains proposals for changes and user-visible enhancements to the Swift Programming Language.

ObjectiveSql - Writing SQL using Java syntax

FASTER - Fast persistent recoverable log and key-value store + cache, in C# and C++.

Persism - A zero ceremony ORM for Java

password-manager-resources - A place for creators and users of password managers to collaborate on resources to make password management better.

hyhac - A HyperDex Haskell Client

fdb-kubernetes-operator - A kubernetes operator for FoundationDB

moditect - Tooling for the Java Module System

fdb-document-layer - A document data model on FoundationDB, implementing MongoDB® wire protocol

QueryStream - Build JPA Criteria queries using a Stream-like API

anna - A low-latency, cloud-native KVS