简体   繁体   English

使用 foxx 微服务与 pyarango

[英]Using foxx microservices vs pyarango

I want to set up an api that will query arabgodb.我想设置一个 api 来查询 arabgodb。 I am debating whether to set use foxx microservices or have a backend that will use pyarango to query the db.我正在争论是否设置使用 foxx 微服务或有一个将使用 pyarango 查询数据库的后端。 What are the pros and cons of both options?两种选择的优缺点是什么?

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).优缺点在很大程度上取决于您和您的技能(Python 与 JavaScript),但您似乎真的在询问在专用服务器 (Python) 或 ArangoDB 平台 (Foxx) 上运行 API 中间件。

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.对于单节点安装,让您的查询靠近服务器 (Foxx) 将为您提供非常低延迟的查询性能,但代价是与数据库引擎共享 CPU 和 memory。

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 ).使用集群时动态变化显着 - Foxx 引擎必须位于与 DB 引擎不同的服务器上(请参阅集群架构文档)。 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.这缓解了 CPU/内存共享问题,还为您的 API 提供了一种高可用性,但也引入了其他更严重的集群特有的查询性能问题。

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.如果您不愿意为 Foxx 引擎放弃 CPU/内存,请使用单独的中间件服务器。 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.).另外,请注意只有两种模式:“集群”和“单一”,但有几种部署集群的方式(主/从、主动故障转移、一个分片、多分片等)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM