tj / sponsors

Open-source project suggestions powered by my GitHub sponsors
56 stars 5 forks source link

API Gateway in Go that is able to invoke Lambda functions #9

Open OrKoN opened 5 years ago

OrKoN commented 5 years ago
tj commented 5 years ago

Thought about this in the past as well, APIGW is crazy expensive for what it is. The only tricky part I suppose is that this thing would inherently be non-serverless since it'd have to live in EC2/ECS/Fargate. Any thoughts on that part?

OrKoN commented 5 years ago

EC2/ECS/Fargate is where I would run such a service. Maybe Lightsail is an option too. I am not sure about what the best place to run it is... I guess a load balancer might be required additionally if it's run on more than 1 instance. Client-side or DNS load balancing might be suitable in some cases.

I have not done the math but I assume that with a certain volume of requests having fixed infrastructure pays off. Well, maybe, if I do the math it turns out that it's not worth it.

P.S. Lightsail's load balancer is $18 per month, 2 smallest instances $7 per month, total = $25 per month. So if the self-hosted API gateway can handle 15 million requests per month, you save $25. But that's not a very scalable setup and might go down if the load increases suddenly.

shidel-dev commented 5 years ago

FWIW https://github.com/solo-io/gloo supports this use case.

OrKoN commented 5 years ago

@shidel-dev can it use DynamoDB for storage?

shidel-dev commented 5 years ago

@OrKoN use it for service discovery? It's not clear why you would want your load balancer to use DynamoDB.

shidel-dev commented 5 years ago

Maybe you are saying it should use that to store the routing configuration etc...

OrKoN commented 5 years ago

@shidel-dev to access API keys and quota configuration stored in DynamoDB, and that's not a load balancer.

OrKoN commented 5 years ago

I have learned recently that API Gateway does not support IPv6 out of the box (requires a custom cloud front distribution to enable IPv6)