10 ms·
Considering it's like 20 simple requests per second, you can do it on a couple of tiny virtual servers (for geo and redundancy), totaling less than $10 per mont
by zzzcpan 9y ago
Considering it's like 20 simple requests per second, you can do it on a couple of tiny virtual servers (for geo and redundancy), totaling less than $10 per month.
- orf 9y agothe hard bit is the API key and usage monitoring. you could write the whole thing as Cloudflare workers for $5 per month else. $20 for 55 'servers' spread worldwide isn't bad, with no maintenance overhead.
- zackbloom 9y agoWriting Javascript is, in my experience, much more pleasant than writing VCL, and Cloudflare has over 150 points of presence.
- jonathan-kosgei 9y agoIt would also take some work to scale
- JrSchild 9y agoMy strategy is to use Cloudflare workers to invoke a Lambda function. This way I have a cheap AWS API Gateway replacement. $3.70 per 1M requests becomes only $0.50. Costing my only $12.5 for 25M requests + the Lambda invocations which are hella cheap.
- jonathan-kosgei 9y agoInteresting strategy mate! Any links on how to do that? I've googled a bit but haven't find anything on this!
- zackbloom 9y agoI don't know if there are any great blog posts on it yet (write one!) but you can read more about Workers here: https://developers.cloudflare.com/workers/about/ https://developers.cloudflare.com/workers/about/
- JrSchild 9y agohttps://blog.cloudflare.com/cloudflare-workers-unleashed/ https://blog.cloudflare.com/cloudflare-workers-unleashed/ Yes check this out. What you'll have to do is build the aws sdk into a single javascript file that runs as a Web Worker. These are distributed to over a 100 servers worldwide. Then you would want to invoke the Lambda function from the worker, link below. You could potentially distribute this further by invoking a Lambda function geographically close to that specific worker. But this setup will be very fast already. https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#invoke-property https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lamb...
- jonathan-kosgei 9y agoAwesome! Thanks!
- JrSchild 9y agoIt might be cool to create a tool that automatically turns a serverless.json file into Cloudflare workers that acts as little AWS API Gateway services. If anyone is up for swapping ideas, I made a GitHub repo: https://github.com/JrSchild/cloudflare-lambda https://github.com/JrSchild/cloudflare-lambda