Droplr is transitioning their infrastructure from traditional servers to serverless architectures to reduce complexity, improve maintainability, and increase performance. They have moved many of their services to AWS Lambda, including scheduled jobs, event-driven processes, and HTTP microservices. This has allowed them to simplify their stack, improve scalability, and reduce costs. While serverless architectures require some adjustments, Droplr has seen benefits from their transition and plans to expand their use of serverless and further optimize their infrastructure.
5. Future of Droplr (from 28.03.2017 meetup)
Long-term goals
1. Reducing complexity of the platform
→ quicker to develop new features
2. Trying serverless architectures
→ easier to maintain
3. Setting up platform in new geo-regions
→ faster for end-users
6. Future of Droplr (from 28.03.2017 meetup)
Long-term goals
1. Reducing complexity of the platform
→ quicker to develop new features
2. Trying serverless architectures
→ easier to maintain
3. Setting up platform in new geo-regions
→ faster for end-users
✓ OK
7. Future of Droplr (from 28.03.2017 meetup)
Long-term goals
1. Reducing complexity of the platform
→ quicker to develop new features
2. Trying serverless architectures
→ easier to maintain
3. Setting up platform in new geo-regions
→ faster for end-users
✓ OK
✓ OK
8. Future of Droplr (from 28.03.2017 meetup)
Long-term goals
1. Reducing complexity of the platform
→ quicker to develop new features
2. Trying serverless architectures
→ easier to maintain
3. Setting up platform in new geo-regions
→ faster for end-users
✓ OK
✓ OK
✓ OK
9. Meet AWS Lambda
Run code without thinking about underlying infrastructure
1. Supports: Node.js (JavaScript), Python, Java (Java 8), C# (.NET Core),
Go (from 15.01.2018)
2. High-Scalability and redundancy out of the box
3. Reliable (100% uptime in our Pingdom from 7 months)
4. Fast (1ms for “Hello World” Node.js)
5. Cheap (or free)
10. Droplr Current Architecture
Droplr Current Architecture
1. AWS Lambda in VPC
2. CloudFront in front of API Gateway
3. Web Application Firewall
4. SNS (~RabbitMQ?)
5. CloudWatch Events (~CRON?)
12. Our serverless way
1. Decision - simplify our stack
RoR, Scala, Java → Node.js with Serverless Framework
13. Our serverless way
2. Proof of Concept based on our background workers
a. Scheduled Functions (CRON → CloudWatch Events)
b. Events based (home-made queue → SNS)
c. VPC peering (MongoDB, Redis, Route53 private hosted zone)
14. Our serverless way
3. HTTP microservices
a. Express.js with Lambda middleware
b. Server Side Rendering (...why not?)
c. Serving binary from Lambda (base64, without streaming)
15. Our serverless way
4. Let’s boost it with CloudFront CDN!
a. Access log
b. Custom domain with HTTPS support
c. Caching of static assets
d. Cloudwatch Metrics
https://github.com/Droplr/serverless-api-cloudfront
16. Our serverless way
5. ...and make it more secure with AWS WAF
a. Rate-limiting (also based on failed requests for crawlers)
b. SQL/XSS injection filters
c. IP blacklists
https://aws.amazon.com/answers/security/aws-waf-security-automations/
17. Our serverless way
6. Lambda debugging sucks.
No, you don’t want to look on Cloudwatch logs
a. DataDog (Metrics)
b. Logz.io (ELK)
c. Sentry ← loved by developers
18. Our serverless way
7. Deployment
a. Securing ENV credentials
b. Docker lambci
c. Jenkins
https://github.com/Droplr/aws-env
19. Beware of
1. Cold starts issues (~800ms)
...but you use Pingdom for SLA monitoring? Don’t you?
2. When running Lambda in your VPC
...don’t forget to use NAT gateway.
3.
20. Moving towards real Cloud
1. Cloud with single region? What about running application nearer
your clients? Maybe in...
Tok
21. 1. Cloud with single region? What about running application nearer
your clients? Maybe in...
Moving towards real Cloud
Tok
Paris
22. 1. Cloud with single region? What about running application nearer
your clients? Maybe in...
Moving towards real Cloud
Tok
Paris
Sydney
25. Thanks
Time for discussion :-)
- Serverless as a game-changer?
- Your issues with running apps in Lambda
Ref.: https://serverless.com/blog/how-droplr-scales-to-millions-serverless-framework/