简体   繁体   English

pyArango 与 Foxx 微服务

[英]pyArango vs. Foxx Microservices

What is the major difference between using pyArango and Foxx Micro-service?使用pyArango和Foxx微服务的主要区别是什么? As I saw we we are eventually writing the AQL in the .js file when creating the micro-service.正如我所见,我们最终在创建微服务时在 .js 文件中编写了 AQL。 How does it differ from writing into pyArango client?它与写入 pyArango 客户端有何不同?

What are the advantage of using Foxx Micro-service and pyArango?使用Foxx微服务和pyArango有什么好处?

Thanks谢谢

Foxx microservices run on the database server, which means if they need to manipulate large amounts of data to provide the data you need, then that data manipulation happens on the server. Foxx 微服务在数据库服务器上运行,这意味着如果它们需要操作大量数据来提供您需要的数据,那么数据操作就发生在服务器上。

If you use pyArango to externally process large amounts of data, then the full amount of data must come out of the server via your pyArango driver, so that Python can process the data in order to build the required answer.如果您使用 pyArango 从外部处理大量数据,那么全部数据必须通过您的 pyArango 驱动程序从服务器出来,以便 Python 可以处理数据以构建所需的答案。

Obviously, another difference with Foxx is that it's written in JavaScript, so that may be a difference for your project that is worth thinking about.显然,与 Foxx 的另一个不同之处在于它是用 JavaScript 编写的,因此这对于您的项目来说可能是值得考虑的不同之处。

Even if you run Python on the ArangoDB server, and extract data via pyArango versus Foxx, I would hazard to guess that Foxx will be faster.即使您在 ArangoDB 服务器上运行 Python,并通过 pyArango 与 Foxx 提取数据,我也会猜测 Foxx 会更快。

Personally, when implementing ArangoDB, I don't allow direct table access to its data, rather I force all connectivity to go through Foxx.就个人而言,在实现 ArangoDB 时,我不允许直接表访问其数据,而是强制所有连接都通过 Foxx。

The key benefit is that I can control incoming data schemas, supported actions, business logic, user access levels, and limit the possibility of consumers of the data from damaging the integrity of the data.主要好处是我可以控制传入的数据模式、支持的操作、业务逻辑、用户访问级别,并限制数据使用者破坏数据完整性的可能性。

Another key benefit is that by exposing the data via Foxx, and blocking direct AQL access, I have the flexibility to change the underlying data collections, models, structures, and relationships without the consumers having to change their code, as I just update the relevant Foxx REST endpoints and they keep returning data in the same way as they did before the structural updates.另一个关键好处是,通过 Foxx 公开数据并阻止直接 AQL 访问,我可以灵活地更改底层数据集合、模型、结构和关系,而消费者不必更改他们的代码,因为我只需更新相关的Foxx REST 端点,它们以与结构更新之前相同的方式返回数据。

It's not a black and white decision, but by thinking about the security, consumption, lifecycle, and priorities of your application, you will come to an answer that works for you.这不是非黑即白的决定,但通过考虑应用程序的安全性、消耗、生命周期和优先级,您将找到适合您的答案。

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

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