text stringlengths 0 1.8k |
|---|
[761.24 --> 770.52] because we want to set up a database and it's not an embedded database. So we need to start a |
[770.52 --> 772.00] database. Which one? |
[772.80 --> 778.68] In this case, it will be Postgres, probably. It was built with MySQL, but I'm sort of transitioning |
[778.68 --> 784.82] it to Postgres as a little bit of a preference of mine. In this case, Docker is mostly serving as sort |
[784.82 --> 791.62] of being so industry standard that it will be familiar to more operations people than actually |
[791.62 --> 793.24] just running a binary would be. |
[793.24 --> 799.28] Yeah. I mean, that's interesting because I think if you are shipping just the app itself, |
[799.72 --> 805.48] then a binary, that's okay, right? Executible, just run it and off it starts. It's no different |
[805.48 --> 811.98] than, for example, a Docker container. Now, if you do have dependencies like Postgres SQL, |
[812.62 --> 817.36] how do you get that started? And which version will you get? And will the package manager have |
[817.36 --> 824.72] the version that you get? And will it have SSL enabled? Maybe it will, maybe it won't. So all |
[824.72 --> 830.52] that configuration now is starting to get into the whole configuration aspect of it. So how do you |
[830.52 --> 834.72] configure it? How do you get them to talk? What about, I don't know, maybe you need to do some |
[834.72 --> 839.80] tunings in Postgres SQL. Will you be shipping them as well? Or will you just let the team that runs it |
[839.80 --> 840.84] figure that part out? |
[840.84 --> 848.08] Yeah. And in this case, we would want to take care of all of that and just provide the Docker |
[848.08 --> 854.12] Compose and like, go ham. And whenever there's an update, maybe we need to tell them to pull a new |
[854.12 --> 861.64] Docker Compose, or maybe they just need to update an image or, but yeah, when you have additional |
[861.64 --> 866.38] infrastructure and you need someone else to set it up, that's a different case for, from, for example, |
[866.38 --> 873.26] how I run my own stuff. Just small services I run. I run beambloggers.com, which is just |
[873.26 --> 879.72] scraping RSS feeds for the Beam community. So if you want to track sort of Erlang and Elixir, |
[880.56 --> 891.28] that's a good place to get an ever-growing RSS feed. But the way I do that is just a release that I |
[891.28 --> 899.72] actually build on a server and stand up there because the availability level I need to maintain |
[899.72 --> 901.58] on that one is whatever I feel like. |
[902.50 --> 908.52] That's a good one. I think that has merit, right? I mean, some use cases, that's perfectly fine. |
[908.52 --> 913.32] Nothing wrong with that. It's all contextual. I keep mentioning this. If that works for you, |
[913.74 --> 918.72] that's great. There's no problem, right? And maybe someone could benefit from that simplicity. |
[918.72 --> 924.92] And that system particularly actually stores all its data in memory. And whenever I restart it, |
[924.94 --> 927.48] it just blows it away and it refitches it from the web. |
[927.84 --> 929.00] That's interesting. Okay. |
[929.26 --> 934.98] It was a fun way of building it, mostly. It means I don't have to deal with any database setup for |
[934.98 --> 940.60] that particular service. I have a few different services where I just keep things around in memory |
[940.60 --> 946.26] because they are fairly ephemeral or like the history isn't particularly important. |
[946.26 --> 951.86] So what I'm hearing is that there are stateless systems, stateless services, which means that |
[951.86 --> 958.48] you could start them anywhere and they would gather data just in time after they boot or maybe part of |
[958.48 --> 963.72] the booting process. I'm not sure when exactly it happens, but there's no state that you have to |
[963.72 --> 971.66] move with a service. So for example, if you were to stand this bean bloggers elsewhere on boot, |
[971.66 --> 976.30] it would get all the data that it needs and would start serving it, it would need to run on a specific |
[976.30 --> 976.80] machine. |
[977.30 --> 984.92] Yeah. So it's very, at least very independent. It's stateful when it runs in that it keeps a lot |
[984.92 --> 992.52] of state around, but it absolutely does not rely on some source of state or needing to carefully |
[992.52 --> 999.84] manage state when it goes up and down. For some other services where I do want to keep history around, |
[999.84 --> 1006.78] I've started using SQLite much more than I used to because that's also operationally much simpler |
[1006.78 --> 1014.12] than Postgres. And I don't find Postgres particularly challenging. It's easy enough to manage and I like |
[1014.12 --> 1021.78] it. But SQLite is even easier and makes a lot of sense if you don't have a lot of heavy needs. And I've |
[1021.78 --> 1031.00] recently seen, so there's a project called Lightstream, which solves one of my bigger concerns with SQLite, |
[1031.00 --> 1038.64] which is replicating it or at least having a very recent backup because it's very easy to accidentally |
[1038.64 --> 1046.42] blast away a file on disk. So it hooks into the write-ahead log of SQLite and just ships it to |
[1046.42 --> 1055.10] NES3 compatible storage on any update. So it does an ongoing replication of SQLite and then you can |
[1055.10 --> 1060.40] just restore from that. I don't think it's necessarily feasible to do sort of high availability |
[1060.40 --> 1068.20] with SQLite. But I mean, if I was building a product right now, sort of a small scale SaaS or |
[1068.20 --> 1074.56] that kind of thing, this would definitely be something I consider. There was a Hacker News thread around the |
[1074.56 --> 1083.60] time that Lightstream got some attention. It's done a few rounds. Someone mentioned running a product |
[1083.60 --> 1090.02] on SQLite and I think they'd benchmarked it to 10,000 reads a second to 5,000 writes a second |
[1090.02 --> 1098.70] on an NVMe drive. That's a lot of read and write activity. A lot more than I would typically expect |
[1098.70 --> 1106.60] to need to serve for a small scale SaaS. And if you can scale with just using something like SQLite |
[1106.60 --> 1112.10] up to that level, then you're probably successful enough that you can switch it out for something |
[1112.10 --> 1118.24] else at that point and make all those decisions about complexity. That is a very good point, |
[1118.44 --> 1124.68] actually. Lightstream, it will be in the show notes, but it's lightstream.io. It's Ben Johnson, |
[1124.68 --> 1131.28] Ben B. Johnson. I think he was on Changelog at some point. I remember this coming up and you're right. |
[1131.38 --> 1136.30] I mean, he's Ben Johnson. He's the author of Bold DB. So, you know, he has some experience in this |
[1136.30 --> 1142.08] area. Let's put it that way. I do remember it sounding really interesting. So you can check it |
[1142.08 --> 1149.68] out if you want. But my takeaway is that you like keeping things simple. And if it gets the job done, |
[1150.30 --> 1153.84] that's it. That's all it needs to be. It doesn't need to be fancy. It doesn't need to be impressive. |
[1153.84 --> 1159.38] It doesn't need to be, you know, look at me, you know, I've done it in this way that no one else |
[1159.38 --> 1165.26] has done it before. It doesn't have to be that. It just has to work. Yeah. And if this works for you, |
[1165.46 --> 1174.08] that's great. Yeah. And since I do consulting for a number of different clients, it's, |
[1174.60 --> 1180.04] I always have to adapt to whatever's already there. So the client that I will be shipping |
[1180.04 --> 1186.68] on-prem for doesn't actually have a thing in place. So that's sort of me putting my opinions |
[1186.68 --> 1193.04] and stamp on that. I'm there to solve that problem. But in other cases, there's an existing ops |
[1193.04 --> 1200.32] person or ops team and I'm mostly shipping code and then I'll roll with whatever they have. And |
[1200.32 --> 1204.92] if I don't like it, I'll be swearing a little bit under my breath and maybe giving them some |
[1204.92 --> 1211.96] some opinions, but, but typically I'm happy to roll with whatever's, whatever's there. |
[1212.38 --> 1217.24] I don't really believe in making radical changes to software that's already working, |
[1217.24 --> 1222.74] even if it's not working in the way you think it maybe should. But there is this |
[1222.74 --> 1230.52] trend also in, particularly in the Beam ecosystem where there's a lot of things you can get done by |
[1230.52 --> 1238.60] using only the Beam. The Beam ship actually ships with an, a distributed database inside of it. |
[1239.08 --> 1247.08] So Amnesia, it has a lot of challenges. It has some sort of conflict resolution problems when you run |
[1247.08 --> 1253.88] it in a distributed fashion. So I haven't been keen on using it for anything else than sort of caching, |
[1253.88 --> 1260.12] but with SQLite in place, then you can actually use the sort of standard tooling in Elixir around |
[1260.12 --> 1266.28] Ecto and which is essentially the ORM, not so much objects, but relational mapper, I guess. |
[1266.28 --> 1271.32] Do you know which is the biggest Erlang project that uses Amnesia? |
[1271.64 --> 1273.24] It would probably be WhatsApp. |
[1274.28 --> 1281.16] They do, but they use it in a different way, very different way. So they, as far as I know, |
[1281.16 --> 1287.00] and this was like many years ago, they used it on just a few servers and they used it for, |
[1287.00 --> 1295.24] I think it was just metadata, but like very small metadata. So nothing that is heavy writes or heavy |
[1295.24 --> 1301.88] reads. And I think the eventual consistency was okay for it. So things did not like, like dirty reads, |
[1301.88 --> 1307.16] for example, were a big thing for them, but they used it like on a subset of nodes and I had like |
[1307.16 --> 1312.68] dedicated nodes for that. And I think they wanted to move away from it or there was talk about that. |
[1312.68 --> 1315.00] This was like at least five years ago. |
[1315.00 --> 1315.48] Yeah. |
[1315.48 --> 1322.44] The project which I have in mind and I had a first class C to it is RabbitMQ. And it's one of its |
[1322.44 --> 1330.04] Achilles heels. Amnesia, oh wow. Like if it's at any sort of scale, you start seeing some serious issues, |
[1330.04 --> 1337.32] like 10,000 writes per second. No way. No way. Because it's the synchronization part and you have |
[1337.32 --> 1342.92] to go over a network and you have multiple nodes and it's all synchronous. So you have transactions. |
[1343.88 --> 1351.48] Yeah. So you have to typically look at Amnesia in the context that was created, which was telecom. |
[1351.48 --> 1357.80] And as far as I understand, it was typically between machines that were very tightly coupled together. |
[1358.52 --> 1363.00] I've heard people talk about back planes and I have no idea what that is. So I'm not even going to try. |
[1363.96 --> 1373.72] But yeah, it was about managing. So phone calls and that kind of connecting, which is very different |
[1374.44 --> 1380.92] from your typical sort of web app or like we're keeping everything around forever type of |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.