Three MUST Know Architectural Patterns for Interviews and Cloud Jobs


Hello Reader,

In this edition, we will go over three important architectural patterns for interviews, as well as production projects. I bet "pen and paper" architects and influencers don't talk about the third pattern coz that one you only know if you implemented actual projects ;)

Microservice

This is the most common architectural pattern. You use microservices every day without knowing. Checking bank balances, reserving dinner at a restaurant, posting a movie review, buying something from Amazon, etc., all done via microservice. There are many ways to implement a microservice, but the most common pattern is the one below, with Application Load Balancer (ALB)

  • Separate target groups handle each microservice
  • Each functionality can be backed by different compute options. For example, /browse is being served by EC2 + Auto Scaling Group, /buy is being served by AWS Lambda, and Kubernetes are serving others.
  • The ALB is associated with a DNS system such as Amazon Route53, so that users can access the ALB using a nice domain name (example: cloudwithraj.com) instead of the cryptic default URL ALB provides you
  • In the above example cloudwithraj.com/browse will go to target group 1, cloudwithraj.com/buy will go to target group 2, everything else will go to target group 3.

Event-Driven Architecture

An event-driven architecture decouples the producer and processor. In this example producer (human) invokes an API, and send information in JSON payload. API Gateway puts it into an event store (SQS), and the processor (Lambda) picks it up and processes it. Note that, the API gateway and Lambda can scale (and managed/deployed) independently

Benefits of an event-driven architecture (remember these for interviews)

  • Scale and fail independently - By decoupling your services, they are only aware of the event router, not each other. This means that your services are interoperable, but if one service has a failure, the rest will keep running. The event router acts as an elastic buffer that will accommodate surges in workloads.
  • Develop with agility - The router removes the need for heavy coordination between producer and consumer services, speeding up your development process. The producer part can be developed by one team, the consumer part, by another.
  • Audit with ease - An event router acts as a centralized location to audit your application and define policies. These policies can restrict who can publish and subscribe to a router and control which users and resources have permission to consume and access the events. You can also encrypt your events both in transit and at rest.
  • Cut costs - Event-driven architectures decouple the producer and event processor, so the event processing backend, compute and the database, don't need to be provisioned for highest scale. For this reason, EDA is generally more cost efficient than their synchronous counterpart.

Batch Job

This one is something that people don't talk about much. But if you have worked on any real-world production project, you know that batch plays a critical role. Like microservices, you also utilize this every day. Your scheduled mortgage loan payment, credit card payment, stock transactions settlement, bulk discounts generation, etc.

  • Use EventBridge scheduler to schedule jobs. You can also trigger jobs based on EventBridge rules which give you great flexibility and power!
  • Then the batch job is submitted via AWS Batch. Obviously you are thinking, I see container image and then ECS/EKS, why can’t I submit a container job directly from EventBridge without AWS Batch. it’s because AWS Batch maintains job queues, restart, resource management etc. that is not available if you skip it.
  • The actual steps of the job need to be in a container
  • The job running in a container gets submitted in either ECS or EKS. AWS Batch supports both EC2 and Fargate

Guys and girls - if you get any of these questions in your interview, knock it out of the park 🎯

If you have found this newsletter helpful, and want to support me 🙏:

Checkout my bestselling courses on AWS, System Design, Kubernetes, DevOps, and more: Max discounted links

AWS SA Bootcamp with Live Classes, Mock Interviews, Hands-On, Resume Improvement and more: https://www.sabootcamp.com/

Keep learning and keep rocking 🚀,

Raj

Fast Track To Cloud

Free Cloud Interview Guide to crush your next interview. Plus, real-world answers for cloud interviews, and system design from a top Solutions Architect at AWS.

Read more from Fast Track To Cloud

Hello Reader, Let’s face it—times are tough. The job market isn’t looking great, and uncertainty is in the air. But here’s the silver lining: this isn’t the first time we’ve faced challenges like this. I’ve been through the 2008 recession, and while it wasn’t easy, I came out stronger on the other side. Today, I want to share with you four strategies that worked for me back then and can help you navigate this downturn with confidence. 🚀Go the Extra Mile It’s an employer’s world. If you’re in...

Hello Reader, I just returned from Kubecon London, where I presented to a packed audience on Amazon EKS Auto Mode, Karpenter, and newly launched community add-on support. This talk was not recorded, but don't fret! I recorded the talk with some extra pointers, and as a thank you for being a valued subscriber of this newsletter, I am sharing that video with you. Please enjoy, and let me know of any questions: Slides from the talk: London EKS Auto Mode_RajdeepSaha.pdf Here are a few major...

Hello Reader, In the previous newsletter edition, we took a look at top Gen AI tools, and how can you benefit from the trend. The matter of the fast is, even in general SA interviews, you have to expect Gen AI questions. This is similar to how you expect fundamental containerization and DevOps questions. Gen AI is becoming quite popular, and this is no exception. In today's edition, let's go over AWS Gen AI landsacape, that I am following: The image illustrates the AWS Generative AI (Gen AI)...