WEBVTT

00:00:00.994 --> 00:00:10.917
<v Ava>Okay, I want to start with a question. When you open a website, close it, come back tomorrow, and it still knows who you are. How does it do that?

00:00:10.967 --> 00:00:12.444
<v Andrew>Honestly? Magic.

00:00:12.494 --> 00:00:13.938
<v Ava>Andrew.

00:00:13.988 --> 00:00:24.853
<v Andrew>No, no, I know it isn't magic. But think about how strange it is. That website has never met you. Every single time you click a button, it's like a stranger walking up to a counter.

00:00:24.903 --> 00:00:28.468
<v Ava>A stranger who somehow has your usual order.

00:00:28.518 --> 00:00:37.859
<v Andrew>Right! And here's the thing. The web was originally built to forget you. Every request arrives completely fresh, like the website has the memory of a goldfish.

00:00:37.909 --> 00:00:39.841
<v Ava>So someone had to fix that.

00:00:39.891 --> 00:00:48.003
<v Andrew>Someone did. And the fix is so small and so clever that I think it's one of the great quiet inventions. We'll get to it. I promise.

00:00:48.053 --> 00:00:51.186
<v Ava>But first, you've found us a very specific example.

00:00:51.236 --> 00:01:02.414
<v Andrew>I have. A website built by one person, with no staff, for their own small group. And it turns out that this tiny site uses almost every big idea on the modern internet.

00:01:02.464 --> 00:01:04.190
<v Ava>Okay. I'm in.

00:01:10.230 --> 00:01:13.252
<v Andrew>Welcome to SimpleFlock Unpacked. I'm Andrew.

00:01:13.302 --> 00:01:15.900
<v Ava>And I'm Ava. This is episode one, The Big Picture.

00:01:15.950 --> 00:01:23.257
<v Andrew>Here's the idea of the show. We take one small, real website and we unpack it, piece by piece. No programming experience needed.

00:01:23.307 --> 00:01:28.086
<v Andrew>If you've ever wondered what's actually going on behind the screen, this is for you.

00:01:28.136 --> 00:01:32.973
<v Ava>And we'll be honest, there will be restaurants involved. You'll see.

00:01:33.023 --> 00:01:36.747
<v Andrew>There will be restaurants. Okay. So first, what is SimpleFlock?

00:01:38.350 --> 00:01:46.949
<v Ava>So the way I understand it, SimpleFlock is a website where a small group, like a Bible study or a church group, gets its own private page.

00:01:46.999 --> 00:01:57.156
<v Andrew>Right. And that page holds a few things. A bulletin of upcoming events. A table showing who's doing which job each week. Prayer requests. And songs.

00:01:57.206 --> 00:01:59.807
<v Ava>Who's doing which job. Like, who brings the snacks?

00:01:59.857 --> 00:02:08.651
<v Andrew>Exactly like that. Who's setting up, who's bringing food, who's leading the songs. Someone taps an empty spot, types their name, and it's theirs.

00:02:08.701 --> 00:02:13.886
<v Ava>That's lovely, actually. That's the thing everyone does badly in a group chat.

00:02:13.936 --> 00:02:18.219
<v Andrew>Yes. Forty messages to find out who's bringing the cups.

00:02:18.269 --> 00:02:20.259
<v Ava>And how do people get in?

00:02:20.309 --> 00:02:28.896
<v Andrew>This is my favorite part. Everyone in the group shares one password. That's it. One link, one password. No app to download, no account to make.

00:02:28.946 --> 00:02:32.039
<v Ava>Wait. One shared password for everybody?

00:02:32.089 --> 00:02:38.802
<v Andrew>For the members, yes. And then one person, or a few people, lead the group and can change the settings.

00:02:38.852 --> 00:02:42.614
<v Ava>Huh. So it's really small in what it asks of you.

00:02:42.664 --> 00:02:55.449
<v Andrew>Tiny. But underneath, here's what it's built from. A part that runs in your browser. A part that runs in the cloud. A database. Logins. Encryption. Email. Automated tests. And a way to publish updates.

00:02:55.499 --> 00:02:56.691
<v Ava>That's... basically everything.

00:02:56.741 --> 00:03:07.441
<v Andrew>That's basically everything a modern web app does. Which is why it's such a good specimen. It's real, it's not huge, and every piece was chosen on purpose, by one person.

00:03:08.970 --> 00:03:11.404
<v Ava>Okay. So you promised me restaurants.

00:03:11.454 --> 00:03:17.852
<v Andrew>I did. So here's the thing. Every website that remembers things for you is doing four jobs.

