Python is just the web server. All the truly performance-sensitive components--edge proxy, load balancers, backend services, databases, caches, and storage services--are mostly C++.
I would argue a web server which processes all (or most) requests is a performance sensitive part of the system. Straightforward rewriting from Python to Go in many cases gives at least 2x-3x performance improvement which on FAANG scale can mean huge difference in hardware cost.
Backend of Meta Threads is built with Python 3.10
121–130 of 458 posts
Re: Backend of Meta Threads is built with Python 3.10
#122Earlier quoted context omitted.
If you want real irony here, it's this: powering an app called Threads with Python that's got a global interpreter lock which makes threading hard. Get it? Threads, threading...? OK, I'll see myself out.
Gotten burned by that. Have a python utility that calls something that's very CPU intensive (GDAL) and I literally have to wrap this python process in java for real concurrency. Not a python expert by any means but I'd love to know what other people do when this happens. I'm assuming it's something revolving around containers and messaging (blech)...
Python calling a concurrent c thing is super common. For more complex things there is multiprocessing, but that essentially is simplification of IPC.
Re: Backend of Meta Threads is built with Python 3.10
#123Really, all the performance intensive parts are in various c++ aggregator and recommendation type services. But the webserver is Django, yes.
How heavily are type annotations and type checking used in the codebase?
Re: Backend of Meta Threads is built with Python 3.10
#124Earlier quoted context omitted.
Threads is a mobile-only app, like Instagram. You can't actually use Threads on a desktop browser, so that's probably why this is shared as a Twitter post. Even if it were a Threads post, it would not be submittable to HN.
Not exactly true. They have a read-only browser view. In fact a Thread thread has already been on the front of HN. https://news.ycombinator.com/item?id=36609632
Re: Backend of Meta Threads is built with Python 3.10
#125Earlier quoted context omitted.
Interesting and lovely to hear they decided to use Django. What is your source, though?
How is Django now? I’m a long time python dev (data eng space) but new-ish to web dev. I started a Flask project 2 years ago and found it to be pretty full of footguns, mixed messaging on best practices for scalable apps, and the ecosystem feels overbloated with vapor ware extensions. Is this just a Flask problem, or does Django have the same issues?
Re: Backend of Meta Threads is built with Python 3.10
#126For the “Python isn’t fast enough for production backend” crowd from the same company that brought you the largest social network built on PHP + MySQL.
You mean the company that had to create their two PHP implementations and a translator to C++, to actually scale?
Re: Backend of Meta Threads is built with Python 3.10
#127Earlier quoted context omitted.
Not exactly true. They have a read-only browser view. In fact a Thread thread has already been on the front of HN. https://news.ycombinator.com/item?id=36609632
I see these https://www.threads.net/t/xxx links to specific threads, but is there any top level page where you can search for stuff or browse ? https://www.threads.net just has a QR code (to install the app presumably).
But there's no broader browser yet it seems.
Re: Backend of Meta Threads is built with Python 3.10
#128For the “Python isn’t fast enough for production backend” crowd from the same company that brought you the largest social network built on PHP + MySQL.
Absolutely shocking.
Re: Backend of Meta Threads is built with Python 3.10
#129Earlier quoted context omitted.
You mean the company that had to create their two PHP implementations and a translator to C++, to actually scale?
They ended up compiling PHP to assembly! Facebook is a company that will go to ridiculous lengths to avoid rewrites.
So they created their own language Hack so allow a slow transfer from PHP to Hack. Which is basically the idea behind Kotlin.
Re: Backend of Meta Threads is built with Python 3.10
#130For the “Python isn’t fast enough for production backend” crowd from the same company that brought you the largest social network built on PHP + MySQL.