https://www.reddit.com/r/golang/comments/5w3ang/switching_fr...
410 karma · joined September 13, 2016
[ my public key: https://keybase.io/jkosgei; my proof: https://keybase.io/jkosgei/sigs/UJOQAhWNFbqTv86brm7e9N53N8s6uhU55eDue24sLYo ]
https://www.reddit.com/r/golang/comments/5w3ang/switching_fr...
And also pointed me to nats.io, a messaging system that handles 10M messages per second on a $50 server.
See the comment at: https://www.indiehackers.com/forum/how-we-handle-25m-api-cal...
Basic Shield is supposed to be on for all users but I don't think APIG is covered in the range of services covered by their Advanced Protection plan.
We wrote about our setup in detail on the Highscalability blog [1]
A few things have changed since we wrote that article;
- We implement custom authorizers, which have helped lower our costs and the auth caching means authentication only happens once per x minutes and all subsequent requests are much faster.
- We use redis and a couple of Kinesis consumers running on a real server to sync data across all our regions. This setup has been battle tested and has successfully processed more than a hundred million API calls in a single day in near real time. [Use pipes and mget in redis for speed]
Here are some answers to a few specific things you raise in your question;
1. Use Sentry for lambda for error handling. The logs you get are incredibly detailed and have single handedly given us the greatest visibility into our application, moreso than any other tool we've tried (like AWS Xray).
2. Cloudwatch logs are tough. You might want to consider piping your logs to an Elasticsearch cluster, that might be a bit costly if you use AWS's Elasticache.
3. We use terraform for deploying our lambda functions and other resources. I'd strongly recommend it.
[1] https://highscalability.com/blog/2018/4/2/how-ipdata-serves-...
Lambda and Dynamodb were almost insignificant.
We had much better results running a server with a couple of kinesis consumers and redis.
This setup was able to process hundreds of millions of records in near real time.
https://aws.amazon.com/about-aws/whats-new/2018/05/lambda-at...
Cloudwatch feels like it was not made for humans. Searching and filtering for specific log events is a huge pain.
I think one of the best things one could do is to pipe your Cloudwatch logs to an ElasticSearch cluster.
This does come with additional cost. Serverless pricing doesn't scale, your costs increase linearly with your usage, and there're no discounts for bulk usage or reserved pricing.
We were recently on the receiving end of a massive HTTP GET Flood DDoS and although we did not experience any downtime as a result of it, I ended up finding out about it a few days later when billing alarms started going off.
At some point I believe when we're big enough we might switch to using servers in all the regions where we currently run APIG+Lambda.
Thanks again!