Are you using AWS Lambda to provide the sandboxing? If so:
How does the user code actually end up running on the Lambda? Do you have a generic wrapper Lambda which `eval`s the user code, or do you deploy an individual Lambda for each function, etc?
Every customer's custom source or destination is its own Lambda function. This gives us a ton of fine-grained isolation, scalability and visibility out of the box.
We ask customers to implement a single function that converts an incoming webhook to Segment data points:
async function onRequest(request, settings) {
Segment.track(...)
}
Inside the function we save the users code to `handler.js` and inject index.js that loads and calls the users `onRequest` function.
3 comments
[ 4.0 ms ] story [ 14.8 ms ] threadHow does the user code actually end up running on the Lambda? Do you have a generic wrapper Lambda which `eval`s the user code, or do you deploy an individual Lambda for each function, etc?
Every customer's custom source or destination is its own Lambda function. This gives us a ton of fine-grained isolation, scalability and visibility out of the box.
We ask customers to implement a single function that converts an incoming webhook to Segment data points:
Inside the function we save the users code to `handler.js` and inject index.js that loads and calls the users `onRequest` function.