There is nothing worse than bet your engineering career choices on some current hot bell & whistle or even maximizing salary.
First, you can't possibly know what will be next big thing in 10 years.
Second, your main skill that you sell is not a specific language expertise (except maybe few niche cases) - but your engineering skill (surprise surprise), not coding per se.
To become good at engineering requires a lot of time and effort, it is hard, it challenges your motivation.
To keep as much motivation as you can - you need to choose areas, domains and environments that you personally like, enjoy working with.
Django works with Python and in the AI space you'll want to iterate as quickly as possible, so I think that's probably going to be the preferred choice for beginners.
JEE is more enterprise oriented, used in lots of big companies.
I personally would recommend you Django, it's more flexible in my opinion.
Also I prefer Python 100 times over Java, but that is very biased on my side :)
P.S. I am mostly using React + NodeJs (ExpressJS), again personal preference here :)
Regarding an exact programming language, it really depends on what exactly you want to do. If we're talking about web development, Java as a language has one dishonest advantage: a very mature open source eco-system supported by the biggest world enterprises. They invest a lot there, because often Java is a heart of their internal systems. Sometimes I think, that in Java world there's at least 10 years old and very stable library for any feature I need: caching, object-relational mapping, validations, logging etc. When I say Java, I don't necessarily mean the Java EE. Spring or Micronaut also perfectly do the job.
If we're talking about AI world, the things become more complex. Python is widely spread for data analytics and experiments in the ML. Main reason for this is that there are lot of libraries to prepare data before you feed it into the model for learning. But if we're talking about libraries that actually do all the math under the hood or run neural network at scale, most of them are implemented with system-level languages, like C/C++. Mainly, because of speed. And in Python, you have only bindings, that allows you to call that native binaries from Python code. Same bindings exists for many other languages. As an effect, the python code for ML / Data analytics tasks resemble more procedural C code, for some weird reasons written inside python files, rather than nice object-oriented code you may face during web-development for python.
So, if you want to do machine learning and the web development, I would suggest you to think of them as about two very separate skills, that have nothing in common. If you want to do both, learn both independently.
Fast API is basically async implementation of your standard API coding on top of uvicorn (which is a web server), which is built on uvloop, which is a faster event loop.
I wouldn't do this unless I absolutely had to.
2) Having modular code means that things are isolated when you DO need to upgrade.
You aren't gonna convince people familiar with Django that your API library is a Django replacement. That's like saying Express.js replaces Spring. Well, no...
Even placing a CDN in front of Django doesn’t help in that regard.
With that being said, not many people upgrade their dependencies that much anyway for Flask / FastAPI.
Nobody cares. Seriously. I can handle 100rps on a $5 server for most of the pages on my Django sites. Do you know how many $100m+ ARR businesses I've worked for that never hit 100rps on a regular basis? Most of them.
> for Flask / FastAPI
What about the dozen other dependencies you now need to use? and now you need to test those upgrades carefully, because python.
I dunno, my clients paying my business care, speed is important in certain sectors such as mine.
I run and own a pest control SaaS on Flask that pulls in $1.7M+ ARR, when you're an upstart, speed is an advantage, I would imagine the $100m+ ARR business you worked for would be slow anyway.
> What about the dozen other dependencies you now need to use? and now you need to test those upgrades carefully, because python.
I just pin my dependencies, and since I'm making money it just runs itself really.
> when you're an upstart, speed is an advantage,
Yes, this is kind of the whole point of FastComments :) but still, the SLAs are like 30ms for most endpoints. I wouldn't use Django for this - but I wouldn't (didn't) choose Python either.
> I just pin my dependencies, and since I'm making money it just runs itself really.
Pinning is good. Never updating them is bad, gets a lot harder later.