00:03:17.902 --> 00:03:18.594
<v Ava>Four.

00:03:18.644 --> 00:03:27.898
<v Andrew>Four. One, it shows you something on your screen. Two, it decides who's allowed to see or change what. Three, it stores information so it's still there tomorrow.

00:03:27.948 --> 00:03:33.561
<v Andrew>And four, it has to live on a computer that's switched on all the time, somewhere on the internet.

00:03:33.611 --> 00:03:37.436
<v Ava>Show, decide, store, and keep the lights on.

00:03:37.486 --> 00:03:39.334
<v Andrew>That's it. Now, picture a restaurant.

00:03:39.384 --> 00:03:40.390
<v Ava>Finally.

00:03:40.440 --> 00:03:47.327
<v Andrew>The front end, which is what you see and tap on, is the dining room. The menu, the tables, how the place looks.

00:03:47.377 --> 00:03:49.492
<v Ava>Okay. Dining room is the screen.

00:03:49.542 --> 00:03:59.396
<v Andrew>The back end is the kitchen. It's the code running on a server, which is just a computer that answers requests. It takes your order, checks you're allowed to order it, and prepares it.

00:03:59.446 --> 00:04:04.340
<v Ava>Checks you're allowed to order it. Like a bouncer who also cooks.

00:04:04.390 --> 00:04:11.000
<v Andrew>A very busy chef-bouncer. And then the database is the pantry, and the recipe binder. It's where everything is kept between meals.

00:04:11.050 --> 00:04:14.709
<v Ava>And the fourth job, keeping the lights on?

00:04:14.759 --> 00:04:24.546
<v Andrew>That's called hosting. Hosting means keeping your site on a computer that's switched on and connected to the internet around the clock. The building, and the electricity bill.

00:04:26.323 --> 00:04:33.521
<v Andrew>Did you know the very first web server was a single computer, sitting in an office at a physics lab in Switzerland called CERN?

00:04:33.571 --> 00:04:35.950
<v Ava>One computer? For the whole web?

00:04:36.000 --> 00:04:45.312
<v Andrew>More or less, at the time, yes. And it had a handwritten note stuck on it, in red ink. It said, "This machine is a server. Do not power it down!"

00:04:45.362 --> 00:04:48.264
<v Ava>That's hosting, in one sentence. Keeping the lights on.

00:04:48.314 --> 00:04:56.707
<v Andrew>Because if somebody had unplugged it, the web would have gone dark. Which, to be fair, was a smaller problem than it would be today.

00:04:56.757 --> 00:04:59.918
<v Ava>Just a little.

00:04:59.968 --> 00:05:04.027
<v Ava>Okay, I've got it. Dining room, front end. Kitchen, back end. Pantry, database. Building, hosting.

00:05:04.077 --> 00:05:12.059
<v Andrew>And here's the rule that makes this useful. The kitchen never walks out into the dining room. And the diners never walk into the pantry.

00:05:12.109 --> 00:05:14.276
<v Ava>Why not?

00:05:14.326 --> 00:05:19.891
<v Andrew>Think about it. If any diner could just stroll into the pantry and rearrange things, chaos.

00:05:19.941 --> 00:05:21.522
<v Ava>Right. Somebody takes all the good stuff.

00:05:21.572 --> 00:05:24.742
<v Andrew>So how do they talk? Through the waiter.

00:05:24.792 --> 00:05:26.011
<v Ava>The waiter being?

00:05:26.061 --> 00:05:36.379
<v Andrew>On the web, the waiter is a request and a response. Your screen sends a request, "I'd like the bulletin, please." The kitchen sends back a response, "Here's the bulletin."

00:05:37.136 --> 00:05:42.770
<v Ava>So the browser never reads the database directly. It always asks the kitchen.

00:05:42.820 --> 00:05:48.949
<v Andrew>Always. And that's important, because the kitchen is where the rules are enforced. Who you are, and what you're allowed to do.

00:05:50.965 --> 00:06:01.084
<v Ava>Okay, so, let me say it back. Four jobs. Show, decide, store, keep the lights on. Or in the proper words, the front end, the back end, the database, and hosting.

00:06:01.134 --> 00:06:05.631
<v Ava>And the waiter, the request and response, carries messages between them.

00:06:05.681 --> 00:06:07.561
<v Andrew>Perfect.

00:06:07.611 --> 00:06:16.706
<v Ava>Let me pause, though, because I had a question about the first thing you said. The page that runs in my browser. Is that, like, the whole website?

