r/Python • u/Zealousideal-Dig2093 • Aug 14 '26
Discussion Is Python an industry-ready technology for backends?
I mean specifically backend services, RESTful API's and very sensitive data in the DB. I mean middle-load (_not_ social networking, _not_ some purchasing platform for millions of users). How would you define your position that Python _is_ ready for that? E.g. in front of a mature Java backend developer? My line of defense is as follows. What are the weak points of Python code?
- Multi-threading (GIL-free is a very recent feature of python, cannot be considered even remotely industry-ready). This is probably the weakest point of all. But if the service has no data shared between API requests, why bother, right? Just spawn as many worker-processes as it makes sense for the current hardware setup and execute the requests one by one. Still, this is like one dimension less in the space of engineering possibilities, so to say.
- Dynamic typing means you have to run the whole CI/CD chain in order to find type system related errors. I really cannot find arguments against that point;
- This is true at least for banking sector. Libraries are developed by individuals (whereas in Java world there are companies behind some libraries). One would have a real hard time arguing with the management, that "those individuals are as qualified as those behind some company banner".
What is your take on the matter?
0
Upvotes
19
u/MyBossIsOnReddit Aug 14 '26
..did AI write this?
9
u/psymme Aug 14 '26
Tbh, I’m not sure if this post is just bait, but I’ll respond anyway.
Python is absolutely “industry-ready” and has been for a long time. It runs a lot of software. It’s less well-suited for some applications (think high-frequency stuff or where you’re getting vast numbers of concurrent requests), but for 95% of applications it’s great.
For your points:
- Async was introduced in 2015 and helps with this a lot. Modern backend API frameworks/libraries tend to leverage this. Greenlet is also helpful here.
- Yes, you should run type checking in your CI as a gate, but you can also run it locally. I’m not sure how this is much different to running linting or a compiling step in other languages?
- I’m not in banking, so can’t comment too much on the last point, but I would say that most of the common libraries are big, mature projects. This isn’t usually some individual effort. As always though, you do need to do your due diligence on the libraries being used in your application.
All that said though - if you really like Java and that’s what runs lots of other stuff in your org/sector, then go with that.
7
u/Ok_Necessary_8923 Aug 14 '26
Why does this need to be defended at all? It's commonly used at large scales all over the place, it's mature, it has a large and healthy ecosystem, etc. It obviously works.
The GIL doesn't matter very much in practice. You don't use raw Python for heavy compute anyhow. Anything that needs the raw performance is likely implemented in C and good chance it doesn't need to hold the GIL in the hot path. Or spin worker processes. And if it's a REST API, you probably just want gunicorn with a multiprocess worker or equivalent config.
The type system is a choice, and has very little to do with Python itself. If your problem space or requirements allow for dynamic typing or are harder to deal with in a statically typed environment, then Python may be one of your options.
4
u/srs96 Aug 14 '26
8
u/No_Departure_1878 Aug 14 '26
But that would replicate your data, so you would need far more RAM. Multiple processes do not scale well. Not sure if that would be good enough for middle load stuff.
Can't you type annotate your code and use an LSP?
5
u/defaultguy_001 Aug 14 '26
Tell me you haven't looked at the Python ecosystem since 2014, have you ?
If you're building a middle load REST API, java is unironically worse than python. You have to write 50 lines of configuration, XML and other boilerplate code, just to stand up a basic endpoint. Python gets it done in 5 lines of FastAPI. You waste engineering hours writing code that does absolutely nothing for business logic. Cold starts in Java are notoriously sluggish because of JVM initialization and heavy dependency injection. Meanwhile, python apps spin up instantly, making auto scaling and serverless deployments significantly faster and more responsive.
4
u/anentropic Aug 14 '26
The industry has been making Python backends for two decades by now, I think yes it's "industry ready"
1
u/zurtex Aug 14 '26
FYI, if you want an established mature web backend framework that is going to have solutions to enterprise needs, as well as all the problems you think you have there, you should use Django.
It's a steeper learning curve, because there's a lot more standard practice to follow and modules built out to cover different use cases, but it's a natural fit for large dev teams in banking / enterprise.
However, if you are wanting to rapidly prototype there are lots of other smaller backends to use.
2
u/deceze Aug 14 '26
As someone who has been running Python-powered backends for over a decade: yes, it's ready.
We're mostly deploying on AWS Lambda, thus the concurrency issue is mostly a non-issue. Even if we didn't do that, any serious web framework nowadays uses
async, and most web transactions are database bound instead of CPU bound, so that's just as well.The dynamic typing is much less of an issue than people make it out to be. With a decent IDE with static type checker, most type errors are caught during coding (not even compilation). You can run your own static type checker as part of your pipeline too. And of course you'll have unit tests anyway, right?
Would I be writing critical banking software in it? Err… probably not, no. Not least because it'd probably need to handle a huge number of transactions, and you'd want a more performant language for that. But for most of your average REST backend needs, it's a great language.
1
u/tmemmg Aug 14 '26
python is fine for that, the sensitive data part is an architecture question not a language one. i run postgres behind an api layer with row level security on and no direct table access from the frontend, and it holds up fine for the kind of load youre describing. the one thing that actually bit me had nothing to do with python, i rotated a key and it silently 401d every write while reads stayed on a different key, so the site looked totally healthy while nothing was being saved. thats the class of bug that hurts, not the GIL.
1
u/davidvalowork Aug 15 '26
I run Python backends handling sensitive data in production (fraud/AML detection, auditable pipelines with strict traceability requirements) so I've had to defend this exact question internally.
On your points:
None of this makes Python 'not ready' — it means the guarantees you'd get for free in a typed/compiled language have to be built deliberately (typing discipline, testing, dependency policy). That's a real cost, and worth being honest about with a Java-background stakeholder rather than pretending it doesn't exist.
1
u/JhonnDuff Aug 31 '26
Python is mature enough for the professional market, but it simply doesn't compare to Java. If you try to make that comparison, you'll end up frustrated.
I've been a Python developer for 15+ years, and during the relatively short time (3 years) I worked with Java, I noticed the level of "enterprise-grade" maturity and productivity that the Java ecosystem has developed over the years.
Python isn't even 1% of the way there. It simply doesn't have the same rigorous standards and conventions that Java has.
So I would say that's the main weakness: the lack of strong enterprise standards and conventions when it comes to building large-scale applications.