How to run FoundationDB on a Mac?

I thought I’d ask here, perhaps somebody has a magic recipe. I was planning to migrate my app from RethinkDB to FoundationDB, and did some work towards that a couple of years ago. But as I wanted to pick up and complete the work, I found out that I can’t, because I am unable to run FoundationDB on my development machine, which is a Mac with an M1 (Apple Silicon) processor.

I’m puzzled, because FoundationDB seems to be developed at Apple, and I’m guessing most developers have Apple Silicon machines by now? Am I missing something?

I commented on a GitHub issue from 2020: Support Apple Silicon · Issue #4111 · apple/foundationdb · GitHub — but I thought I would also ask here, perhaps there is a trick that somebody uses.

In my case, I deploy on Linux, but my application is developed on a Mac in a local JVM, with a couple of supporting Docker containers. I can run the fdb servers in Docker (assuming arm64 is supported as an architecture, but if local .so libs are required, these need to be accessible natively to the JVM.

Darwin does not support KAIO, try to pass disable_posix_kernel_aio=1 to both fdbserver process and fdbclient (with set knob). If you use fdbcli also pass this knob.

I think mac m1 support is pretty much there for 7.1+, but you need to build from source currently. Several developers are using mac m1’s and building locally (basically all testing happens on linux though).

1 Like

Well, that’s good news! At least I know I’m not the only one that wants to use FoundationDB for development on a Mac machine :slightly_smiling_face:

BTW, making fdb fully work on MacOS is perhaps unnecessary — a working arm64 docker container would be plenty enough (the current official docker container is intel-only). It’s not about being native or particularly fast, it’s about being able to do local development at all.

I think you can get pretty far with the x86_64 MacOS package (.pkg file) and Rosetta2 then. I was able to install it (I had to click through a warning about Apple not being able to verify it which is a bit silly), and then I was able to load libfdb_c from the python bindings as long as I did arch -x86_64 python3

I have been publishing an arm64 image of FoundationDB + Lionrock (hence using gRPC to access FDB) on Docker Hub for a while now.

Perfect for unit tests that spins up a container on my M1 mac, run some tests and discard.