DEV Community

Cover image for Recognizing Design Patterns in System Design - Facade pattern and AWS API Gateway
Denise Ignatova
Denise Ignatova

Posted on

Recognizing Design Patterns in System Design - Facade pattern and AWS API Gateway

Making sense of the structure of your code and seeing the big picture has been a goal for every developer ( at least every one I know ), and I am not exception.
I have been struggling to have an overview of the project I have been working on, and this was affecting my confidence and my productiveness as a developer.
Certain that I need to go back to the basics, started reading again "Head First Design Patterns" and consulting with the amazing refactoring guru site https://refactoring.guru/design-patterns.
Long story cut short, starting learning and looking for parallels between the existing design patterns and modern system designs.
One that is very easy recognizable is Facade pattern.
What do we know about Facade pattern.
Facade pattern is a member of so called Structural patterns. It provides a simple interface for a complex logic. What would that mean , this means that you would have one point of contact in your codebase that behind the scene distributes the logic to the relevant parts of your project.
Real world example image taken from https://refactoring.guru/design-patterns/facade

Image description

Now the Question, how this Facade pattern relates to a System Design that we know and probably use everyday.(Drum rolls)....

AWS API Gateway:

Image description

https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html

Can you see the similarities in both images?
Can you clearly see the Facade in the illustrated situation?
For me this was an eye opener, and realizing that I can re-learn and re-use this knowledge was pivotal moment and breaking change in my understanding of system design and design patterns.
The diagram shows how AWS API Gateway is used to distribute and handle different API calls by being that one point of contact. The benefits of course of using API Gateway are countless, and this short blog is not about this. It is about how to make use of design patterns knowledge to apply effective and optimal decisions while building and designing systems in the modern serverless world.

Thank you for reading!
Excited to see and read your feedback!

Top comments (0)