Building "Delicious" and Understanding Networking Basics π
Solving a Problem: The Birth of Delicious π΄
The Problem:
Imagine a student like Alex in the early 2000s:
Browsing the web from his hostel computer, he finds valuable links.
Later, at the library, he wants to revisit those links but has no seamless way to access them across devices.
Solutions were primitive: writing links in notebooks, emailing them to himself or relying on browser history (which wasnβt portable).
The Solution:
Delicious allowed users to:
Create an account.
Bookmark their favorite web links.
Access those bookmarks from any computer by logging into their account.
This simple yet powerful concept tackled a real need, at a time when browsers didnβt support synchronized bookmarks.
The product became an instant success, illustrating how identifying a pain point can lead to impactful innovation.
From Idea to Execution: Setting Up the First System π»
Building the System:
The creator of Delicious started small:
Wrote code to handle requests like login, fetching bookmarks, and adding new ones.
Ran this code on his laptop, keeping it operational 24/7 to process user requests.
Early Architecture:
Backend: Exposed APIs to handle requests from users (e.g., login, fetch bookmarks, add bookmarks).
Frontend: A simple website allows users to interact with the system.
Connectivity: Users type
www.delico.us
into their browser, and the laptop processes their requests.
This initial setup was suitable for a small user baseβperhaps 10 to 30 usersβbut was bound to face scalability challenges as the user base grew.
Understanding Networking: Public and Private IPs π
The Role of IP Addresses:
To make Delicious accessible to users worldwide, the system needed an IP address:
Just like a physical address helps locate a person, an IP address locates a device on the internet.
Public vs. Private IPs:
Public IP Address:
Unique and accessible globally.
Required for external devices to communicate with the system.
Example: Hosting a website for global access.
Private IP Address:
Restricted to a specific network (e.g., a company intranet or home network).
Not reachable from the public internet.
Delicious needed a public IP address to ensure global reachability.
Static vs. Dynamic IPs:
Static IP Address:
Fixed and unchanging.
Leased from an Internet Service Provider (ISP).
Ensures consistent availability but comes at a cost.
Dynamic IP Address:
Assigned temporarily by an ISP.
Cheaper but changes periodically, which can disrupt access to hosted services.
For a startup like Delicious, a static public IP address was essential to maintain consistent access for users worldwide.
Scaling Challenges: Preparing for Growth π
While starting with a laptop was sufficient for early experiments, scaling introduced new challenges:
Single Point of Failure:
A laptop hosting the entire system meant downtime if the machine failed or was turned off.
Limited Capacity:
A single machine could only handle a small number of simultaneous requests.
Global Accessibility:
Requests from different regions required robust networking solutions, such as load balancing and replication, which were absent in the initial setup.
Laying the Networking Foundation: Public IP and DNS π
How the Internet Locates Servers:
When a user types www.delico.us
into their browser:
The browser sends a request to a DNS server (Domain Name System) to resolve the domain name into an IP address.
If the IP address is public, the request is routed to the server hosting Delicious.
Key Takeaways for Delicious:
A static public IP ensured uninterrupted accessibility.
The system required proper DNS configuration to map
www.delico.us
to its IP address.
The Bigger Picture: Transitioning from Dorm Room to Enterprise
As Delicious grew, it needed to move beyond a single laptop. High-level design principles would play a critical role in scaling the system:
Distributed Architecture: Introducing multiple machines for handling computation, storage, and caching.
Load Balancing: Ensuring requests are distributed evenly across servers to avoid overload.
Fault Tolerance: Building redundancy to prevent downtime from hardware or software failures.
By solving a simple problem, Delicious became an early example of how high-level design principles turn ideas into scalable, real-world solutions.
As we delve deeper into this blog-series, weβll continue to uncover the strategies that power todayβs largest systems. Stay tuned! π
Last updated