问题
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?
回答1:
Better option for your case is to use ArangoDB Python driver.
Here is couple of reasons:
- easy-to-start - just install driver and move on with development
- some similarity to Django ORM API
- have some documentation
- all your business logic will be in place and in Python which should be great advantage
And here is why Foxx is not the best option for your case:
- you have to build your own API which means:
- bunch of code in JavaScript
- some documentation to describe API
- additional logic level (in Foxx and in Django project) which increase tangling in your project
- it probably not increase performance because you still retrieve your data using HTTP
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.
回答2:
I made a python ArangoDB driver (https://github.com/saeschdivara/ArangoPy) and I created on top of that kind of a bridge for Django (https://github.com/saeschdivara/ArangoDjango). So you can use kind of an orm for ArangoDB and still use the Django Restframework to create your API.
来源:https://stackoverflow.com/questions/23894545/build-api-for-django-with-foxx-or-use-arangodb-python-driver