Zion (v21.12) Documentation and Setting Up a Lambda Server

Custom Lambda Servers should still work as before, but the flags for startup have changed. It now has its own flag.

dgraph alpha ... --lambda "url=http://lambda:8686/graphql-worker"

You can implement your lambda server in any language that supports web serving. The only requirement is to listen on the url you specified for POST requests.
You can have a look at the lambda implementation details by the DGraph team here. There is no further documentation about the request body, you will have to check the code for that afaik.

What you have to consider:

  • Custom lambda servers are not supported on DGraph Cloud.
  • Latency increases in comparison to running lambdas directly on alpha as requests have to be sent to your server location. But that depends on your setup.
  • You cannot currently use both alpha lambdas and custom lambdas. I’m currently working on support for this within Dgraph.

If you self host your server and want to use lambdas on alpha using JavaScript, you can use the admin api:

		"""
		Update the lambda script used by lambda resolvers.
		"""
		updateLambdaScript(input: UpdateLambdaScriptInput!) : UpdateLambdaScriptPayload

Unfortunately this is not yet documented. You can take a look at the schema here. Just search for “updateLambda” and you will find what you need.

2 Likes