text
stringlengths
0
2.29k
**Jerod Santo:** \[laughs\] Uh-oh...
**Gerhard Lazu:** Do you see where this is going? \[laughter\] Cool, great.
**Jerod Santo:** Well, it wasn't me... Clearly...
**Gerhard Lazu:** I know...
**Jerod Santo:** I merged it, but I didn't review it.
**Gerhard Lazu:** I think I waited for a while and said, "You know what - I'm just gonna push this through", because that's how we roll.
**Jerod Santo:** There you go.
**Gerhard Lazu:** No, that's fine. That's fine.
**Jerod Santo:** No, even if I reviewed it, I must have not reviewed it very well, so... You know...
**Gerhard Lazu:** That's okay. Yeah, it was an honest mistake.
**Jerod Santo:** Totally.
**Gerhard Lazu:** On both our parts.
**Jerod Santo:** On both our parts.
**Adam Stacoviak:** I want to chase that rabbit down... I've got a question for you. So once we put this experiment into production, Jerod, what's going to happen? Can you come back to the beginning, where if we get this potentially smart Postgres feature out there... Let's say it's successful. What happens? What happe...
**Jerod Santo:** So what happens is every single request that goes to one of our feeds will be served live from Postgres, from what I call like a feeds cache inside our Postgres instance. So it's effectively -- it's as if it was reading off disk, but we don't have a disk, because we're in Fly land... But it's just on d...
**Gerhard Lazu:** \[58:03\] I think what's more important is that this enables us to run more than one instance of Changelog.
**Jerod Santo:** Exactly.
**Gerhard Lazu:** Right now, because of how caching is done, we can only have one instance of Changelog. And we have been on this journey for quite some time now. Right? If you remember, we had a persistent disk. So we did have a local disk. But when we had that, it meant that we could only have a single instance, beca...
**Jerod Santo:** Right. Yeah, the other thing lets us do is serve different feeds to different requesters. And so here's why this might be interesting... So Spotify specifically supports, allegedly - I haven't seen it working very much... They support chapters, if you put them as text in your show notes, using the YouT...
Well, we could just serve from using this system. We could have two different versions of the feed, both put into Postgres, use the request header to identify Spotify, because it has a standard request, and serve a slightly different feed to Spotify than we serve to everybody else, and give them those timestamps. So yo...
And so this also enables that, where you can basically have N caches per request, and serve the right one dynamically, but still have it precomputed. So it's kind of the best of both worlds. By the way, to our listener, I realized this is kind of a dumb way of doing it. If it's super-dumb, and you have reasons why, ple...
**Adam Stacoviak:** "I'm about to roll it out...!"
**Gerhard Lazu:** I don't think it is.
**Adam Stacoviak:** Why is it dumb? Why do you keep saying this? Why do you think it's dumb? What's the logic behind it being dumb?
**Jerod Santo:** Storing precomputed text inside of Postgres - it's somewhat large. I read some -- like, how big is too big, and it's like 2.3 megabytes in a Postgres record. It seems like it's fine, actually, but once you start getting up to like 100 megabytes, now you're in trouble. We're not going to make it there w...
**Gerhard Lazu:** I think this is a step in the right direction, because Fly brings the app closer to the users.
**Jerod Santo:** Right.
**Gerhard Lazu:** And Fly really makes it less necessary to run a CDN, or maybe completely unnecessary, depending on the case. If we want to depend less on the CDN, which I think is a good idea, and if we distributed our apps around the world, that means that we can rely less on the CDN - which by the way, had like all...
\[01:02:12.28\] And by the way, Fly itself, it has a proxy, it has a global proxy, which means that depending on where you are, those edge instances, they will connect to the app instance which is closest to the edge. So then we are pulling more of that stuff in our app, which makes us be able to code more things, as J...
**Jerod Santo:** Right. And we built our own little version control inside of Fastly, between Gerhard and I, by adding a comment and putting whose name it is at Last Edited, which we would love to just have our actual programming tooling.
**Adam Stacoviak:** It seems smart...
**Jerod Santo:** If it takes us to where we wanna go, I agree with you 100% that having our app be its own CDN, so to speak, closer to all the users, which is what Fastly is giving us, at the app level, then it can be dynamic in ways that is possible with Fastly, but it's just cumbersome to this day.
**Adam Stacoviak:** Yeah. And I guess one more layer here is we haven't truly embodied the vision of Fly, which is our app close to our users, because of this cache issue. This is full circle; the whole reason for this cache experiment was to be able to bring to fruition that actual dream with no ops, or very, very lit...
**Jerod Santo:** Well, our app does run close to our users in the greater Houston area... \[laughter\]
**Gerhard Lazu:** Yeah... It's actually in Virginia.
**Jerod Santo:** Oh, is it?
**Gerhard Lazu:** Yeah, yeah.
**Jerod Santo:** Well. It shows what I know.
**Gerhard Lazu:** It's the IAD data center. Yeah.
**Adam Stacoviak:** Yeah. Well, all that to say, getting to this direction is is challenging. I think the logic in this Postgres sounds fine. I mean, if we were, like you had said, above a larger threshold... A couple megs, not that big of a deal. And if the app is close to the user, and there's one -- I'm assuming the...
**Jerod Santo:** Yeah, the writes would actually happen on publish. The writes happen on edit, not on first request, which is what happens now with a typical caching. First request, we calculate it once. Now we're not going to calculate it again for 60 seconds. Then we'll calculate it once. This is actually on write, i...
The other option is to put this on a static file server like S3, and then manage and blow away different files. But then I started thinking, like, we actually like our URLs, how they are, and so then our app would be reading from S3 and responding as a proxy... And it's like "Well, it was already proxy to Postgres." I ...
**Adam Stacoviak:** And I'm in that camp. I mean, I listen to our show immediately, as soon as we ship The Changelog at least... I mean, as just a crazy person, whenever you ship something, you want to make sure it's in production. And the only way to do it is like to test it. And the app I use is Overcast primarily. I...
**Jerod Santo:** Right.
**Adam Stacoviak:** \[01:06:06.04\] ...because it's better... But I'm a Master feed subscriber in that regard, and pull to refresh, and it does take a bit for the new episodes to get there, for me at least. So I'm not like I ship it and 30 seconds or a minute later it's in Overcast. It takes longer than I've counted, l...
**Gerhard Lazu:** The one thing about this which gets me really excited is that we will double down on PostgreSQL. So we talked about this for a while... Crunchy Data is what I'm thinking. But it's not the only way.
**Adam Stacoviak:** In what regard are you thinking Crunchy Data?
**Gerhard Lazu:** I'm thinking a PostgreSQL as a service, that scales really, really well, so then the app is all Fly. PostgreSQL is managed via Crunchy Data. We have a global presence, nicely replicated, all that nice stuff. And then we consume PostgreSQL as a service at a global scale. Our app runs at a global scale,...
**Adam Stacoviak:** Isn't that the point though for like the read servers that are distributed?
**Gerhard Lazu:** So we could add multiple PostgreSQL read replicas in Fly; we could do that. Maybe tune them... Maybe. I don't know. Maybe try and understand better what they do... But maybe, rather than doing that, we can grow up our approach to databases, and go with someone that does this as a service. I know Plane...