Serverless architectures can reduce operational cost and development time but it does come with an architectural overhead and complexity.
In this talk you'll get an insight on how Trustpilot adopted a serverless mindset. The benefits and challenges of migrating and refactoring our systems having a serverless first approach.
Learn how we mitigated the complexity of our services and cut down the cost on our infrastructure.
2. 2
Agenda
● About Trustpilot
● Trustpilot’s history with Serverless development
● Challenges with Serverless architecture
● Advantages and wins of having a Serverless
architecture
● Example of serverless architecture
● Lessons to share
4. Trustpilot in numbers
+50 mil users & +70 mil reviews
1.8 mil reviews in September 2019 compared to 900.000 reviews 2 years
ago
5. Serverless at Trustpilot
● Initial release of Lambda functions in November 2014 @re:Invent
● Trustpilot’s stack at that time: C# .NET, MSSQL DB, MongoDB,
EC2
● Early 2014 we started decoupling our monolith service into
context based services
● Transitioning from MSSQL DB to MongoDB
6. The Serverless Native Mindset
https://www.freecodecamp.org/news/serverless-is-cheaper-not-simpler-a10c4fc3
0e49/
7. Serverless First
7
If serverless is not available or practical, containers are recommended.
Virtual servers (EC2) are considered legacy and should be avoided.
We do this because we strongly believe that serverless (FaaS, BaaS, DBaaS) is the
future of the cloud and we’d like to be on the forefront of that movement. Serverless
might not necessarily be the right choice for everything today, but start your architecture
discussions there. We’re in the process of fading out virtual servers (EC2) and want to
avoid creating new ones. The benefits of serverless and containers over virtual servers
are diverse: cost savings, better scaling, better orchestration, reduction of operational
costs and modernizing our cloud stack.
12. Serverless is not just FAAS
●
Serverless Databases: DynamoDB and Aurora Serverless
@Trustpilot we started to adopt:
● DynamoDB around 2017
● Aurora this year
13.
14.
15. Infrastructure we run now
Storage
Mongo - 16 production clusters
Redshift - 2 production clusters
RDS - 10 production databases
Redis - 3 production clusters
ElasticSearch - 6 production clusters
CloudSearch - 1 production domain
Aurora - 14 production clusters
DynamoDB - 109 production tables
Services
EC2 - 53
ECS - 329
Lambda - 371
S3 - 119
SQS
~450 production queues
~50M messages per day
SNS
~250 production topics
~7.1M messages per day
~27M deliveries per day
16. Challenges with Serverless architecture
●
● serverless mindset
● a lot of abstraction to learn
● local development
● limitations around execution time
17. Advantages and wins of having a
Serverless architecture
● Fewer developer logistics
● More time focused on writing code
● Inherently scalable. “Give me 1000 containers instantly”
● Never pay for idle resources
20. A problem to solve with a serverless
approach
● Users signup with email
● They are created in our DB as un-activated accounts
● The users will receive an email to activate their account
● If they don’t activate in 30 days we need to delete their account from all of
our systems
22. 22
Keep your serverless functions small
and focused.
You need to keep up with new
technology but don’t jump on the
bandwagon before you fully
understand how to use it.
Lessons that
we learned
Give your team time to learn and
adopt the serverless mindset.