> [!tldr] An infinite library of digital content > [!meta] I've been meaning to write an article explaining my understanding of how the internet works using a standard library as a metaphor. This is a half-hearted start to that while I'm in an airplane. The internet works like an infinite library, but instead of books with pages you have websites with web pages. The shelves of the library are **servers**. > [!def] **Server** is just another word for *computer*, really. It implies a computer who's job is to send things to other computers, but aside from that they aren't special. On these shelves are books, which are websites. Websites are comprised of [[HTML CSS and JavaScript]]. HTML is the content of the book and its structure - its chapters and words. CSS is the presentation of the book - it's [[Font != Typeface|typeface]], how big the words and margins are, and JavaScript lets the book do neat things like move its content around while you look at it. Rather than the ISBN and the Dewy Decimal system, these books have a [[URI|URL]] and an IP Address. The URL is unique and could be used to find the book indirectly. The IP Address is also unique, but tells you *directly* where the book should be. A search engine (before the era of [[Large Language Models|LLMs]]) was a librarian or card catalog that would help you find a book based on what you ask it. In this library, you cannot physically move anywhere - you cannot go get the books. Instead there are a ton of people standing somewhat evenly spaced around the library. These are the routers. Each is uniquely addressed and knows the addresses of the routers it can see. They pass messages and books around without ever moving themselves, sort of like those lines of army men you imagine handing sandbags to each other. They only really have to know who's right next to them and what general shelves those people would lead to. Your internet service provider (ISP) gives you your own router, who hooks you into this network of other routers. Your computer is your own shelf at the library (your shelf has its own dewy decimal number) and the browser is your desk you sit at that you can use to read any book currently on your shelf. When you want to visit a website (ie get a book from other another shelf) you create a request on your desk. Your request has a URL and the location of your own shelf (exactly like a return address on a letter). It may be a simple post car, or an envelope full of papers and information, but ultimately it functions like a piece of mail. The browser hands this request your router. Your ISP consults their card catalog[^2] to lookup the shelf (IP Address) where that book is kept. It finds that book is on shelf `165.045`. It passes along your request to its router. Its router figures out which router is the first one in the general direction of `165.045`. It might see a router that says 'I can pass along anything that starts with `16x`'. So it asks that router to pass along a request from your desk. The router for `16x` finds its closest neighbor router for specifically `165`, and passes along your request and the address of your shelf. The `165` router looks around it to find the next router on the way to the self location of `165.045`. This process continues until the router for the exact right shelf gets the request. This router talks to the server, which is akin to going and interacting with the shelf full of books. If that page is secret or has restrictions, it will check the request it received against a list of criteria it has that let it determine if it should give you what you want. These criteria could be user IDs, or other such things your browser sticks in your request's envelope. The server finds the book, finds the first *page* [^3]of the book, makes a **copy** that page, and sends *that page*[^1] back into the network of routers using the address of your shelf. The communication back from the server that has the book you want to your computer is the exact same process, just backwards. The routers look around and hand requests and copy of the page of the book you want to each other until they reach your router and are made available on your shelf. Your browser lets you pull the page down from the shelf and presents it to you on your desk. ## Notion Metaphor Applying this metaphor to explain [[Notion]] (or Google Docs, or any other web app for your content). Notion is a very fancy shelf. Rather than your notes and papers being stored on your own shelf, they let you use their fancy shelf (sometimes for a price). They have it set up in some really neat ways they've designed. If you want to change on one of your Notion notes, you request the note as is. It filters through the network of routers to Notion's server. Notions server makes a copy of your note as is and sends it back to your shelf. Your browser lets you edit that copy. As you make your edits (or when you hit "save") your browser is making a list of instructions and sending them back into the network of routers where it finds its way back to Notion's server. Notion's server gets the request, verifies you are allowed to make it, then reads the instructions you sent and changes your stuff on their shelves. **** # More ## Source - self [^1]: Except in the case of [[Single Page Applications]] where it essentially sends the whole book, because the book is sort only one page long. [^2]: Does a "DSN Lookup" [^3]: Or whichever specific page you've asked for, if you've asked for a specific page