Live data from Hacker News

Backend of Meta Threads is built with Python 3.10

twitter.com

151–160 of 458 posts

Re: Backend of Meta Threads is built with Python 3.10

#151
post #60

Earlier quoted context omitted.

Thanks for your comment. I'm really interested in this topic. How do you know the web server is Django? I searched but couldn't find this. Why would they use Django? I did some small projects in it but I assumed it wasn't very fast and wouldn't be suitable for a big app like this. I would like to know the pros and cons. Why didn't they build up something in C++ or Rust? Won't python limit the speed of responses despi…

Most of Facebook is built on PHP. I’m surprised they didn’t choose Laravel.

The web codebase was once written in PHP, but they moved away from that a decade ago.

Re: Backend of Meta Threads is built with Python 3.10

#152
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?

Facebook had hundreds of millions daily active users before writing a compiler.

Re: Backend of Meta Threads is built with Python 3.10

#153

Earlier quoted context omitted.

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 the opposite. It holds your hand and tells you how to structure your "app", templates, database, and media assets. And django-admin is godsend. It's awesome when you are on the beaten path cause everything just works. But if you step of the beaten path you will have to tweak various obscure settings and create weird hooks to override Django's defaults. Flask is the opposite. Just a very well-written web ser…

I've described that as Django is fantastic for writing Django apps. If the thing you want to do can be completely modeled in the defaults, it's impossible to beat.

If that's only 99% true, you might want to investigate other options.

Re: Backend of Meta Threads is built with Python 3.10

#154

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.

It’s obvious why they went with python. Since Instagram was written in python and Threads is based on instagram, they’re probably using a lot of the libraries they already have for Instagram.

Re: Backend of Meta Threads is built with Python 3.10

#155

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.

Quite often, the choice of language is failing to see the forest for the trees. Saving nanoseconds or cycles because you chose C++ over Python pales in comparison to milliseconds spent at network barriers reading from a cache service or database

Perceivable latency isn't the only consideration. Depending on your business, compute for your proprietary workloads might be one of your biggest expenses. You could see an order of magnitude improvement to resource consumption depending on the type of workload and the language it is written in.

Ultimately these these choices are all about trade-offs. Maybe python is fine for them, maybe they've built themselves into a corner. Time will tell.

Re: Backend of Meta Threads is built with Python 3.10

#156
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?

I can't give Django enough praise. I never thought I'd be writing Python.

I've mostly used Node, Java, and Rust, with about 12yrs experience now. Only about one year with Python and Django recently. I am so much more productive than anything else I've tried. Using anything else feels like a mistake for web apps or CRUD apis. I also use type hints.

I use Django + django-ninja + django-unicorn for dynamic UIs.

Building sidewaysdata.com with django right now! Govscent is in Django too, the ORM is nice to combine with AI stuff already in python.

I'm also following the Ash framework which looks promising.

Re: Backend of Meta Threads is built with Python 3.10

#157

Earlier quoted context omitted.

Most of Facebook is built on PHP. I’m surprised they didn’t choose Laravel.

The web codebase was once written in PHP, but they moved away from that a decade ago.

It’s still very similar to php. Same syntax, same execution model. If you look at some hack snippets you would think it’s php (because it mostly is).

Switching from hack to php and viceversa should be extremely easy.

That being said, they chose python because Instagram is written in python, they are probably using a lot of existing libraries.

Re: Backend of Meta Threads is built with Python 3.10

#158

Earlier quoted context omitted.

Django is the opposite. It holds your hand and tells you how to structure your "app", templates, database, and media assets. And django-admin is godsend. It's awesome when you are on the beaten path cause everything just works. But if you step of the beaten path you will have to tweak various obscure settings and create weird hooks to override Django's defaults. Flask is the opposite. Just a very well-written web ser…

I've described that as Django is fantastic for writing Django apps. If the thing you want to do can be completely modeled in the defaults, it's impossible to beat. If that's only 99% true, you might want to investigate other options.

You can always build 99% of the App (crud, ui stuff) in Django and the 1% be its own service.

Re: Backend of Meta Threads is built with Python 3.10

#159

Earlier quoted context omitted.

Developer velocity is extremely important at FAANG scale.

Is it really? Don't they work really slowly compared to most of the industry? I really get the impression that it's slow progress for things at FAANG.

Not really, especially Facebook (Meta) moves really fast. They have a slogan "Move fast, break things", okay not "Break things" anymore. But you get the gist, in my experience working at almost all of FAANG, Meta and Netflix move the fastest.

Re: Backend of Meta Threads is built with Python 3.10

#160
post #157

Earlier quoted context omitted.

The web codebase was once written in PHP, but they moved away from that a decade ago.

It’s still very similar to php. Same syntax, same execution model. If you look at some hack snippets you would think it’s php (because it mostly is). Switching from hack to php and viceversa should be extremely easy. That being said, they chose python because Instagram is written in python, they are probably using a lot of existing libraries.

That wouldn't even make sense. They created hack/hhvm to scale and optimize the platform and codebase. Taking a step backwards and refactoring (hack != php now) would be a horrible idea.
Post reply on HN