Advice about embedding/wrapping orientdb inside a RESTful server

72 views
Skip to first unread message

chrismi...@gmail.com

unread,
Apr 21, 2015, 9:46:28 AM4/21/15
to orient-...@googlegroups.com
I am creating a restful server that will more-less expose premade types of queries. For instance: GET /relationships/mutual-friends?a=11&b=14. That is an incredibly simple example. The end server is providing relational data for deep learning models. The server itself needs to be able to handle oAuth, user access lists, and these premade queries. That's all.

Performance is absolutely crucial as is the future ability to replicate and scale the database. Most of the rest of the stack is written in python with client-side interfaces in HTML5/CSS/JS so my first reaction is to use a python microframework for the rest server and communicate through binary connections. But, is there a significant performance gain between this an using a native Java Api on an embedded server? Has anyone done benchmarks?

Assuming that it is close to twice as performant to use the native api on an embedded database, my first thought would be to embed an orientdb into something like the SpringFramework. However, orientdb obviously has a restful architecture. Is it possible/safe to extend this server architecture to add new routes while keeping administrative functions locked away from the end-user? I do not want to modify the source, but wrap or extend it.

Has anyone face a similar situation and has some feedback. It would be greatly appreciated.

Luigi Dell'Aquila

unread,
Apr 21, 2015, 10:11:20 AM4/21/15
to orient-...@googlegroups.com
Hi Chris,

I do not have detailed data about differences in performance between Python and Java interfaces, anyway Java API in embedded server is the most performing in absolute, you can expect more than twice as the performance IMHO.
 
Embedding OrientDB in Java applications is a very common practice, your application will be able to expose REST services on its own port, then you can decide to just use OrientDB as a plocal db (without binary/REST interfaces enabled) or to start it as a full featured embedded server (with plugins, binary and rest interfaces). There is no need to touch the source code, basically what you need to do is just open a db connection with "plocal:" path.

Luigi


--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

chrismi...@gmail.com

unread,
Apr 21, 2015, 3:31:02 PM4/21/15
to orient-...@googlegroups.com
Thank you Luigi. That is what my research suggested, I just wanted to make sure I was on the right track before digging into code and design testing.

It is then possible to scale the embedded database across multiple servers, yes?

Colin

unread,
Apr 21, 2015, 4:54:37 PM4/21/15
to orient-...@googlegroups.com
The embedded OrientDB server may be used in distributed mode just fine, even with other non-embedded instances.

-Colin

chrismi...@gmail.com

unread,
Apr 21, 2015, 6:14:01 PM4/21/15
to orient-...@googlegroups.com
Thank you both. You have confirmed what I needed to dig in. I'm excited to be working with orientdb.
Reply all
Reply to author
Forward
0 new messages