00:06:16.756 --> 00:06:24.950
<v Andrew>Good question. The part in your browser is the front end. In SimpleFlock's case it runs on your own phone or computer.

00:06:25.000 --> 00:06:33.963
<v Andrew>And the other half runs in the cloud, on a company's computers, which they don't have to own. The owner just uses someone else's.

00:06:34.013 --> 00:06:36.214
<v Ava>And the database lives there too.

00:06:36.264 --> 00:06:42.187
<v Andrew>Right. Both halves and the database, all in one place, with a separate service that sends email when it's needed.

00:06:43.670 --> 00:06:47.359
<v Ava>Okay, now. You said one person built this.

00:06:47.409 --> 00:06:55.348
<v Andrew>Yes. And that's what explains almost every choice in the project. Because a technology only makes sense against its goal.

00:06:55.398 --> 00:06:57.232
<v Ava>So what are the pillars?

00:06:57.282 --> 00:07:07.515
<v Andrew>There are three. And I want you to hold on to these, because we're going to use them all season. Pillar one. It has to be simple for members. One link, one shared password, no app to download.

00:07:07.565 --> 00:07:09.405
<v Ava>So no accounts, no sign-up forms. I like that.

00:07:09.455 --> 00:07:20.897
<v Andrew>Pillar two is the one that surprised me. It has to be private. Many groups share the site, and the owner of the site should not be able to read their prayer requests.

00:07:20.947 --> 00:07:24.835
<v Ava>Wait. The person who built the site, and runs it, can't read what people write on it?

00:07:24.885 --> 00:07:36.676
<v Andrew>That's the design. Everything a group writes is locked in your browser before it's sent. So the owner only ever stores scrambled text. We'll spend a whole episode on how that works.

00:07:36.726 --> 00:07:40.498
<v Ava>That is a surprisingly generous thing to build in.

00:07:40.548 --> 00:07:44.858
<v Andrew>It is. And it costs a lot in complexity, which we'll see. And pillar three. One person has to maintain it.

00:07:44.909 --> 00:07:46.932
<v Ava>Which means?

00:07:46.982 --> 00:07:54.042
<v Andrew>Fewer moving parts beat clever parts. If you're one person, you can only watch so many things at once.

00:07:54.092 --> 00:07:56.837
<v Ava>Simple, private, and maintainable by one person.

00:07:56.887 --> 00:08:06.239
<v Andrew>And here's a trick for thinking about any technology choice. Whenever you wonder, "Why didn't they just use that other thing," test it against those three pillars first.

00:08:07.032 --> 00:08:11.966
<v Ava>Okay, test me. Why not make everyone create their own account?

00:08:12.016 --> 00:08:13.920
<v Andrew>Which pillar does that break?

00:08:13.970 --> 00:08:17.110
<v Ava>Pillar one. It has to be simple for members.

00:08:17.160 --> 00:08:18.265
<v Andrew>There you go. That's the whole method.

00:08:18.315 --> 00:08:23.489
<v Ava>That's... kind of a great way to think about decisions generally.

00:08:23.539 --> 00:08:29.287
<v Andrew>It really is. Most arguments about technology are really arguments about different goals nobody wrote down.

00:08:30.650 --> 00:08:35.489
<v Ava>One more thing I want to know. How big is this thing? Is it huge?

00:08:35.539 --> 00:08:46.148
<v Andrew>Not at all. Roughly three thousand five hundred lines of code for the server, and roughly ten thousand for the front end. Plus tests, a database description, and some scripts.

00:08:46.198 --> 00:08:47.745
<v Ava>And is that a lot?

00:08:47.795 --> 00:08:58.902
<v Andrew>It's small enough that one person can hold it in their head. And that matters, because it's a big reason the choices are the way they are.

00:08:58.952 --> 00:09:04.086
<v Ava>Okay. I have to ask. You said the web forgets you, and that someone fixed it. I want to hear it before we leave.

00:09:04.136 --> 00:09:11.822
<v Andrew>Happy to. But first, you have to guess. When you come back to a website, how does it recognize you?

00:09:11.872 --> 00:09:19.572
<v Ava>Hmm. I'd say it recognizes my computer. Like, every device has an address, and the website just checks its list.

00:09:19.622 --> 00:09:23.334
<v Andrew>That's a really reasonable guess. And it doesn't work.

00:09:23.384 --> 00:09:24.314
<v Ava>Oh no.

00:09:24.364 --> 00:09:35.904
<v Andrew>For a boring reason. Addresses can be shared by lots of people, like everyone on the same cafe wifi, and they can change. So an address alone can't reliably tell a website who you are.

