Is Python good for creating SaaS apps?

Published 12 Jan, 2020 in development
In this article we review pros and cons using Python as a programming language for SaaS' backend.
K_Rains
SaaS Forge

Founder and author

Nowadays there are so many languages and frameworks to choose from: PHP (and Laravel), C# (ASP.Net), JavaScript(Node.js), Python (Flask and Django), Ruby (Ruby on Rails). Go, Java, Perl and some other languages stay apart and they are not used so widely.

When we were thinking about which language/framework to use for our boilerplate we had the following requirements:

  • The language/framework should be pretty popular
  • The installation should not be a pain in the ass
  • The language should be easy to learn but still might and developed.

As Python was used pretty widely we looked at it. The language look pretty promising so we decided to give it a try. We also found a couple of frameworks: Django and Flask. We started from Django.

To be honest, the first several installations didn’t go smooth. We were confused by the recommendation to install virtual environment, another not-too-easy thing were environment variables. The Python itself was installed globally but we had to install packages separately, and using different versions of Python was pretty confusing. Django turned to be big and heavy and we, although spent the whole day on it, didn’t succeed to run.

We tried Flask then.

The funny thing was that it looked almost the same as Express in its minimal configuration. The code, routes, settings - everything looked so familiar (except it was Python not JavaScript). We spent just 20 minutes and were able to run it. Another 10 minutes and we added a new route and a new page. The rendering engine Jinja worked absolutely predictable and we didn’t experience any problems with it. Adding Vue.js was not a real problem either even though we had to change the initial settings for Jinja because of incompatibility - but now, when our boilerplate uses React we don’t have to do that.

So, it was our experience and now I would like to talk a bit about if it’s a good choice for SaaS at all. We won’t compare the speed, or the convenience to use - this is a question of personal preferences but there are things that makes Python unique and suitable for SaaS solutions.

  • There is an incredible amount of snippets and packages for any case. The Python package index has more than 200 thousand packages.
  • The popularity of Python is proven easy on Stackoverflow: 1.3 M questions tagged by “Python” Python is the only language having so developed free and open-sources libraries for proceeding data and working with Machine Learning what makes it the natural choice for ML and AI-related SaaS solutions.
  • Python is really easy to learn language. Yes, there are some constructions that may look weird first like lambda or list comprehensions but you can live without using them (at the beginning).
  • The development in Python is really effective. There are so many constructions created for working with strings, data, files that you will be surprised how concise and readable your code is.
  • There are great ORMs written in Python for almost any existing database engine - we use SQLAlchemy for working with PostgreSQL and found it easy and effective.

We also have a “third-party” proofs. First of all, this video shows the evolution of Python (2008 -2018).

Also, Stackoverflow itself conducted survey (2019):

  • Python is the second most loved language and absolute winner as the most wanted
  • Python is the forth popular language (but truly, is the second for creating web apps because HTML and SQL can’t be considered as programming languages for web development)

See some insights from other SaaS-builders: - https://usersnap.com/blog/cloud-based-saas-architecture-fundamentals/ - https://julien.danjou.info/is-python-a-good-choice-for-entreprise-projects/

And the insight from the Flask’s author: https://www.infoq.com/presentations/saas-python/

Now, let’s have a look at the SaaS Forge boilerplate in terms of using Python: We use Flask-JWT package for authentication SQLAlchemy as ORM for working with database Flask-Mail and many other packages for workflows. Amazon Web Services has a great library covering all the APIs called boto3

What about hosting?

  • AWS Elastic Beanstalk is a hosting service where you can host for free (not taking into account they give new startups $300) - but the deployment is a little bit tricky so we even wrote the book
  • Heroku supports Python and the deployment is very easy and straightforward
  • Python Anywhere is pretty cheap hosting provider The list of free plans hosting plans can be found here https://wiki.python.org/moin/FreeHosts

What about IDE?

There is a lot of IDEs available for free but our favourite is Microsoft Visual Studio Code. It may not have all the cool features that you can find in its big brother, Visual Studio, but it's still might and lightweight IDE.

Another option is a community version of PyCharm. We found it slower and harder to use that MS VS Code, but you can give a try!

The article wouldn't full without reviewing some flaws of Python. You can find them on the Internet but be careful: some websites like this one http://net-informations.com/python/iq/disadvantages.htm has pretty outdated information.

First of all, Python is not compiled language what means it's compiled on-the-fly, without previous compiling. It may cause some slowness of working. Another "problem" is some bugs and errors are not visible until the executable hits them.

That's it! Truly, we don't know any other disadvantages using Python.

Did you like the article?

Subscribe to our newsletter and you will never miss our posts. We are going to share our thoughts on:
  1. Building of SaaS applications
  2. Using SaaS boilerplates for faster SaaS development
  3. Ideas of SaaS applications
{{message}}
Please don't forget to check the Github SaaS boilerplate!

Comments

Alex Lucas
{{'2020-12-11 13:41:56.432395' | localDt('YYYY MMM D, HH:mm:ss') }}
Thank you for sharing such an expert analysis of the technologies used to develop SaaS solutions. I'm a newbie to the SaaS area so I completed thorough research and I'd like to share this material that helped me to see SaaS the way SaaS developers see it https://tagsoft.co/saas-development-company/.
{{newComment.name}}
Just now
{{newComment.content}}

Leave a comment

Your name:
Your email (never shown here):
Your comment:
{{messageComment}}