Serverless Architectural Patterns
Tags: awslambda, serverless, softwareengineering, serverlessarchitect
Published: 2019-03-05 06:04:42

---
title: Serverless Architectural Patterns
published: true
tags: aws-lambda,serverless,software-engineering,serverless-architect
canonical_url: https://medium.com/@eduardoromero/serverless-architectural-patterns-261d8743020
---

![](https://cdn-images-1.medium.com/max/1024/1*wz3dUQYEOulqAI-A9H4-wg.png)<figcaption>Black and white clouds, atmosphere — Photo by <a href="https://unsplash.com/photos/LzJZOJZtgmc?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Bryan Minear</a></figcaption>

We’re building more and more complex platforms, at the same time that we are trying to address ever-changing business requirements, and delivering them on time to an increasingly large number of users.

What we deliver is inherently unique. A combination of different services, technologies, features, and teams with their own contexts and competing priorities.

Sometimes it just feels like you’re designing and building an aircraft carrier, while navigating in rough ocean, occupied, and under attack.

{% tweet 857342043017891840 %}

Continuously delivering quality software fast is a core business advantage for our clients. Accelerating the development process with modern architectures, frameworks, and practices is strategic.

The serverless paradigm it’s great at enabling fast, continuous software delivery. You don’t have to think about managing infrastructure, provisioning or planning for demand and scale.

And with the Function as a Service model we structure our code in smaller, simpler units, that are easy to understand, change and deploy to production. Allowing us to deliver business value and iterate quickly.

> Serverless is a great enabler for experimenting, learning, and out-experimenting your competition.

Architectural Patterns are powerful way to promote best practices, robust solutions, and a shared architectural vision across our engineering organization.

Working on different projects leveraging serverless, I’ve seen patterns that we can adopt to solve common problems found in modern cloud architectures. While this is not an exhaustive collection, but it can be used as a catalog of architectural level building blocks for the next platform we build.

### Serverless Architectural Patterns Catalog

- Simple Web Service.
- Decoupled Messaging.
- Robust API.
- Aggregator.
- Pub/Sub.
- Strangler.
- Queue-based Load Leveling.
- Read-heavy reporting engine.
- Streams and Pipelines.
- Fan-in and Fan-out.

#### Simple Web Service

> “A client needs to consume a service via a Public or Internal API.”

A simple web service is the most standard use-case for AWS Lambda as a backend service. It represents the _logic_ or _domain_ layer of a [_n-tiered_](https://en.wikipedia.org/wiki/Multitier_architecture) or [_layered_](https://martinfowler.com/bliki/PresentationDomainDataLayering.html) _architecture_.

![](https://cdn-images-1.medium.com/max/882/1*FBgxD-qR66DTnjHA1ASJEA.png)<figcaption>Public API — Lambda Functions exposed via HTTP(s)</figcaption>

For Public APIs, API Gateway is exposing lambda functions via HTTPs. API Gateway can handle authorization, authentication, routing, and versioning.

For internal APIs, clients invoke lambda functions directly from within the client app using [AWS’ SDK](https://aws.amazon.com/tools/#sdk).

![](https://cdn-images-1.medium.com/max/858/1*iPIAqcjx6gwXO2uvdh67Ag.png)<figcaption>Internal API — The client invokes Lambda functions via the AWS SDK of your favorite language.</figcaption>

AWS Lambda scales automatically, and can handle fluctuating loads. Execution time is limited to the maximum allowed by API Gateway (_29 seconds)_, or the hard limit of _15 minutes_ if invoked with the SDK.

It’s highly recommended that functions are [stateless](https://read.acloud.guru/lambda-for-alexa-skills-7-tips-from-the-trenches-684c963e6ad1#5c39), [sessions](https://serverless.com/blog/strategies-implementing-user-authentication-serverless-applications/) are [cached](https://medium.com/@tjholowaychuk/aws-lambda-lifecycle-and-in-memory-caching-c9cd0844e072) and connections to downstream services are [handled appropriately](https://www.jeremydaly.com/reuse-database-connections-aws-lambda/).

#### Decoupled Messaging

> “As break out the monolith or continue to build services for our platform, different services have to interact. We want to avoid bottlenecks, synchronous I/O, and shared state.”

Asynchronous messaging is the foundation for most service integrations. It’s proven to be the [best strategy for enterprise architectures](https://www.enterpriseintegrationpatterns.com/patterns/messaging/toc.html). It allows building loosely-coupled architectures that overcome the limits of remote service communication, like latency and unreliability.

![](https://cdn-images-1.medium.com/max/1024/1*M0nPEazhCK9DiKurpjw9CQ.png)<figcaption>Decoupled Messaging with SNS</figcaption>

In the example above Service A is triggering events and SNS distributes these events to other services. When new services are deployed they can subscribe to the channel, and start getting messages as events happen.

Messaging infrastructure is reliable. Offering better encapsulation than a shared database. Perfect for asynchronous, event-based communication.

Different technologies have different constraints and offer specific guarantees. It’s important to be aware of these trade-offs. The most common services for messaging on AWS are [SNS](https://aws.amazon.com/sns/faqs/), [SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html) and [Kinesis](https://docs.aws.amazon.com/streams/latest/dev/service-sizes-and-limits.html).

**_Considerations_** : Besides the known limitation and guarantees of each messaging service there should be conscious considerations for message duplication, message ordering, poisonous messages, sharding, and data retention. Microsoft’s “[Asynchronous Messaging Primer](https://docs.microsoft.com/en-us/previous-versions/msp-n-p/dn589781(v=pandp.10))” article discuses [these topics in detail](http://considerations-for-implementing-asynchronous-messaging).

#### Robust API

> “As the number of services of a platform grows clients need to interact with more and more services. Because each service might have different endpoints, belong to different teams, and have different release cycles, having the client manage these connections can be challenging.”

In a this pattern we have a single point of entry that exposes a well defined API, and routes requests to downstream services based on endpoints, routes, methods, and [client features](https://blog.apisyouwonthate.com/api-versioning-has-no-right-way-f3c75457c0b7#0f4b).

![](https://cdn-images-1.medium.com/max/1024/1*kN_ykbVbX1Ln57wnPdtUqg.png)<figcaption>A Robust API composed of different downstream services, exposed via API Gateway.</figcaption>

The downstream services could be lambda functions, external third-party APIs, [Fargate](https://aws.amazon.com/fargate/) containers, full-blown microservices, even internal APIs.

[API Gateway](https://aws.amazon.com/api-gateway/), [App Load Balancer](https://aws.amazon.com/elasticloadbalancing/features/#Details_for_Elastic_Load_Balancing_Products) or [AppSync](https://aws.amazon.com/appsync/) can be leveraged to implement it as the routing engine.

![](https://cdn-images-1.medium.com/max/747/1*cY03nWEJaD4RysmM6YLIMw.png)<figcaption>AppSync (GraphQL) can be seen as an implementation of the Robust API and Aggregator patterns.</figcaption>

Having an abstraction layer between clients and downstream services facilitates incremental updates, rolling releases, and parallel versioning. Downstream services can be owned by different teams, decoupling release cycles, reducing the need for cross-team coordination, and improving API lifecycle and [evolvability](https://blog.apisyouwonthate.com/api-evolution-for-rest-http-apis-b4296519e564).

This pattern is also known as the [API Gateway](https://microservices.io/patterns/apigateway.html) or [Gateway Router](https://docs.microsoft.com/en-us/azure/architecture/patterns/gateway-routing).

**_Considerations_** : The Gateway can be a single point of failure. Managing resources and updating the client-facing interface can be tricky. It could become a cross-team bottleneck if it’s not managed via code automation.

#### Aggregator

> “A client might need to make multiple calls to various backend services to perform a single operation. This chattines impacts performance and scale.”

Microservices have made communication overhead a common problem. Applications need to communicate with many smaller services, having a higher amount of cross-service calls.

A service centralizes client requests to reduce the impact of communication overhead. It decomposes and makes the requests to downstream services, collects and stores responses as they arrive, aggregates them, and returns it to the caller as one response.

![](https://cdn-images-1.medium.com/max/934/1*cHSxPOODaR1itN4A_W8Mcg.png)<figcaption>The invoice lambda function aggregating downstream services.</figcaption>

Microsoft calls this pattern [Gateway Aggregation](https://docs.microsoft.com/en-us/azure/architecture/patterns/gateway-aggregation). It can be implemented as a service with _some_ business logic, that is able to cache responses and knows what to do when downstream services fail.

**_Considerations_** : Calls to the API should work as one operation. The API of the aggregator should not expose details of the services behind it to the client. The aggregator can be a single point of failure, and if it’s not _close enough_ other services it can cause performance issues. The aggregator is responsible for handling retries, circuit breaking, cache, tracing, and logging.

#### Pub/Sub

> “Services rarely live in isolation. The platform grows and services proliferate. We need services to interact without creating interdependency.

> Asynchronous messaging enables services to announce events to multiple interested consumers without coupling.”

In [Publisher-Subscriber](https://docs.microsoft.com/en-us/azure/architecture/patterns/publisher-subscriber) services publish events through a channel as _messages_. Multiple interested consumers listen to the events by subscribing to these channels.

![](https://cdn-images-1.medium.com/max/1016/1*-EPTUG9Umkl2UZTw7XqYDw.png)<figcaption>The Orders service interacting with the Video Wall, Leaderboard, and Recommendations Engine.</figcaption>

In the example the Orders service will publish an event when an order is created in the mobile application.

The VideoWall service is listening to OrderCreated events. It will take the order, break apart the items in the order — what _needs_ preparation like a v60, or _does not_ like cookies, and update the screen so our _Baristas_ see which coffee to start brewing next.

The Leaderboard service will receive the same event, and will update the tally — Who is the _Coffee Afficionado_ of the month, and what are the _Top Selling Coffee Origins, Methods_ and _Goodies_.

The Recommendations service will keep track of who is drinking what, things that seem to go great together, and which is the next method you should try. — _Hint_, try the Japanese Syphon:

<iframe src="https://www.instagram.com/p/BZ308WkFut8/embed" width="658" height="756" frameborder="0" scrolling="no"><a href="https://medium.com/media/c5ae351f5c6bbf46de15cc3c5fa8f498/href">https://medium.com/media/c5ae351f5c6bbf46de15cc3c5fa8f498/href</a></iframe>

Services are decoupled. They work together by observing and reacting to the environment, and each other — like rappers [freestyling](https://www.youtube.com/watch?v=1qR8zFJ2vHI&t=36s).

When new services and features are available they can subscribe, get events, and evolve independently.

Teams can focus on delivering value improving their core capabilities, without having to be focus on the complexity of the platform as a whole.

**_Considerations:_** Publisher / Subscriber is a great match for event-driven architectures. With lots of different options for messaging: [SNS](https://aws.amazon.com/sns/), [Kinesis](https://aws.amazon.com/kinesis/), [Azure’s Service Bus](https://azure.microsoft.com/en-us/services/service-bus/), [Google’s Cloud Pub/Sub](https://cloud.google.com/pubsub/), [Kafka](https://kafka.apache.org/), [Pulsar](https://pulsar.apache.org/), etc. These messaging services will take care of the infrastructure part of pub/sub, but given the asynchronous nature of messaging all the issues discussed previously — message ordering, duplication, expiration, idempotency, and eventual consistency, should be considered in the implementation.

#### Strangler

> “Systems grow and evolve over time. As complexity increases adding new features can be challenging. Completely replacing a system can take time, and starting from scratch is almost universally a bad idea.

> Migrating gradually to a new system, while keeping the old system to handle the features that haven’t been implemented is a better path.

> But clients need to know about both systems, and update every time a feature has been migrated.”

The [Strangler pattern](https://www.martinfowler.com/bliki/StranglerApplication.html) is a technique to gradually migrate legacy systems that was popularized with the exponential popularity of microservices. In this pattern a service acts as a _façade_ that intercepts requests from the clients, and routes them to either the legacy service or new services.

Clients continue to use the same interface, unaware of the migration minimizing the possible impact — and the risk of the migration.

![](https://cdn-images-1.medium.com/max/1024/1*udq9hy-EMH0qSNZmjpBvlA.png)<figcaption>ALB routing requests between the legacy app and the new microservice.</figcaption>

An Application Load Balancer routes clients’ requests to the Orders Service, the first microservice the team implemented. Everything else continues to go to the Legacy application.

Orders has its own data store, and implements all the business logic for Orders. Because some of the features on the legacy app use orders, we need to push the data back to the legacy app to stay in sync (an [Anti-corruption Layer](https://docs.microsoft.com/en-us/azure/architecture/patterns/anti-corruption-layer) of sorts).

![](https://cdn-images-1.medium.com/max/1024/1*LzhxzJ5M0zlNkgFm4SixrA.png)<figcaption>New feature — Leaderboard Microservice now available.</figcaption>

As the project evolves, new features come in and we create new services.

The Leaderboard Service is now available. It’s a completely new feature that the brand new _Engagement Team_ created so there’s no need to interact with the Legacy app.

Teams will continue to create new features and port existing features to new services. When all the required functionality has been phased out of the legacy monolithic app it can be decommissioned.

**_Considerations:_** The _façade_ keeps evolving side by side with the new services. Some data stores can potentially be used by both new and legacy services. New services should be structured in a way that they can be intercepted easily. At some point the migration should be complete, and the strangler _façade_ should either go away, or evolve into a gateway or an adaptor.

#### Queue-based Load Leveling

> “Load can be unpredictable, some services cannot scale when there’s an intermittent heavy load. Peaks in demand can cause overload, flooding downstream services causing them to fail.

> Introducing a queue between the services that acts as a buffer can alleviate the issues. Storing messages and allowing consumers to process the load at their own pace.”

Buffering services with the help of a queue is very common. In Microsoft’s Cloud Architecture Patterns it’s called the [queue-based load leveling pattern](https://docs.microsoft.com/en-us/azure/architecture/patterns/queue-based-load-leveling), Yan Cui calls it [Decoupled Invocation](https://read.acloud.guru/applying-the-decoupled-invocation-pattern-with-aws-lambda-2f5f7e78d18), and Jeremy Daly calls it [the Scalable Webhook](https://www.jeremydaly.com/serverless-microservice-patterns-for-aws/#scalablewebhook).

A queue decouples _tasks_ from _services,_ creating a buffer that holds requests for less scalable backends or third-party services.

Regardless of the volume of requests the processing load is driven by the consumers. Low concurrency and batch size can control the workload.

![](https://cdn-images-1.medium.com/max/1024/1*-6QcmhOklq1FcD81Fof_iQ.png)<figcaption>A migration process that consumes items really fast from Elasticsearch, pushes them in a queue while a worker slowly feeds them one by one into a Legacy app.</figcaption>

In the example we have a Migration worker process that reads the content of an Elasticsearch index. Elasticsearch it’s fast. The worker can read thousands of Articles and fetch their dependencies (Authors, Categories, Tags, Shows, Assets, etc.) in less than a second.

On the right side we have a service that needs to ingest all the content, but before we can create an Article we have to create all its relationships in a specific order, double-checking if they exist, and need to be updated which is slower. Even if we scale horizontally the service — and we did — the relational database behind it becomes the bottle neck.

After a point (~100k to 500k Articles) querying the database slows down to a crawl because there’s some locking on the [Has-and-Belongs-to-Many](http://archive.oreilly.com/oreillyschool/courses/Rails2/many_to_many.html) relationship tables.

By limiting the batch size and the number of workers running concurrently we can maintain a slow but steady flow that reduces lock contention in the database.

![](https://cdn-images-1.medium.com/max/1024/1*H_dlsZOyQcka3GbEPiAh-Q.png)<figcaption>Buffering requests of a busy public API.</figcaption>

Another common example is using a SQS to buffer API requests to amortize spikes in traffic— like in the diagram above.

The endpoint returns [202 — Accepted](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) to the client, with a transaction id and a location for the result. On the client-side the UI can give feedback to the user emulating the expected behavior.

The service can process the requests on the background at its own peace. Even if there are long running process involved an increase in the load on the client-side will never affect the throughput and responsiveness of the system.

**_Considerations:_** This pattern is not helpful when services require a synchronous response (waiting for a reply). It’s important to note that not using concurrency limits can diminish the effectiveness of the pattern: AWS Lambda and Kinesis can scale quickly, overwhelming downstream services that are less elastic or slower to scale. Zalando’s API Guidelines includes a [full section](https://opensource.zalando.com/restful-api-guidelines/#events) about Events that talks about this some important considerations for this pattern.

#### Read-heavy reporting engine

> “It’s very common with read-heavy applications to hit the limits of downstream data engines that are not specialized for the different querying patterns that clients use.

> Caching data and creating specialized views of the most queried data can help mitigate the load impact of a read-heavy service.”

Previous patterns help address pushing data and events from one service to others, optimizing scale for write-heavy services. This pattern optimizes the data for different _accessing_ and _querying patterns_ that clients need, optimizing scale for read-heavy services.

Most applications are read-intensive. This is particularly true for our Big Media clients where there are far less users generating content than users consuming the content. The ratio between them can be huge like 1:100000.

Caching data and creating specialized views of the most frequent access patterns help services scale effectively.

Caching means temporarily copying frequently used into memory or a shared repository. [Caching data](https://docs.microsoft.com/en-us/azure/architecture/patterns/cache-aside) is one of the most frequently used strategies to improve performance and scale reads.

In [Materialized views](https://docs.microsoft.com/en-us/azure/architecture/patterns/materialized-view) the data is replicated and transformed in a way that is optimized for querying and displaying. Materialized views can be new tables or completely different data stores where the data is mapped to be displayed in a new format or limited to a specific subset of the data.

Materialized views are also useful to “bridge” different stores to take advantage of their stronger capabilities.

With [Index Tables](https://docs.microsoft.com/en-us/azure/architecture/patterns/index-table) the data is replicated in a new table using specialized indexes specific to common queries. Specialized indexes can be composite keys, secondary keys, and partially denormalized that.

![](https://cdn-images-1.medium.com/max/1024/1*hibCn1a_yqdkprm8TkgCbQ.png)<figcaption>Using Materialized Views and Index Tables for popular querying patterns on the social app.</figcaption>

Dynamo streams and lambda functions are the perfect tools to create specialized views. In the example we have three endpoints — search, tweet and timeline. Each one needs a slightly different querying pattern where the data needs to be optimized in a particular way.

/search queries the Tweets Index in Elasticsearch. Providing things like phonetic search, typos, related terms, and suggestions. There is no need to index all the data from the original tweet, maybe it only includes the text, location, media url — for a pretty preview, and hashtags. We use the stream to trigger a lambda on TweetCreated that strips all the data we don’t need and indexes the tweet.

/timeline is created from the most interesting tweets on the network, and the activity of my connections.

We use a Dynamo table to keep the Top Tweets — an _indexed table_ limited to the 1000 most viewed items. Tweets are updated via the stream on theTweetViewed event. A lambda function receives the event, queries the Tweets Collection, and saves the result.

Getting the activity of someone’s connection is easier on a Graph Database like [Neptune](https://aws.amazon.com/neptune/). Another lambda triggered by the TweetCreated event creates a record on Neptune maintaining activities for our connection’s streams of tweets.

In Microsoft’s Cloud Architecture this is a mix of different patterns — Data pipeline, [Cache-aside](https://docs.microsoft.com/en-us/azure/architecture/patterns/cache-aside), [Materialized views](https://docs.microsoft.com/en-us/azure/architecture/patterns/materialized-view), and [Index Table](https://docs.microsoft.com/en-us/azure/architecture/patterns/index-table).

**_Considerations:_** Handling cache can be [hard](https://en.wikipedia.org/wiki/Cache_invalidation), remember to follow industry [best practices](https://en.wikipedia.org/wiki/Cache_invalidation). Maintaining materialized views, and index tables can be complicated. Duplicating the data will add cost, effort, and logic. With very large datasets it can be very difficult to maintain consistency, and keeping the data in sync could slow down the system. Views and Index tables are not fully consistent.

#### Streams and Pipelines

> “A continuous stream processor that captures large volumes of events or data, and distributes them to different services or data stores as fast as they come.”

An important feature we see often is processing streams of data, as fast as the data is being generated and scaling quickly to meet demand of large volumes of events. Downstream services receive the stream and apply business logic to transform, analyze or distribute the data.

Common examples are capturing user-behavior like clickstreams and UI interactions. Data for analytics. Data from IoT sensors, etc.

![](https://cdn-images-1.medium.com/max/1024/1*0oPw3DvpApBTZ50HNrnw-g.png)<figcaption>Using Kinesis Streams, Analytics and Athena to build a data pipeline.</figcaption>

In the example a [Kinesis Stream](https://aws.amazon.com/kinesis/data-streams/) receives events from Service A. The data is transformed with lambda functions, stored in DynamoDB for fast reading, and indexed in Elasticsearch for a good search user-experience.

[Kinesis Analytics](https://aws.amazon.com/kinesis/data-analytics/) provides fast [querying data](https://docs.aws.amazon.com/kinesisanalytics/latest/dev/streaming-sql-concepts.html) in the stream in real time. With the S3 integration all the data is stored for future analysis and real insight. [Athena](https://aws.amazon.com/athena/) provides querying for all the historical data.

**_Considerations:_** Stream processing can be expensive, it might not be worth it if there dataset is small or there are only a few events. All cloud providers have offerings for Data pipelines, Stream processing, and Analytics but they might not integrate well with services that are not part of their ecosystem.

#### Fan-out and Fan-in

> “Large jobs or tasks can easily exceed the execution time limit on Lambda functions. Using a divide-and-conquer strategy can help mitigate the issue.

> The work is split between different lambda workers. Each worker will process the job asynchronously and save its subset of the result in a common repository.

> The final result can be gathered and stitched together by another process or it can be queried from the repository itself.”

**Fan-out** and **Fan-in** refers to breaking a task in subtasks, executing multiple functions concurrently, and then aggregating the result.

They’re two patterns that are used together. The Fan-out pattern messages are delivered to workers, each receiving a partitioned subtask of the original tasks. The Fan-in pattern collects the result of all individual workers, aggregating it, storing it, and sending an event signaling the work is done.

![](https://cdn-images-1.medium.com/max/1024/1*8bBnJqOLyZmkiwNeSpUVHQ.png)<figcaption>The backend engine of a Digital Assets Management System (DAM) — A classic example of serverless workloads with a twist.</figcaption>

Resizing images is [one](https://cloudonaut.io/serverless-image-resizing-at-any-scale/) of the [most](https://read.acloud.guru/serverless-image-optimization-and-delivery-510b6c311fe5) [common](https://sketchboard.io/blog/serverless-image-resize-with-amazon-lambda) [examples](https://aws.amazon.com/solutions/serverless-image-handler/) on using serverless. This is the fan-out approach.

A client uploads a raw image to the Assets S3 Bucket. API Gateway has an integration to handle uploading directly to S3.

A lambda function is triggered by S3. Having one lambda function to do all the work can lead to limit issues. Instead, the lambda pushes an Asset Created event to SNS so our processing lambdas get to work.

There are three lambda functions for resizing — on the right. Each creates a different image size, writing the result on the Renditions bucket.

The lambda on the bottom reads the metadata from the original source — location, author, date, camera, size, etc. and adds the new asset to the DAM’s Assets Table on DynamoDB, but doesn’t mark it as ready for use. Smart auto-tagging, text extraction and content moderation could be added to processing lambdas with [Rekognition](https://aws.amazon.com/rekognition/image-features/) later.

![](https://cdn-images-1.medium.com/max/1024/1*QMsQOv8R3JB4XfLx2WJ80Q.png)<figcaption>The Manager App consumes assets via the DAM API.</figcaption>

For the Fan-in part of the DAM, we have a lambda function that’s listening to the renditions bucket, when there’s a change on the bucket it checks if all renditions are ready, and marks the assets ready for use.

With the event-driven nature of serverless, and given the resource limits of lambda functions we favor this type of choreography [over orchestration](https://specify.io/concepts/microservices#choreography).

**_Considerations_** : Not all workloads can be split in small enough pieces for lambda functions. Failure should be considered on both flows, otherwise a task might stay unfinished forever. Leverage lambda’s [retry strategies](https://docs.aws.amazon.com/lambda/latest/dg/retries-on-errors.html) and [Dead-Letter Queues](https://docs.aws.amazon.com/lambda/latest/dg/dlq.html). Any task that can take over 15 minutes should use containers instead of lambda functions, sticking to the _choreography approach_.

### More resources 📚

- Microsoft’s Azure Architecture Center has an extensive list of [Cloud Patterns](https://docs.microsoft.com/en-us/azure/architecture/patterns/), a solid guide for [best practices](https://docs.microsoft.com/en-us/azure/architecture/best-practices/api-design), a very good overview of [performance anti-patterns](https://docs.microsoft.com/en-us/azure/architecture/antipatterns/) and some [examples](https://docs.microsoft.com/en-us/dotnet/standard/serverless-architecture/serverless-design-examples).
- AWS also has great resources on [Distributed Systems Components](https://docs.aws.amazon.com/aws-technical-content/latest/microservices-on-aws/distributed-systems-components.html), [Serverless in general](https://aws.amazon.com/serverless/), examples in the [Serverless Application Repository](https://aws.amazon.com/serverless/serverlessrepo/), and several [webinar videos](https://aws.amazon.com/about-aws/events/monthlywebinarseries/on-demand/?awsf.ott-on-demand=categories%23serverless&awsf.ott-on-demand-master=categories%23serverless).
- [Jeremy Daly](https://medium.com/u/611b6bf539d2) has an extensive list of [Serverless Patterns](https://medium.com/@jeremydaly/serverless-microservice-patterns-for-aws-6dadcd21bc02). He’s the author of [Lambda API](https://www.jeremydaly.com/projects/lambda-api/) a lightweight API framework, and the [Serverless MySQL](https://www.jeremydaly.com/projects/serverless-mysql/) [module](https://www.npmjs.com/package/serverless-mysql) for managing connections on your lambda functions.
- [Yan Cui](https://medium.com/u/d00f1e6b06a2) has a tonne of content about [serverless](https://theburningmonk.com/topics/programming/aws/serverless/). Including [Design patterns](https://theburningmonk.com/topics/programming/aws/serverless/), [performance](https://theburningmonk.com/topics/programming/performance-programming/), [lots](https://www.realworlddevops.com/episodes/the-business-value-of-serverless-with-yan-cui) of [points](https://www.protego.io/the-serverless-show-ft-yan-cui-do-we-ever-learn/) of [view](https://www.trek10.com/blog/think-faas-serverless-in-production/), and the best [training on serverless](https://productionreadyserverless.com/). He’s must-follow on the serverless scene.
- [Mike Roberts](https://medium.com/u/9f7737a6c0e7) [writes](https://martinfowler.com/articles/serverless.html) and [talks](http://thoughtworks.libsyn.com/diving-into-serverless-architecture) about serverless in depth.
- [Sascha ☁ Möllering](https://medium.com/u/4858a304914) talks about [Serverless Architectural Patterns and Best Practices](https://www.infoq.com/presentations/serverless-architecture-patterns).
- [Rob Gruhl](https://medium.com/u/de7bb49141c8)’s [Event-sourcing at Nordstrom](https://medium.com/tech-at-nordstrom/adventures-in-event-sourced-architecture-part-1-cc21d06187c7), the post about [Hello Retail!](https://read.acloud.guru/serverless-event-sourcing-at-nordstrom-ea69bd8fb7cc), and the video about [their architecture](https://www.youtube.com/watch?v=O7PTtm_3Os4).
- [swardley](https://medium.com/u/280dd9543ba9) and [Forrest Brazeal](https://medium.com/u/b8d1e8a0e0d8) discussion about [Containers vs Serverless](https://read.acloud.guru/simon-wardley-is-a-big-fan-of-containers-despite-what-you-might-think-18c9f5352147).
- Gregor Hohpe’s [Enterprise Integration Patterns](https://www.enterpriseintegrationpatterns.com/patterns/messaging/) is a catalog of 65 technology-independent patterns, some of which he’s ported [serverless](https://www.enterpriseintegrationpatterns.com/ramblings/google_cloud_functions.html) in Google’s cloud.
- [Twitch](https://medium.com/u/48b36b89f6d6)’s [Design Patterns for Twitch Scale](https://www.twitch.tv/videos/335360204?collection=8zVaW4B4YhU1pA) touches on several interesting points about patterns that can apply for scale.
- [Capital One Tech](https://medium.com/u/73d9ee9c08c8) [“When to React vs. Orchestrate”](https://medium.com/capital-one-tech/microservices-when-to-react-vs-orchestrate-c6b18308a14c) is an excellent post about choreography vs orchestration.