- Backend Weekly
- Posts
- Part 3: Understanding System Design - Proxies
Part 3: Understanding System Design - Proxies
Understanding the importance of Proxies in System Design
Hello “👋”
Welcome to another week, another opportunity to become a Great Backend Engineer.
Today’s issue is brought to you by LaraFast, a Laravel SaaS Starter Kit with ready-to-go components for Payments, Auth, Admin, Blog, SEO, and more.
Before we get down to the business of today. Part 3 of Understanding System Design.
I have a gift for you: You will love this one.
If you build products with Laravel without a boilerplate, then you will end up repeating yourself on:
Auth
Payments Integration
Admin Dashboard
Blog
SEO
etc
Larafast has already taken care of all these.
Why not get the boilerplate and focus only on the business logic while the boilerplate handles those repetitive tasks?
You can GET THE LARAFAST boilerplate and build products in weeks, not months. Use my link above to get $100 off.
That’s the gift I have for you today. Stop coding from scratch and move fast with Larafast.
Now, back to the business of today.
In the previous edition, we described system design as a major phase in software development. It’s a phase where we describe the elements of a system, like architecture, components, modules, interfaces, and data, based on the system requirements.
We looked at a system's key characteristics. We can trade off scalability, Availability, Reliability, and Efficiency.
In this episode, we will look at the components of a system, starting with Proxies.
What are Proxies?
A proxy server is a piece of hardware or software that acts on behalf of a client or server. There are two types of proxy servers:
Forward Proxy Server
Reverse Proxy Server
Proxies are vital components in improving a system's performance. A reverse proxy offloads most of your infrastructure concerns for a significantly traffic-distributed application. A good example of a reverse proxy is Nginx.
Forward Proxy Server
A forward proxy server sits on the client side and forwards web requests on behalf of the client. When clients request web content, it goes to the proxy first, and then the proxy forwards the request to the web server on behalf of the client using its IP address.
The web server sends the response back to the proxy, which forwards the response to the client. In this scenario, the web client is anonymous to the web server. An example of a forward proxy is a Virtual Private Network(VPN), which hides the client's identity.
Benefits of forwarding proxy server
User IP Address is hidden - Enables a user to hide identity, therefore guarding privacy.
Easy access to Geo-Blocked/Restricted Content—Some online content is hidden behind geo-restrictions, primarily because of copyright restrictions. A proxy server can bypass these restrictions.
Caching - Forward Proxy server may cache requested data and store them for later. This may significantly reduce user page load time.
Improved Security - The Proxy filters and blocks known websites that are malicious to the user.
Reversed Proxy Server
A reverse proxy sits before one or more servers, intercepting the client's requests. The proxy then forwards the request to the destination server and receives responses. The clients think it is directly communicating with the destination server. In this case, the proxy resides on the server side and ensures no client interacts directly with the origin server.
Benefits of a reverse proxy server
Load Balancing—Reverse proxies can be used as load balancers to distribute incoming web traffic to multiple web servers.
Caching—A reverse Proxy server may cache data, reducing the user's response time and improving the system's performance.
Improved Security - Proxy servers offer protection from DDoS attacks. A DDoS attack is used to exponentially increase requests to the servers to overwhelm them and bring the services down. An example is the attack on GitHub, which was bombarded by requests 126.9 million requests per second. Within 10 minutes, GitHub sounded an alarm and routed the traffic to its DDoS mitigation service, which sorted and blocked the malicious traffic. Proxies can protect the servers from DDos by detecting whether a spike in traffic is legitimate, offering a traffic scrubbing effect.
SSL termination—The proxy can handle incoming HTTPS connections, decrypting and passing the unencrypted requests onto the web servers. A single configuration point eliminates installing SSL certificates in different back-end web servers. It takes the processing load of encryption and decryption away from the web servers.
Logging and Auditing - Proxies makes an excellent point of logging and auditing because the proxy routes all the HTTP requests.
Disadvantages of a reverse proxy server
Increased Complexity - Adding proxies to the architecture increases system complexity.
Single Point of Failure—A single proxy can introduce a point of failure, and adding multiple proxies will complicate the system further.
That’s all
Today, I discussed Proxies. I introduced you to the basics of proxies and reverse and forward proxies. In addition, I elucidated the benefits, advantages, and disadvantages of each proxy.
Next week, I will cover a very important topic in System Design: Load Balancers.
DON’T LEARN ALONE. SHARE THIS NEWSLETTER WITH YOUR FRIENDS
I hope this guide gives you perspective on System Design Performance Metrics.
That will be all for this one. See you on Saturday.
Don’t forget to get the Larafast Boilerplate. It comes with unmatched benefits for building products in days.
Backend Engineering Resources
Whenever you're ready
There are 4 ways I can help you become a great backend engineer:
1. The MB Platform: Join 1000+ backend engineers learning backend engineering on the MB platform. Build real-world backend projects, track your learnings and set schedules, learn from expert-vetted courses and roadmaps, and solve backend engineering tasks, exercises, and challenges.
2. ​The MB Academy:​ The “MB Academy” is a 6-month intensive Advanced Backend Engineering BootCamp to produce great backend engineers.
3. MB Video-Based Courses: Join 1000+ backend engineers who learn from our meticulously crafted courses designed to empower you with the knowledge and skills you need to excel in backend development.
4. GetBackendJobs: Access 1000+ tailored backend engineering jobs, manage and track all your job applications, create a job streak, and never miss applying. Lastly, you can hire backend engineers anywhere in the world.
LAST WORD đź‘‹
How am I doing?
I love hearing from readers, and I'm always looking for feedback. How am I doing with The Backend Weekly? Is there anything you'd like to see more or less of? Which aspects of the newsletter do you enjoy the most?
Hit reply and say hello - I'd love to hear from you!
Stay awesome,
Solomon
I moved my newsletter from Substack to Beehiiv, and it's been an amazing journey. Start yours here.
Reply