4 ms·
It's so funny that someone even downvoted you for calling him out on his bs. Databases like Postgres can run languages like JavaScript or Python for their stor
by mixedCase 10y ago
It's so funny that someone even downvoted you for calling him out on his bs.
Databases like Postgres can run languages like JavaScript or Python for their stored procedures. ArangoDB does nothing new in that regard.
- pluma 10y agoLet's try a more detailed comparison: Stored procedures are typically used for access control, data validation and code re-use. Foxx can of course be used for the same purposes. However while no sane person would want to expose a Postgres database to an external client, Foxx can be used to create REST APIs. There are proposals to add an HTTP API to Postgres so I would assume that there is a lot of demand for such use-cases. So stored procedures are just the basis and extensions like the ones Postgres plans to build on top of them are comparable to the native Foxx framework ArangoDB has already been offering for years. It's also possible to use user-defined functions in ArangoDB's query language, which are a more obvious equivalent of traditional stored procedures in SQL. Unlike these functions Foxx allows developers to build entire data-centric microservices. Additionally Foxx provides access to a wide range of JavaScript libraries via support for Node.js-style modules.
- mixedCase 10y agoIf what you need is a REST API there are solutions for it that use Postgres, namely http://postgrest.com/ http://postgrest.com/
- pluma 10y agoIf you just want a REST API for your database, sure, PostgREST does that for Postgres. But Foxx lets you specify your own endpoints, not just expose the DB via REST (which ArangoDB already can do out of the box). IOW: if you just want to talk to your DB over REST and manipulate documents directly, ArangoDB's native REST API is the equivalent of PostgREST. If you want arbitrary HTTP endpoints with logic you define yourself, bundled as isolated modules with an express-like router API, Foxx is currently the only way to do that within a database. It allows you to colocate your data-centric application logic with the data it operates on (or even remove the need for exposing sensitive data altogether by handling application-level auth/auth within the database). The only equivalent I can think of personally are CouchApps in CouchDB but they are necessarily far more limited in scope (because CouchDB isn't built to support complex or ad hoc queries).
- ruslan_talpa 10y ago"But Foxx lets you specify your own endpoints ... Foxx is currently the only way to do that within a database" ... so you mean like /rpc/storred_precedure_name in PostgREST :)? (don't get me wrong, anyone capable of writing a db from scratch is a genius, good job and good luck)