<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Valentin Planchon on Medium]]></title>
        <description><![CDATA[Stories by Valentin Planchon on Medium]]></description>
        <link>https://medium.com/@valentin.planchon?source=rss-d8e636587898------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Valentin Planchon on Medium</title>
            <link>https://medium.com/@valentin.planchon?source=rss-d8e636587898------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 06:08:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@valentin.planchon/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[# What happens when you type `https://www.google.com` in your browser and press Enter?]]></title>
            <link>https://medium.com/@valentin.planchon/what-happens-when-you-type-https-www-google-com-in-your-browser-and-press-enter-184abce676dc?source=rss-d8e636587898------2</link>
            <guid isPermaLink="false">https://medium.com/p/184abce676dc</guid>
            <dc:creator><![CDATA[Valentin Planchon]]></dc:creator>
            <pubDate>Wed, 03 Jun 2026 16:23:50 GMT</pubDate>
            <atom:updated>2026-06-03T16:34:32.853Z</atom:updated>
            <content:encoded><![CDATA[<p>It looks instant. You type a URL, hit Enter, and a fraction of a second later Google’s homepage appears. But behind that “instant” page load, your request travels through one of the most sophisticated systems humanity has ever built. Let’s slow it down and walk through every step.</p><p>This is one of the most classic software engineering interview questions — not because the interviewer wants a perfect recital, but because it reveals how deeply you understand the web stack on top of the internet. So let’s break it down.</p><p><strong>— -</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EkbLlybGKKYWoN1S1eXKww.png" /></figure><p><strong>## Step 1 — The DNS request: turning a name into an address</strong></p><p>Computers don’t talk to each other using names like `www.google.com`. They use <strong>**IP addresses**</strong> (e.g. `142.250.179.196`). So the very first thing your browser needs is to translate the human-friendly domain name into a machine-friendly IP address. This translation is done by the <strong>**DNS (Domain Name System)**</strong> — the phone book of the internet.</p><p>When you press Enter, your browser checks a series of caches before asking the network:</p><p>1. <strong>**Browser cache**</strong> — did I resolve this name recently?</p><p>2. <strong>**OS cache**</strong> — has the operating system stored it?</p><p>3. If not, it asks a <strong>**DNS resolver**</strong> (usually run by your ISP).</p><p>If the resolver doesn’t know the answer, it performs a <strong>**recursive lookup**</strong>:</p><p>- It asks a <strong>**root server**</strong>: “Who handles `.com`?”</p><p>- The root server points it to the <strong>**TLD server**</strong> for `.com`.</p><p>- The TLD server points it to Google’s <strong>**authoritative name server**</strong>.</p><p>- That authoritative server finally returns the <strong>**IP address**</strong> for `www.google.com`.</p><p>The answer is cached at each level (with a TTL — Time To Live) so the next lookup is much faster. Now your browser knows <em>*where*</em> to send its request.</p><p><strong>— -</strong></p><p><strong>## Step 2 — TCP/IP: building a reliable connection</strong></p><p>Knowing the IP address isn’t enough — we need a reliable channel to actually exchange data. That’s the job of <strong>**TCP/IP**</strong>, the foundational protocol suite of the internet.</p><p>- <strong>**IP (Internet Protocol)**</strong> handles <em>*addressing and routing*</em>: it makes sure packets find their way from your computer to Google’s server, hopping through routers across the world.</p><p>- <strong>**TCP (Transmission Control Protocol)**</strong> handles <em>*reliability*</em>: it splits data into packets, guarantees they arrive in order, and re-sends anything lost.</p><p>Before any data is exchanged, TCP performs its famous <strong>**three-way handshake**</strong>:</p><p>1. <strong>**SYN**</strong> — your computer says “I want to talk.”</p><p>2. <strong>**SYN-ACK**</strong> — the server replies “I’m ready, are you?”</p><p>3. <strong>**ACK**</strong> — your computer confirms “Let’s go.”</p><p>Because we typed `https://`, the connection targets <strong>**port 443**</strong> (the standard port for secure web traffic). At this point a reliable pipe exists between your machine and the server.</p><p><strong>— -</strong></p><p><strong>## Step 3 — The firewall: gatekeeper of the network</strong></p><p>Your request doesn’t travel through an open field — it passes through <strong>**firewalls**</strong> on the way out of your network and, more importantly, before reaching Google’s infrastructure.</p><p>A <strong>**firewall**</strong> is a security system that monitors and filters incoming and outgoing traffic based on a set of rules. It decides what is allowed through and what gets blocked. For example, it will typically allow traffic on port 443 (HTTPS) while blocking suspicious ports or known-malicious IP addresses.</p><p>Firewalls protect the infrastructure against unauthorized access and many types of network attacks. Only legitimate, well-formed traffic on the expected ports makes it through to the next stage.</p><p><strong>— -</strong></p><p><strong>## Step 4 — HTTPS/SSL: encrypting the conversation</strong></p><p>Our connection is reliable, but is it <em>*private*</em>? Over plain HTTP, anyone between you and the server (on public Wi-Fi, for instance) could read your traffic. The `s` in `https` fixes that: it adds a layer of encryption via <strong>**SSL/TLS**</strong>.</p><p>After the TCP handshake, a <strong>**TLS handshake**</strong> takes place:</p><p>1. The server presents its <strong>**SSL certificate**</strong>, which proves its identity and is signed by a trusted <strong>**Certificate Authority (CA)**</strong>.</p><p>2. Your browser verifies the certificate is valid and trusted.</p><p>3. Both sides agree on encryption keys (using asymmetric cryptography to safely exchange a shared symmetric key).</p><p>4. From now on, all data is <strong>**encrypted**</strong> end to end.</p><p>This protects you against <strong>**eavesdropping**</strong> and <strong>**man-in-the-middle**</strong> attacks. Your request — and Google’s response — are now unreadable to anyone in between.</p><p><strong>— -</strong></p><p><strong>## Step 5 — The load balancer: spreading the traffic</strong></p><p>Google serves billions of requests. No single server could handle that. So your encrypted request first reaches a <strong>**load balancer**</strong>.</p><p>A <strong>**load balancer**</strong> (such as HAProxy) sits in front of a pool of servers and distributes incoming requests across them. Using an algorithm like <strong>**Round Robin**</strong> (each request goes to the next server in turn) or <strong>**Least Connections**</strong> (to the least busy server), it ensures:</p><p>- <strong>**No single server is overloaded.**</strong></p><p>- <strong>**High availability**</strong> — if one server fails, traffic is routed to the healthy ones.</p><p>- <strong>**Scalability**</strong> — more servers can be added behind it as traffic grows.</p><p>The load balancer picks a healthy server and forwards your request to it.</p><p><strong>— -</strong></p><p><strong>## Step 6 — The web server: handling the HTTP request</strong></p><p>The request lands on a <strong>**web server**</strong> (such as Nginx or Apache). The web server’s job is to handle the <strong>**HTTP layer**</strong>:</p><p>- It serves <strong>**static content**</strong> directly — HTML, CSS, JavaScript, images.</p><p>- For <strong>**dynamic content**</strong>, it passes the request along to the application server.</p><p>Think of the web server as the front desk: it receives every request, answers the simple ones immediately, and routes the complex ones deeper into the building.</p><p><strong>— -</strong></p><p><strong>## Step 7 — The application server: running the logic</strong></p><p>For anything dynamic — a personalized page, a search query — the request goes to the <strong>**application server**</strong> (running the code base, e.g. via PHP-FPM, a Python/Java/Go process, etc.).</p><p>The application server <strong>**executes the business logic**</strong>: it processes your request, runs the application code, and figures out what data is needed to build the response. This is where the actual “thinking” of the website happens.</p><p><strong>— -</strong></p><p><strong>## Step 8 — The database: fetching the data</strong></p><p>To build a meaningful response, the application often needs stored data — and that lives in a <strong>**database**</strong> (such as MySQL, PostgreSQL, or a distributed store).</p><p>The application server <strong>**queries the database**</strong> for the information it needs (search results, user data, configuration). In large infrastructures, databases are often set up as a <strong>**Primary-Replica cluster**</strong>: the <strong>**Primary**</strong> handles writes, while <strong>**Replicas**</strong> handle reads to spread the load and add redundancy.</p><p>The database returns the requested data to the application server.</p><p><strong>— -</strong></p><p><strong>## The journey back</strong></p><p>Now everything happens in reverse:</p><p>1. The <strong>**application server**</strong> builds the response using the data from the database.</p><p>2. It hands the result back to the <strong>**web server**</strong>.</p><p>3. The web server sends the <strong>**HTTP response**</strong> through the <strong>**load balancer**</strong>.</p><p>4. The response is <strong>**encrypted via TLS**</strong> and travels back over the <strong>**TCP/IP**</strong> connection.</p><p>5. Your <strong>**browser**</strong> receives the HTML, parses it, builds the <strong>**DOM**</strong>, fetches additional resources (CSS, JS, images), and <strong>**renders**</strong> the page.</p><p>And there it is — the Google homepage, on your screen.</p><p><strong>— -</strong></p><p><strong>## Conclusion</strong></p><p>What feels like a single instant is actually a relay race across DNS resolution, TCP/IP transport, firewalls, TLS encryption, load balancing, web and application servers, and databases — all cooperating in a fraction of a second.</p><p>Understanding this journey isn’t just interview trivia. It’s the mental map every backend, SRE, and DevOps engineer uses to reason about performance, security, and reliability. The next time a page loads “instantly,” you’ll know just how much had to go right.</p><p><strong>— -</strong></p><p><em>*Written by Valentin Planchon — Holberton School.*</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=184abce676dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python 3: Mutable, Immutable… Everything is Object!]]></title>
            <link>https://medium.com/@valentin.planchon/python-3-mutable-immutable-everything-is-object-d767c953bb0c?source=rss-d8e636587898------2</link>
            <guid isPermaLink="false">https://medium.com/p/d767c953bb0c</guid>
            <category><![CDATA[python-object]]></category>
            <dc:creator><![CDATA[Valentin Planchon]]></dc:creator>
            <pubDate>Fri, 03 Apr 2026 07:18:25 GMT</pubDate>
            <atom:updated>2026-04-03T07:18:25.342Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fCUmJ20N0JuL05PQ-cI2WQ.png" /></figure><h3>Introduction</h3><p>In Python, <strong>everything is an object</strong>. Whether you’re working with an integer, a string, a list, or even a function — they are all objects. This might sound abstract at first, but understanding this concept is fundamental to writing efficient and bug-free Python code.</p><p>This blog post explores how Python handles objects under the hood, the critical distinction between <strong>mutable</strong> and <strong>immutable</strong> types, and why this matters when you pass arguments to functions. If you’ve ever been surprised by a list changing “on its own” or wondered why two variables with the same integer seem to share the same identity — read on.</p><h3>id and type</h3><p>Every object in Python has three things: a <strong>value</strong>, a <strong>type</strong>, and an <strong>identity</strong>.</p><ul><li>type() tells you <strong>what kind</strong> of object it is.</li><li>id() tells you <strong>where</strong> in memory the object lives (its unique identity).</li></ul><pre>&gt;&gt;&gt; a = 89<br>&gt;&gt;&gt; type(a)<br>&lt;class &#39;int&#39;&gt;<br>&gt;&gt;&gt; id(a)<br>140234866486832</pre><pre>&gt;&gt;&gt; b = &quot;Hello&quot;<br>&gt;&gt;&gt; type(b)<br>&lt;class &#39;str&#39;&gt;<br>&gt;&gt;&gt; id(b)<br>140234866486960</pre><p>Two variables can point to the <strong>same object</strong> in memory. You can check this with the is operator (which compares ids) versus == (which compares values):</p><pre>&gt;&gt;&gt; a = 89<br>&gt;&gt;&gt; b = 89<br>&gt;&gt;&gt; a == b<br>True<br>&gt;&gt;&gt; a is b<br>True       # Python caches small integers!<br>&gt;&gt;&gt; id(a) == id(b)<br>True</pre><pre>&gt;&gt;&gt; a = [1, 2, 3]<br>&gt;&gt;&gt; b = [1, 2, 3]<br>&gt;&gt;&gt; a == b<br>True       # Same value<br>&gt;&gt;&gt; a is b<br>False      # Different objects in memory!</pre><p><strong>Key takeaway:</strong> == checks equality of values, is checks identity (same object in memory).</p><h3>Mutable Objects</h3><p><strong>Mutable objects</strong> can be modified after creation <strong>without changing their identity</strong> (their id stays the same).</p><p>Common mutable types: list, dict, set, bytearray.</p><pre>&gt;&gt;&gt; my_list = [1, 2, 3]<br>&gt;&gt;&gt; id(my_list)<br>140234866250048</pre><pre>&gt;&gt;&gt; my_list.append(4)<br>&gt;&gt;&gt; print(my_list)<br>[1, 2, 3, 4]<br>&gt;&gt;&gt; id(my_list)<br>140234866250048   # Same id! The object was modified in place.</pre><p>This means that if two variables reference the <strong>same list</strong>, modifying one will affect the other:</p><pre>&gt;&gt;&gt; a = [1, 2, 3]<br>&gt;&gt;&gt; b = a           # b points to the SAME list object<br>&gt;&gt;&gt; a.append(4)<br>&gt;&gt;&gt; print(b)<br>[1, 2, 3, 4]       # b is affected because a and b are the same object<br>&gt;&gt;&gt; a is b<br>True</pre><h3>Immutable Objects</h3><p><strong>Immutable objects</strong> cannot be modified after creation. Any operation that seems to “change” them actually creates a <strong>new object</strong>.</p><p>Common immutable types: int, float, str, tuple, bool, frozenset.</p><pre>&gt;&gt;&gt; a = 89<br>&gt;&gt;&gt; id(a)<br>140234866486832</pre><pre>&gt;&gt;&gt; a = a + 1<br>&gt;&gt;&gt; print(a)<br>90<br>&gt;&gt;&gt; id(a)<br>140234866486864   # Different id! A new object was created.</pre><p>The same applies to strings:</p><pre>&gt;&gt;&gt; s = &quot;hello&quot;<br>&gt;&gt;&gt; id(s)<br>140234866120176</pre><pre>&gt;&gt;&gt; s = s + &quot; world&quot;<br>&gt;&gt;&gt; id(s)<br>140234866121520   # New string object created</pre><p>Tuples are also immutable:</p><pre>&gt;&gt;&gt; t = (1, 2, 3)<br>&gt;&gt;&gt; t[0] = 99<br>TypeError: &#39;tuple&#39; object does not support item assignment</pre><p><strong>Important note about Python’s integer caching:</strong> Python pre-caches small integers (typically -5 to 256) for performance. This is why:</p><pre>&gt;&gt;&gt; a = 256<br>&gt;&gt;&gt; b = 256<br>&gt;&gt;&gt; a is b<br>True     # Same cached object</pre><pre>&gt;&gt;&gt; a = 257<br>&gt;&gt;&gt; b = 257<br>&gt;&gt;&gt; a is b<br>False    # Different objects — outside the cache range</pre><h3>Why Does It Matter?</h3><p>The mutable/immutable distinction has <strong>real consequences</strong> in your code:</p><h3>1. Aliasing vs. Copying</h3><p>With <strong>mutable</strong> objects, assignment creates an <strong>alias</strong> (a second reference to the same object):</p><pre>&gt;&gt;&gt; a = [1, 2, 3]<br>&gt;&gt;&gt; b = a          # Alias — same object<br>&gt;&gt;&gt; b.append(4)<br>&gt;&gt;&gt; print(a)<br>[1, 2, 3, 4]      # a is modified too!</pre><p>To get an independent copy, you must be explicit:</p><pre>&gt;&gt;&gt; a = [1, 2, 3]<br>&gt;&gt;&gt; b = a[:]       # Shallow copy using slicing<br>&gt;&gt;&gt; b.append(4)<br>&gt;&gt;&gt; print(a)<br>[1, 2, 3]          # a is NOT modified<br>&gt;&gt;&gt; print(b)<br>[1, 2, 3, 4]</pre><p>ith <strong>immutable</strong> objects, this problem doesn’t exist — since you can’t modify the object, “aliasing” is safe:</p><pre>&gt;&gt;&gt; a = 42<br>&gt;&gt;&gt; b = a<br>&gt;&gt;&gt; b = b + 1      # Creates a NEW int object<br>&gt;&gt;&gt; print(a)<br>42                  # a is unchanged</pre><h3>2. Dictionary Keys</h3><p>Only <strong>immutable</strong> (hashable) objects can be used as dictionary keys:</p><pre>&gt;&gt;&gt; d = {(1, 2): &quot;tuple key&quot;}   # OK — tuple is immutable<br>&gt;&gt;&gt; d = {[1, 2]: &quot;list key&quot;}    # TypeError — list is mutable</pre><h3>How Arguments Are Passed to Functions</h3><p>Python uses a mechanism often called <strong>“pass by object reference”</strong> (or “pass by assignment”). It’s neither pure pass-by-value nor pass-by-reference — it passes the <strong>reference to the object</strong>.</p><h3>With immutable objects:</h3><pre>def increment(n):<br>    n = n + 1      # Creates a new int object; local variable n is reassigned<br>    print(f&quot;Inside: n = {n}&quot;)</pre><pre>a = 10<br>increment(a)<br>print(f&quot;Outside: a = {a}&quot;)</pre><p>Output:</p><pre>Inside: n = 11<br>Outside: a = 10     # a is unchanged — immutable object</pre><p>The function receives a reference to the integer 10. When n + 1 is computed, a <strong>new</strong> integer object 11 is created and assigned to the local variable n. The original variable a still points to 10.</p><h3>With mutable objects:</h3><pre>def add_element(my_list):<br>    my_list.append(4)    # Modifies the object in place<br>    print(f&quot;Inside: {my_list}&quot;)</pre><pre>a = [1, 2, 3]<br>add_element(a)<br>print(f&quot;Outside: {a}&quot;)</pre><p>Output:</p><pre>Inside: [1, 2, 3, 4]<br>Outside: [1, 2, 3, 4]   # a IS modified — mutable object</pre><p>he function receives a reference to the <strong>same list</strong>. Since lists are mutable, .append() modifies the original object. Both the function&#39;s local variable and a point to the same list.</p><h3>Reassignment inside a function:</h3><p>However, if you <strong>reassign</strong> the variable inside the function (even with a mutable type), the original is not affected:</p><pre>def replace_list(my_list):<br>    my_list = [4, 5, 6]   # Local reassignment — new object<br>    print(f&quot;Inside: {my_list}&quot;)</pre><pre>a = [1, 2, 3]<br>replace_list(a)<br>print(f&quot;Outside: {a}&quot;)</pre><p>Output:</p><pre>Inside: [4, 5, 6]<br>Outside: [1, 2, 3]   # a is unchanged — the local variable was reassigned</pre><h3>Practical implication:</h3><p>If you want a function to work on a list <strong>without modifying the original</strong>, pass a copy:</p><pre>def safe_modify(my_list):<br>    my_list = my_list[:]   # Work on a copy<br>    my_list.append(4)<br>    return my_list</pre><pre>a = [1, 2, 3]<br>b = safe_modify(a)<br>print(a)  # [1, 2, 3] — unchanged<br>print(b)  # [1</pre><h3>Conclusion</h3><p>Understanding that everything in Python is an object — and knowing whether that object is mutable or immutable — is essential for writing predictable code. The key takeaways:</p><ul><li><strong>id()</strong> gives an object&#39;s memory identity; <strong>type()</strong> gives its class.</li><li><strong>Mutable objects</strong> (lists, dicts, sets) can be changed in place — beware of aliasing.</li><li><strong>Immutable objects</strong> (int, str, tuple) create new objects on “modification” — safe from side effects.</li><li>Python passes <strong>references to objects</strong>, not copies. This means mutable objects can be modified inside functions, while immutable ones cannot.</li></ul><p>Knowing these fundamentals will save you from subtle bugs and help you write cleaner, more intentional Python code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d767c953bb0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>