00:09:35.954 --> 00:09:38.547
<v Ava>Okay, fine. So what does it use?

00:09:40.291 --> 00:09:49.398
<v Andrew>A cookie. And the story is great. In nineteen ninety four, an engineer named Lou Montulli was working at Netscape, a company that made one of the first popular web browsers.

00:09:49.448 --> 00:09:53.736
<v Ava>Nineteen ninety four. So the web was brand new.

00:09:53.786 --> 00:10:02.559
<v Andrew>Very new. Another team at Netscape was building an online shopping system for a company called MCI, and they needed a shopping cart. But the web forgot you with every click.

00:10:02.609 --> 00:10:06.588
<v Andrew>Put a pair of shoes in the cart, click to the next page, and the cart is empty.

00:10:06.638 --> 00:10:11.494
<v Ava>A shopping cart with the memory of a goldfish.

00:10:11.544 --> 00:10:17.935
<v Andrew>Exactly. He said it couldn't be done in any reasonable way with what existed. And then, within about a week, the idea came to him.

00:10:17.985 --> 00:10:19.535
<v Ava>What was the idea?

00:10:19.585 --> 00:10:30.424
<v Andrew>The website hands your browser a small note, with a code on it. And from then on, your browser sends that note back every time. The website reads the code and thinks, oh, it's you again.

00:10:30.474 --> 00:10:32.847
<v Ava>Like a wristband.

00:10:32.897 --> 00:10:41.733
<v Andrew>Exactly like a wristband at a festival. And he named it after something called a magic cookie, a term he'd come across in an operating systems course.

00:10:41.783 --> 00:10:45.745
<v Ava>Magic. Andrew, you were right all along!

00:10:45.795 --> 00:10:53.894
<v Andrew>I'll take the win. Though it's more of a very clever note than real magic. And here's the part I love. He designed it so only the website that handed out the note could read it back.

00:10:53.944 --> 00:10:55.551
<v Andrew>It was meant to protect your privacy.

00:10:55.601 --> 00:10:57.084
<v Ava>Meant to.

00:10:57.134 --> 00:11:06.567
<v Andrew>Later on, advertising companies found ways to use cookies to follow people from site to site. That's a big part of why cookies have such a mixed reputation today.

00:11:06.617 --> 00:11:09.621
<v Ava>So a privacy idea became a tracking tool.

00:11:10.423 --> 00:11:20.444
<v Andrew>Which is a good reminder that the people who build a thing don't always get to decide what it turns into. SimpleFlock uses cookies in the original, helpful spirit.

00:11:20.494 --> 00:11:25.140
<v Andrew>And we'll see exactly how they're made hard to fake in the security episode.

00:11:25.190 --> 00:11:28.165
<v Ava>So, not magic. A wristband.

00:11:28.215 --> 00:11:30.493
<v Andrew>A wristband with a very good story.

00:11:31.940 --> 00:11:42.967
<v Andrew>So, here's what to take with you. Every website that remembers things does four jobs, and each one has a name. The front end shows you things. The back end decides who can do what.

00:11:43.017 --> 00:11:49.245
<v Andrew>The database stores the information. And hosting keeps it all running on a computer that never sleeps.

00:11:49.295 --> 00:11:58.650
<v Ava>And SimpleFlock was shaped by three pillars. Simple for members, private, and easy for one person to maintain. If a choice breaks one of those, it's out.

00:11:58.700 --> 00:12:04.577
<v Andrew>And the next time a website remembers you, you'll know it's not magic. It's a wristband.

00:12:04.627 --> 00:12:08.270
<v Ava>Okay, that's what I'm taking with me. So what's next time?

00:12:08.320 --> 00:12:17.612
<v Andrew>Next time, episode two, How the Web Works. We follow what actually happens in the instant between you typing an address and a page appearing.

00:12:17.662 --> 00:12:23.972
<v Andrew>There's a directory, there's a language of requests, and there's a surprising number of numbers.

00:12:24.022 --> 00:12:27.862
<v Ava>And a very good reason that three-digit code, four oh four, is famous.

00:12:27.912 --> 00:12:32.533
<v Andrew>Four oh four, and some of its less famous cousins.

00:12:32.583 --> 00:12:33.812
<v Ava>I'm Ava.

00:12:33.862 --> 00:12:37.191
<v Andrew>And I'm Andrew. Thanks for listening to SimpleFlock Unpacked.

00:12:37.241 --> 00:12:44.137
<v Ava>Music by Kevin MacLeod, at incompetech dot com, used under a Creative Commons Attribution four point oh license.
