使用 Foxx 为 Django 构建 API 还是使用 ArangoDB Python 驱动程序? [英] Build API for Django with Foxx or use ArangoDB Python driver?

查看:18
本文介绍了使用 Foxx 为 Django 构建 API 还是使用 ArangoDB Python 驱动程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Django 中使用 ArangoDB,但我不知道以下哪个选项更好:使用 ArangoDB Python 驱动程序 或使用 Foxx 构建新的 API.我认为 ArangoDB Python 驱动程序不是基于 Foxx,我不知道从头开始构建新 API 的利弊,即使 Foxx 使它变得更容易.此外,恐怕在 Foxx 和后端之间的接口中使用 javascript 会使事情变慢.如果我将 Guacamole ODM 与 Ruby on Rails 一起使用会更快吗?

I would like to use ArangoDB in Django, but I don't know which of the following options is better: using the ArangoDB Python driver or building a new API with Foxx. I think that the ArangoDB Python driver is not based on Foxx and I don't know the pros and cons of building a new API from scratch, even if it is made easier by Foxx. In addition, I'm afraid that using javascript in the interface between Foxx and the backend could make things slower. Would it be faster if I used Guacamole ODM together with Ruby on Rails?

推荐答案

更适合您的情况的选择是使用 ArangoDB Python 驱动程序.

Better option for your case is to use ArangoDB Python driver.

这里有几个原因:

  • 易于启动 - 只需安装驱动程序即可继续开发
  • 与 Django ORM API 的一些相似之处
  • 有一些文档
  • 您的所有业务逻辑都将在 Python 中就位,这应该是一个巨大的优势

这就是为什么 Foxx 不是您的最佳选择:

And here is why Foxx is not the best option for your case:

  • 您必须构建自己的 API,这意味着:
    • JavaScript 中的一堆代码
    • 一些描述 API 的文档

    当您使用 ArangoDB 作为数据层构建单页 APP 时,Foxx 是不错的选择.Foxx 也可能非常适合使用 Foxx 作为预处理/聚合数据提供者构建高级 API.

    Foxx is good option when you build Single page APP using ArangoDB as data layer. Also probably Foxx will be great for building hight-level API's with Foxx as preprocessed/aggregated data provider.

    这篇关于使用 Foxx 为 Django 构建 API 还是使用 ArangoDB Python 驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