Embracing AWS Lambda and serverless architecture
Capital One's Serverless Center of Excellence helps our engineers stay current on Lambda best practices and lessons.
Capital One has been on a powerful tech transformation journey for many years.In 2020, we closed our last data center and moved all-in to the Cloud, with AWS as our primary cloud provider. The Cloud has allowed us to move faster and focus on building the applications that provide value to our customers. Today, we are focused on modernizing our tech stack by adopting serverless-first architectures.
Why Capital One embraced AWS Lambda serverless architecture
We no longer need to manage physical data centers and infrastructure, but our scale requires us to manage AWS accounts and resources in those accounts. At the beginning of our cloud journey, we deployed our applications to Amazon EC2. This means our developers were responsible for managing the entire tech stack. Developers had to deploy EC2 instances, manage the scaling, configure the autoscaling policies and manage the Operating Systems and Containers deployed to these EC2 instances. We had to deal with patches, vulnerabilities and other tasks we call “Run the Engine” (RTE). We quickly realized RTE costs are significant for all teams.
Arbitrary uniqueness undifferentiated heavy lifting
This is one of our driving factors in why we decided to adopt serverless approaches. Today, our preferred choice of computing is AWS Lambda functions or Containers with ECS Fargate. Lambda allows our developers to focus on building the application logic that delivers value to our customers. We let AWS handle all of the other tasks that cost us time but do not add value.
AWS managed no more burden on developers
Unveiling our Serverless Center of Excellence: AWS Lambda architecture best practices & lessons
We operate within AWS at a massive scale – we have thousands of accounts and tens of thousands of Lambda functions. We learned it’s really important to set both development standards and account management standards. However, Capital One is a large enterprise made of multiple Lines of Businesses (LOBs) and decisions that affect the entire enterprise should not be made in a silo. This led to the launch of our Serverless Center of Excellence (CoE). Our COE is made up of representatives from each LOB – we meet on a regular basis to talk about serverless best practices and set standards that work for the entire enterprise.
Center of excellence diagram
Some things we learned from our journey include:
-
You probably need new tools. AWS SAM is an excellent developer tool that allows you to build and iterate locally.
-
Lambda shifts the unit of scale from requests/second to concurrency and this will be a new concept to all. Make sure your developers understand how to calculate concurrency.
-
Multi account/small accounts are better than a few large accounts. This strategy allows you to limit blast radius and provide each team with their own accounts.
Use a multi-account strategy and set org level SCP’s for safety
-
Make sure you set development standards. For example, we require a LIVE_TRAFFIC alias to be the entry point for all Lambda functions. This ensures that we understand how all Lambda functions are executed. We also require all functions deploy using versions – this ensures consistency and prevents accidental changes.
Key takeaways from our AWS serverless development experience
Finally, here are the top AWS Lambda architecture best practices that have helped us build better serverless applications in the cloud:
-
Optimize your memory. Use Lambda Power Tuner. Memory = $$$
-
Set cloudWatch Log Retention. Logs are not free!
-
Use Lambda Powertools. Make common tasks easy.
-
Optimize for the cold/warm lifecycle.
-
Use provisioned concurrency with autoscaling.
-
Understand and monitor metrics.
-
Use AWS SAM. Build, emulate, test and debug all locally.
-
Use the right AWS SDK!
-
Java: v2
-
Use the right HTTP Client (Netty, Apache, AWS CRT**)
-
-
Node: v3
-
Go: v2
-
-
Use Snapart. It’s free.
-
Set standards. Tags, aliases, IAM permissions, etc.
Our AWS Lambda journey: a blueprint for innovation and collaboration
Capital One's journey to AWS Lambda serverless architecture marks a significant step in our continuous pursuit of innovation and efficiency in the tech landscape. The transition from data centers to the AWS Cloud and adoption of a serverless-first approach exemplify the power of embracing cutting-edge technologies.
The establishment of the Serverless Center of Excellence and adherence to AWS Lambda architecture best practices further demonstrate our commitment to excellence and collaboration within a massive-scale environment. These shared experiences serve as an insightful guide for those looking to leverage the potential of serverless computing and enhance their cloud-based operations.
Explore Capital One's serverless efforts and career opportunities
New to tech at Capital One? We’re all in on the cloud, serverless and open source:
-
See how we’re building and running serverless applications at a massive scale.
-
Explore open tech jobs and join our world-class team in changing banking for good.