Using foxx microservices vs pyarango

150 views Asked by At

I want to set up an api that will query arabgodb. I am debating whether to set use foxx microservices or have a backend that will use pyarango to query the db. What are the pros and cons of both options?

1

There are 1 answers

0
kerry On

The pros and cons are very much up to you and your skillset (Python vs. JavaScript), but it seems like you are really asking about running your API middleware on a dedicated server (Python) or on within the ArangoDB platform (Foxx).

For single-node installations, keeping your queries close to the server (Foxx) will give you very low-latency query performance, but at the cost of sharing CPU and memory with the DB engine.

The dynamic changes dramatically when using a cluster - the Foxx engine must sit on a different server than the DB engine (see the cluster architecture docs). This relieves the CPU/memory sharing issues and also provides a sort of high availability for your API, but also introduces other, more serious, query performance issues that are unique to a cluster.

Bottom line: if you do not fully understand (or are not prepared to deal with) cluster performance, then stick with a single node. And if you are not willing to give up CPU/memory for your Foxx engine, then use a separate middleware server. There are many other details to consider, but (for me) this is the main decision.

Also, please note that there are only two modes: "cluster" and "single", but several ways to deploy the cluster (master/slave, active failover, one shard, multi-shard, etc.).