Dgraph proxy for backend

Hello there,

Im considering using dgraph for my next project. I wonder how I would best go about architecting my backend and would like to know if my Ideas are valid use-cases of dgraph.

At the moment I am weighing two options.

  1. a dgraph db that connects using dgl (pydgraph) to a python (FastAPI) graphql backend. Which then serves the content to a frontend.

  2. a dgraph db that connects (partially) directly to the frontend. With some traffic passing through a python proxy graphql backend (like above), for stuff like auth. I would then use something like AWS api gateway to stitch the two graphql endpoints together.

I know for the latter option I could use lambdas, however I also know that there will be some functions too complicated to be put into lambdas. For that reason I don’t really want to touch lambdas.

What are your opinions?


1 Like

Any of that is feasible. I connect my frontend directly to Dgraph GraphQL endpoint and use auth rules and custom queries/mutation/fields in the mix as well which hit either Dgraph lambdas and sometimes external APIs or other backend scripts. Dgraph is pretty flexible in this regard depending on your use case. You might not even need to stitch together anything depending on your use case.


Hey, thanks for the quick response.