Platform-as-a-service

A platform-as-a-service (PaaS) provides infrastructure and a software layer on which a web application is deployed. Running your web application from a PaaS removes the need to know as much about the underlying servers, operating system, web server, and often the WSGI server.

Note: If you are not interested in deploying to a PaaS you can move ahead to the WSGI servers section.

The PaaS layer defines how the application accesses resources such as computing time, files, and external services. The PaaS provides a higher-level abstraction for working with computing resources than deploying an application to a server or IaaS.

A PaaS makes deployment and operations easier because it forces the developer to conform applications to the PaaS architecture. For example, Heroku looks for Python's requirements.txt file in the base directory of the repository during deployment because that is the file's de facto community standard location.

Traditional LAMP server stack versus a Platform-as-a-Service stack

If you go the PaaS route, you can skip configuring an operating system and web server prebaked into PaaS offerings. PaaS offerings generally start at the WSGI server layer.

Platform-as-a-service responsibilities

Although PaaS offerings simplify setting up and maintaining the servers, operating system, and web server, developers still have responsibilities for other layers of their web stack.

While it's useful to know the operating system that underpins your PaaS, for example Heroku uses Ubuntu 10.04, you will not have to know as much about securing the operating system and server level. However, web applications deployed to a PaaS are just as vulnerable to security breaches at the application level as a standard LAMP stack. It's still your responsibility to ensure the web application framework and your app itself is up to date and secured. See the security section for further information.

Platforms-as-a-service that support Python

Platform-as-a-service open source projects

The following open source projects allow you to host your own version of a platform-as-a-service. Running one of these gives you the advantage of controlling and modifying the project for your own applications, but prevents you from offloading the responsibility of keeping servers running to someone else.

  • Dokku builds on Docker and has hooks for plugins to extend the small core of the project and customize deployments for your applications.

  • Convox Rack is open source PaaS designed to run on top of AWS services.

Platform-as-a-service resources

Platform-as-a-service learning checklist

  1. Review the potential Python platform-as-a-service options listed above.

  2. Sign up for a PaaS account at the provider that appears to best fit your application needs. Heroku is the PaaS option recommended for starters due to their detailed documentation and walkthroughs available on the web. However, the other options are also viable since their purpose is to make deploying applications as easy as possible.

  3. Check if there are any PaaS-specific configuration files needed for your app to run properly on the PaaS after it is deployed.

  4. Deploy your app to the PaaS.

  5. Sync your application's configuration with the database.

  6. Set up a content delivery network for your application's static content unless your PaaS provider already handles this deployment step for you.

  7. Check if the application's functionality is working and tweak as necessary.

What deployment topic do you want to learn about next?

What runs a Python application execute on the server?

Tell me about standard relational databases.

How should Python libraries be installed on a server?


Matt Makai 2012-2022