Live data from Hacker News

Python at Netflix

medium.com

221–230 of 250 posts

Re: Python at Netflix

#221

Earlier quoted context omitted.

These are not really an issue in vfx production and other things Python is used for.

It’s a problem for lots of things Python is used for, but maybe not vfx (whatever that is).

They are using it for things it’s good at, for others they use java. So this subthread is largely a waste of time.

Re: Python at Netflix

#222
post #63

Interesting. I had it in my head that Netflix was a pure Java shop. Was I wrong in the first place, or has something changed?

When I interviewed there a couple years ago (decided to stay in phx), it was a polyglot culture... the team I was interviewing with was largely node/js. I'm not surprised to see a lot of Python, Java or anything else that leverages existing tooling. For that matter, I wouldn't be surprised by custom C++, Go or Rust for some pieces.

Re: Python at Netflix

#223

Earlier quoted context omitted.

It’s a problem for lots of things Python is used for, but maybe not vfx (whatever that is).

They are using it for things it’s good at, for others they use java. So this subthread is largely a waste of time.

Who is “they”? What is your point?

Re: Python at Netflix

#224
post #63

Interesting. I had it in my head that Netflix was a pure Java shop. Was I wrong in the first place, or has something changed?

A sufficiently large company uses basically every language at some layer.

Re: Python at Netflix

#225

> The ability to drop into a bpython shell and improvise has saved the day more than once. what do you really do here - connect to the flask instance and route requests manually ?

Our python code does not handle user requests directly. Our team uses python to control the control plane of traffic — we flip dns records, control cross-region proxying, re-steer cdn-based reverse proxying and scaling of the hundreds of micro services that power the Netflix experience. We’ve improvised various custom traffic distribution patterns, operated outside of our normal traffic-shifting workflows, and written/run quick scripts to modify scaling fleetwide.

Re: Python at Netflix

#226
post #195

Earlier quoted context omitted.

What would you like to know?

The correlations part specifically, what does it do, what’s the modelling approach, and is there more info about it anywhere?

Cool, I’ll ping the folks responsible and have them reply here soon.

Re: Python at Netflix

#227

Earlier quoted context omitted.

> I fail to understand the use of python in a distributed environment while the language has such poor concurrency support Because it's a distributed environment probably is exactly why. Python has (arguably) great concurrency support apart from Multi-threading. https://www.youtube.com/watch?v=MCs5OvhV9S4 So if you need concurrency in the context of a single thread, then Python's GIL is a non-starter. But a distribut…

Even if your app is IO bound, Python's concurrency is painful. Because it's not statically typed, it's too easy to forget an `await` (causing your program to get a Promise[Foo] when you meant to get a Foo) or to overburden your event loop and such things are difficult to debug (we've had several production outages because of these class of bugs). Never mind the papercuts that come about from dealing with the sync/asy…

The missing await is a a very common fault indeed, they should have used another keyword like 'not_await' for that scenario to make the decision explicit. Pycharm at least will warn you if you call an awaitable without 'await' and without assigning it to a variable. If you assign it to a variable and pass it into another function that doesn't expect an awaitable, it's up to you to have added sufficient type annotations and run your code through some static checker like mypy. Running python at scale without mypy is kindof doomed to failed to begin with.

Re: Python at Netflix

#228
post #89
post #18

Earlier quoted context omitted.

You think you're being downvoted because people like dynamic typing very much. You're being downvoted because: A) You left a comment with a strong opinion without expressing it while dismissing other peoples' experience B) Python is in fact a type safe language for a while now https://docs.python.org/3/library/typing.html - you have pluggable "a la bracha" types.

> Python is in fact a type safe language for a while now I like the idea of type annotators but they do not make it a type safe language because types are not checked and they are more like comments. Python will remain a dynamically typed language, and the authors have no desire to ever make type hints mandatory, even by convention. [1] [1]: https://www.python.org/dev/peps/pep-0484/#non-goals

-Wall -Werror is also optional in GCC...

Not that i like it but just to show that a lot of languages require a properly set up configuration and CI-infrastructure to make them safe and useful. mypy should be considered equal to -Wall -Werror and anyone who doesn't run it is frankly a bloody idiot.

Re: Python at Netflix

#229

> The ability to drop into a bpython shell and improvise has saved the day more than once. what do you really do here - connect to the flask instance and route requests manually ?

Our python code does not handle user requests directly. Our team uses python to control the control plane of traffic — we flip dns records, control cross-region proxying, re-steer cdn-based reverse proxying and scaling of the hundreds of micro services that power the Netflix experience. We’ve improvised various custom traffic distribution patterns, operated outside of our normal traffic-shifting workflows, and writte…

hi - so im actually curious about the infrastructure that allows you to connect bpython to it. Is it a rq process that you connect to, etc ?

I would love to setup an architecture like this that lets me connect to stuff through a CLI. Also, I'm assuming you are on kubernetes (or something). How does this bpython business work through all those layers ?

Re: Python at Netflix

#230
post #205

Earlier quoted context omitted.

> I fail to understand the use of python in a distributed environment while the language has such poor concurrency support (on top of the lack of a type system). You can make your application HA, but they are obviously not trying to squeeze out every CPU cycle. You're conflating several things that are orthogonal imo. A system can be distributed without concurrency. A concurrent system need not be distributed. Either…

> A system can be distributed without concurrency. A concurrent system need not be distributed. The only justification for such design I can think of is HA. I.e. you have very light workload that does not saturate a single machine, but nonetheless you create a distributed system with two machines for HA. Such light workload is probably not often the case at Netflix.

> The only justification for such design I can think of is HA.

I'm not trying to justify any particular design. I'm just saying that concurrency and distributed processing are different things. And I'm no expert, but I continue to be confused as to what saturation, whether of cpu or i/o - you don't specify - has to do with concurrency? If I have for example n http servers all running one thread and handling enough traffic that they are all at 100 percent CPU that is by some minimal definition a distributed system, but none of the processes in it are concurrent. If the http servers read and write a database then the database is almost certainly concurrent, so then you have a distributed system that has both concurrent and non-concurrent processes collaborating.

Post reply on HN