Putting DGraph behind API Gateway?


(Lonnietc) #1

Hello All,

I have a small REST API Gatwway setup (Umbrella) and want to put DGraph behind it but am not sure how to really go about it since DGraph does not seems to be RESTful. I am a bit to this and maybe there is a better open source API Gateway that I should use with DGraph so I thought to ask the group in that someone might have experience in this area.

Any help would be greatly appreciated.
Thanks


(Michel Conrado) #2

You can use Dgraph-js to create your REST API with Dgraph.
Check https://github.com/dgraph-io/graphoverflow
and https://github.com/GabeStah/dgraph-twitter-clone
for inspiration.


(Brian R) #3

You could also create a web application in Python or Go using the existing libraries and build out the appropriate REST endpoints. Whether this is a good idea or not… really depends.

For example, let’s say you’re using python. You could use falcon as your WSGI framework, build out the appropriate resource classes, and then run that application using uwsgi (or similar). If you were building say… a social network, this application would have calls that your web UI would talk to. For example you may have an endpoint that returns a user’s friends, something like /v0//friends, which gets translated into the appropriate database query and passes the response along. Caching here may also make sense.

I recommend you sketch out your overall application architecture, so you can figure out some approaches to abstract/encapsulate the business logic from the actual database IO.


(system) closed #4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.