Live data from Hacker News

Backend of Meta Threads is built with Python 3.10

twitter.com

121–130 of 458 posts

Re: Backend of Meta Threads is built with Python 3.10

#121

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.

Developer velocity is extremely important at FAANG scale.

Re: Backend of Meta Threads is built with Python 3.10

#122
post #117

Earlier 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)...

Is your problem that the c part of GDAL isn't concurrent and you are calling it multiple times, or are you blocking on something you shouldn't?

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

#123
post #55

Really, 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?

It’s fully typed and nothing can be merged that doesn’t pass the type checker

Re: Backend of Meta Threads is built with Python 3.10

#124
post #16

Earlier 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

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).

Re: Backend of Meta Threads is built with Python 3.10

#125
post #96

Earlier 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?

Django is excellent. There are some rough edges and signs of age, but the core ORM is fantastic to develop with.

Re: Backend of Meta Threads is built with Python 3.10

#126
post #115

For 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?

They ended up compiling PHP to assembly! Facebook is a company that will go to ridiculous lengths to avoid rewrites.

Re: Backend of Meta Threads is built with Python 3.10

#127

Earlier 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).

You can get to users profiles too and view their posts: https://www.threads.net/@zuck.

But there's no broader browser yet it seems.

Re: Backend of Meta Threads is built with Python 3.10

#128

For 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.

They wrote a new app in the language 99.9% of 0-5 year experienced devs know.

Absolutely shocking.

Re: Backend of Meta Threads is built with Python 3.10

#129
post #115

Earlier 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.

I thought they tried it multiple times. The problem is they had so many developers writing new code any rewrite attempt would fall behind super quickly?

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

#130

For 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.

For me, it does seem really strange since PHP (currently) is faster than Python and PHP wasn't fast enough for Facebook. But it's interesting to see how it'll play out.
Post reply on HN