# How to use KeyDB (https://keydb.dev)



## andrian (Jan 26, 2021)

Hi, who can tell you how to use KeyDB (https://keydb.dev) on FreeBSD?


----------



## SirDice (Jan 26, 2021)

You build a port for it, submit it and then it'll be available. Or find someone willing and able to do that for you.


----------



## andrian (Jan 27, 2021)

SirDice said:


> You build a port for it, submit it and then it'll be available. Or find someone willing and able to do that for you.


Please tell me where to start preparing this package, I'm ready to do it!


----------



## richardtoohey2 (Jan 27, 2021)

Looking at their page they say they are porting to FreeBSD at some point, but they seem to think it's currently Linux-only?









						GitHub - Snapchat/KeyDB: A Multithreaded Fork of Redis
					

A Multithreaded Fork of Redis. Contribute to Snapchat/KeyDB development by creating an account on GitHub.




					github.com
				




_KeyDB can be compiled and is tested for use on Linux.  KeyDB currently relies on SO_REUSEPORT's load balancing behavior which is available only in Linux.  When we support marshalling connections across threads we plan to support other operating systems such as FreeBSD._

"Only available in Linux" makes it seem like a rather difficult project to start on FreeBSD.

It seems to be a fork of Redis, so you could have look at the FreeBSD port of that and see if that helps.

To prepare this package, you need to download the source from github and make it compile and work on FreeBSD and test it etc.

There's the FreeBSD porters handbook, but that doesn't seem to be online at the moment: https://docs.freebsd.org/en_US.ISO8859-1/books/porters-handbook/


----------



## andrian (Jan 27, 2021)

richardtoohey2 said:


> Looking at their page they say they are porting to FreeBSD at some point, but they seem to think it's currently Linux-only?
> 
> 
> 
> ...


Hello, Canada! Thank you.


----------



## andrian (Jan 27, 2021)

richardtoohey2 said:


> So I downloaded this project from the repository and tried to compile it by pre-installing the dependencies, but not all similar dependencies could be found for Freebsd (looking at ubuntu).


For example:

```
sudo apt install build-essential nasm autotools-dev autoconf libjemalloc-dev tcl tcl-dev uuid-dev libcurl4-openssl-dev git
```
So, this successfully install: build-essential (include in FreeBSD from box), nasm, autotools-dev (autotools-20130627), autoconf, tcl, git.
It is difficult to find: libjemalloc-dev, uuid-dev, libcurl4-openssl-dev.


----------



## richardtoohey2 (Jan 27, 2021)

FreeBSD uses jemalloc in base, so might have what's required.  The curl files might be in the existing curl port for FreeBSD, don't know about uuid - is it anything to do with this: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221293?


----------



## SirDice (Jan 27, 2021)

andrian said:


> Please tell me where to start preparing this package, I'm ready to do it!


FreeBSD Porter's Handbook


----------



## Emrion (Jan 27, 2021)

richardtoohey2 said:


> _KeyDB can be compiled and is tested for use on Linux.  KeyDB currently relies on SO_REUSEPORT's load balancing behavior which is available only in Linux.  When we support marshalling connections across threads we plan to support other operating systems such as FreeBSD._


If I believe this, setsockopt(2), FreeBSD supports this option:


> SO_REUSEPORT_LB    enables duplicate    address    and port bindings with
> load balancing


But I don't know since which version.


----------



## daviddpd (Jun 16, 2022)

Poke - did this get anywhere ? I'd *might* be able to pick up and help with finishing the port ... as long as there isn't any massive low level C/C++ changes needed.


----------

