6 ms·
Talk Python in Production
- mikeckennedy 1y agoThe idea of the book is to pull away a lot of the hype of big cloud providers, show practical steps how we run things over at Talk Python (podcast, courses, e-commerce, and more).I hope some of you find this refreshing! You can read the first 1/3 online for free. The rest is available DRM free.
- hshdhdhehd 1y agoAmazing what a Hetzner dedi and docker compose can do
- randomtoast 1y agoI recently compared AWS and Hetzner, not only in terms of raw compute costs but also by factoring in the personnel costs required for operation. I found this perspective particularly interesting: https://beuke.org/hetzner-aws/ https://beuke.org/hetzner-aws/
- Kumzy 1y agoSeems interesting, read the online summary. I am curious to read about your part on Chapter 14 (I am part of Litestar maintainer). Thank you for the book anyway !
- mikeckennedy 1y agoVery cool Kumzy. Litestar is awesome, I interviewed some of the folks (you?) on the podcast. I give it some good press in that chapter.
- fastasucan 1y agoSomething is wrong with the js/css on the site - for everyone with dark mode the <strong> text is grey against white background - super hard to read.
- sionisrecur 1y agoThe dark mode still has a white background so there's no reason to have it.
- mikeckennedy 1y agoWhat are you talking about for dark mode on the site. There is no option to toggle the theme on the site. In the book, inside of readers like kindle on ipad, maybe. But for the site as you mention, there is no dark mode. Is this some janky extension you use that isn't working? That's note the site's fault.
- MyOutfitIsVague 1y agoIf the user's OS and/or browser is set to dark mode. The site doesn't need to have a switch; its CSS has the media queries.
- mikeckennedy 1y agoAh, the change was so subtle I didn't realize it was happening. I updated the site so it's nice regardless of theme (dark/light) on the OS.
- bakugo 1y agoHow much of the book is AI generated? Please be honest.
- mikeckennedy 1y agoZero percent of the text is AI generated. The image, yes, but I spent 9 months writing this book personally.
- divbzero 1y agoYou noted using persistent volumes for storing data, e.g.: docker volume create umami-volume How do you manage data backup and restore?
- mikeckennedy 1y agoHey, you just run whatever backup command you would regularly do via compose. For example, if you run `sqldump --db umami ...` in regular postgres (which is what they are using IIRC), then you run: docker exec umami "sqldump --db umami ..." Or something almost exactly like this (just from memory here and I wrote that script a year ago).
- VBprogrammer 1y ago"Have you heard the phrase "You're not Google, you're not Facebook, and you're not Netflix"? The TL;DR; is those tech giants that have 1M+ concurrent users. They have a hard requirement for no downtime." Actually, one of the more interesting parts of the Google SRE book was that they don't try to aim for 0 downtime. They consider the background error rate of any network request and optimising much beyond this is counter productive. Even for individual services they make a point of not trying to make them perfectly available, as this means downstream services are less likely to build in adequate provision for failure.
- hshdhdhehd 1y agoChoose how many nines you want. For most 99.9% availability is probably OK.
- 1dom 1y agoI agree with this. Those tech giants got to where they are by recognising specifically that they don't have "no downtime" requirements. "Move fast and break things" isn't the mantra of companies with zero downtime requirements.
- kinix 1y agoUnrelated to the content: why on earth is super-light grey a good "bold" colour for a white background? I'm having to highlight each of the bolded parts of the text just to understand it :/ edit: console command for anyone else struggling to read this `document.documentElement.style.setProperty('--bulma-strong-color', '#000');`
- azangru 1y agoHaha, came here to mention the light grey text on white background as well. This is a great example of poor accessibility. It should be obvious to a human eye that this is bad; but in case it weren't, one could open up Chrome dev tools, find the styles for this text, click on the color picker, and observe that Chrome reports the contrast ratio for that text to be 1.17, whereas a comfortable (accessible) contrast ratio starts at 4.5.
- perch56 1y agoLoads as a regular webpage for me (Safari, black font, white background).
- JimDabell 1y agoIt only happens if you are using dark mode. That seems to be the only difference between light and dark mode on that site.
- kinix 1y agoThe main text is black yes, but anything that's bold is light grey as per the CSS, which is near unreadable (even if you're not as colourblind as me I suspect)
- nickez 1y agoOnly if your system/browser is set to dark mode
- mikeckennedy 1y ago
- aitchnyu 1y agoIs there a catch in "It's 6x cheaper than DO and a whopping 20x cheaper than Azure" or are most companies I know getting ripped off?
- brap 1y agoDepends on which $$s go into that comparison. Server costs? Probably. Engineering time? Accounting for all kinds of risks? Unlikely.
- rcxdude 1y agoI don't think I've seen a cloud-first company that spent less engineering time on managing their infrastructure. You just replace one set of work with another.
- data_marsupial 1y agoSometimes it results in more work because of the lowered upfront cost of spinning up new cloud services
- rcxdude 1y agoA lot are getting ripped off. To what degree depends on their tech capabilities and business savvy (i.e. what would it cost them to do it themselves and what kind of discount can they negotiate from the cloud provider. If you're paying the listed rates you are getting ripped of).
- aitchnyu 1y agoAt which monthly spend should we negotiate with AWS for example? And will they check if we are using 25 of their services instead of easily migratable VM-hosted apps?
- MyOutfitIsVague 1y agoThose numbers bother me. What does it mean to be "6x cheaper"? Is that a sixth the price? If something costs $100, what is 6x cheaper than it? 2x cheaper? 1x cheaper? It is as frustrating as when people use "200% faster" to mean exactly the same thing as "twice as fast", and "100% faster" to mean the same thing.
- maeln 1y agoDidn't yet go through the content, but having a AI generated image that you didn't even bother to at least touch-up a bit to fix the text does not give me a lot of confidence about the effort that went into this.
- ayhanfuat 1y agoI’m an occasional listener of the Talk Python podcast, and I’ve also taken Michael’s pytest course. It’s clear that he puts considerable effort into his content.
- seanthemon 1y agobut clearly he lapsed here and as a non-listener I immediately clicked out.
- mikeckennedy 1y agoHey Sean. I spent 9 months writing this book by hand. Yes the image is AI but the book is certainly not. You're definitely not obligated to read it, but I do want to comment that I put a ton of effort into the project.
- seanthemon 1y agoHi Mike! If you spent 9 months writing this book by hand, couldn't you do the courtesy of commissioning an artist to make you a cover image by hand as you clearly see the value of doing things by hand and not stealing the hard work of all the artists who have worked tirelessly to make art by hand only for AI to steal that work and for you to prompt it in seconds. Put more effort into respecting other art forms and you might not get this reception next time.
- maeln 1y agoIn which case it is very infuriating and sad. Honestly if he just did not put that AI art on every page, the whole thing would look way more serious. Presentation and first impression sadly do matter. Put a pile of trash in a museum and people will think it's art, put art next to a pile of garbage and people will think it's trash.
- CraigJPerry 1y agoYou can and probably should go thinner than this, with uv we effectively have a workflow comparable to deploying static binaries in other language stacks. You don't need the complexity of docker for this book's goal. Was hoping the book would cover data persistence.
- portly 1y agoCould you please elaborate? Where do you run your apps?
- rcxdude 1y agoPresumably just directly on whatever system they are using. If you have something that can be plopped on whatever linux distro and run reliably then you've already got what docker is supposed to give you.
- CraigJPerry 1y agoExactly as sibling comment says, e.g. let's pretend the popular httpx cli was my project to deploy and run on the server. With only uv installed, i can: uv tool run "httpx[cli] @ git+https://github.com/encode/httpx" To be clear in this example i'm not pulling a package published on pypi, i'm running the HEAD of that git repo (i could do a branch or tag instead). I could use the "uvx" shortcut instead of "uv tool run". I could specify a specific python version (either one already installed on this OS or choose a dist which uv downloads for me). This caches the deps in an isolated virtual env for me. It'll only download the deps in the first run.
- mikeckennedy 1y agoThis go thin with uv is good advice for smaller projects. But as you grow with more aspects, it gets more problematic. I ran code that way for years. But now we have 23 different services: web apps, APIs, and database servers, my code and other self-hosted services. I would NOT run 23 projects/servers (3 versions of postgres) this way. Like so much, it depends. FWIW, the book goes into depth about these trade-offs.
- csmantle 1y agoI don't know, but the "Read Online" button leads me to "https[://]talkpython.fm/books/python-in-production/#read-online", and that URL then tries to redirect to "https[://]talkpython.fm/books/python-in-production#read-online". (Notice how the last slash of the path is missing). This forced my browser to reload the page, and it beats the entire purpose of anchoring and fragment-based navs.
- fastasucan 1y agoIronically what is styled as <strong> </strong> is very hard to read as its almost the same color as the background.
- tha182HatR 1y agoThe book needs to remove the AI images. They are actively hurting the eyes with the wrong and weird perspective. It is pretty light reading, name dropping a lot of software without going into details. As always with Python: These books do not tell you the downsides, and the future of Python is uncertain because the governance has been taken over by a bunch of mediocre weirdos. Python core has always suffered from the problem that occasionally smart people implement something and then leave, but the majority of core devs are pretty dumb and they can now vote in their own after van Rossum left.
- divbzero 1y agoThanks for describing your experience with Granian. I have stuck with Gunicorn and Uvicorn so far but am now motivated to try the newer alternative.
- mikeckennedy 1y agoNice. I used uwsgi -> gunicorn -> gunicorn with uvworkers -> granian. Granian is great. While not crazy popular along, it's really based on Rust's Hyper, see https://crates.io/crates/hyper https://crates.io/crates/hyper Hyper has 400M downloads so safe to say it's pretty battle tested. I interviewed the creator of Granian on Talk Python BTW.
- lunias 1y agoI'm glad to see people recognizing that computers are quite fast and that they don't need massive cloud-scale solutions for simple problems. That being said, Python really shines as glue code and in small scripts where performance doesn't matter. You'll see considerable performance (and likely maintainability) gains by moving off of Python to almost any other language.