Database for Python Developers

S Ranjan
3 min readNov 16, 2022

--

Python popularity increased tremendously in the last 5 years — it has overtaken other major programming languages to become the #4 most popular programming language as per the stack overflow survey.

If you are a python developer, at some point in your development journey — you would have come across questions like these: “As a Python developer, what databases should I learn? What’s the most popular database in the python community? etc. And the suggestions can be detailed, nuanced, and…. Incomprehensible. “Choose the best tool for the job” and “choose the database that matches your data model” are pretty meaningless if you 1) don’t know what all the job will entail and 2) don’t know what your data model will eventually be

But there’s some good news: you don’t have to wade through a sea of opinions to get answers.

There were over 70,000 developers who answered the Stack Overflow survey in 2022, and 34,155 of those had worked with Python. So, let’s see what databases do Python developers use?

  1. PostgreSQL: 43.65%
  2. MySQL: 42.09%
  3. SQLite: 34.72%
  4. MongoDB: 27.55%
  5. Redis: 21.01%

PostgreSQL and MySQL: The popularity of PostgreSQL and MySQL is almost similar at 43% and 42% respectively. They are some of the most popular databases out there. These numbers aren’t surprising given how long these databases have been around. A lot of schools and universities teach SQL based databases as part of their CS curriculum. Most of the ‘learn Python’ tutorials demonstrate using a SQL database. So it’s a very safe bet to choose these databases for your Python project.

SQLite: SQLite is used by ~34% of the python community. SQLite comes pre-packaged with your python installation, so it’s almost surprising to see it at #3 spot, given the easy access and simplicity… but there are some tradeoffs. It’s local access only, not for distributed, production workloads.

MongoDB: The popularity of MongoDB is at ~28%, making it the most popular database in the no-sql category and #4 overall. It is a document based database which supports a wide variety of use-cases. If we look at the past stack overflow survey results, MongoDB has overtaken “Microsoft-SQL server” to be the 4th most popular database.

Redis: The popularity of Redis in the Python community is at 21%. This makes it the 5th most popular database among the python developers. It is a key-value based, in-memory database founded in 2011. It also falls into the category of non-relational databases, and is most often used as a cache.

Want to Work With?

Very interestingly, Stack Overflow also asks what database developers want to work with, not just the ones that they are using. Those results are totally different:

  1. PostgreSQL — 39%
  2. MongoDB — 26%
  3. Redis — 24%

That’s pretty compelling, and shows that even though something like MySQL is pretty high in usage, it doesn’t have the same developers to use it in the future.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

S Ranjan
S Ranjan

Written by S Ranjan

Product Manager at MongoDB || Databases || Python

Responses (5)

Write a response