by arthursilva · 10y ago · 0 comments
(I'm the lead developer of the new ArangoDB Foxx, AMA)
It says that we can utilize npm, so, how is the compatibility with node? Native (C++) modules?
Is it used already in production somewhere?
(I am asking a lot of questions because I'm very interested, not anything else)
1) I don't think we currently have a benchmark specifically for Foxx. However we did some one-off tests in 2.8 and there was no noticeable difference between the plain HTTP API and a Foxx service using the equivalent JS API (just the V8 context switches).
2) See the section "Compatibility Caveats" in the docs: https://docs.arangodb.com/3.0/Manual/Foxx/Dependencies.html Specifically we can't support native modules and there are limits to what Node APIs we can support (network and filesystem APIs are different and more restricted, also Foxx is entirely synchronous).
3) Yes! Check out the case studies linked a the bottom of the website: https://www.arangodb.com/#casestudies All three of them use Foxx. I also dogfood Foxx: I'm the lead developer of a commercial e-learning product that uses full-stack JS with ArangoDB.
Feel free to swing by our community Slack channel if you have more questions: https://slack.arangodb.com
Saying Foxx is like stored procedures is overly simplistic.
ArangoDB's external API is the HTTP API. Foxx lets you extend that HTTP API with arbitrary code that will be executed in V8 with direct access to the same native APIs it uses internally.
The closest equivalents I'm aware of are RethinkDB's Horizon (which isn't hosted in the database) and CouchDB's CouchApps (which are far more limited in what they can do).
You can think of it as having a subset of Node.js running right on top of the database with direct memory access and scaling (Foxx services run on each coordinator).