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 an exception.
I have been struggling to see from above, to have an overview of the projects I have been working on, and this was affecting my confidence and my productiveness as a developer.
Overwhelmed and certain that I need to go back to the basics, and thanks to the incredible girls from Women Coding Community and their amazing design-patterns course, I started reading again "Head First Design Patterns" by Eric Freeman and Elisabeth Robson - link to the book and consulting with the amazing refactoring guru site link to the site.
Learning and searching for parallels between the existing and well-known design patterns and modern system designs.
One design pattern 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 link to facade pattern
Now the Question, how this Facade pattern relates to a System Design that we know and probably use everyday.(Drum rolls)....
AWS API Gateway:
An Obvious winner...!
Can you see the similarities in both images?
Can you clearly see the Facade in the illustrated situation?
Did you see how AWS API Gateway offers a simple interface and hides the complexity of handling multiple calls and redirecting them to the relevant consumer?
The diagram shows how AWS API Gateway is used to distribute and handle different API calls by being that one point of a contact.
In this line of thoughts (light-bulb), wait a second..., what about the Load Balancer:
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html
It is also an example of providing single entry point of contact( simple interface) , that hides behind a complex logic.
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 benefits of using API Gateway and Load Balancer are countless, and this short post 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.
Seeing the similarities, recognizing the patterns is a powerful capability. Pumped with this knowledge, you would be able to write better code, to architect better design systems.
Thank you for reading!
Excited to read your feedback and comments!
Top comments (0)