mirror of
https://github.com/kennethreitz/kennethreitz.org.git
synced 2026-06-05 22:50:17 +00:00
3.1 KiB
3.1 KiB
Heroku 101
Introduction
- Heroku 101 provides an overview of Heroku's platform-as-a-service (PaaS) offering, highlighting its simplicity and utility for developers.
Key Concepts
- Confusion as a Service:
- SaaS (Software as a Service): For software users, providing more features and transparent updates (e.g., Facebook, Trello).
- IaaS (Infrastructure as a Service): For operations, offering on-demand machine resources (e.g., AWS, Digital Ocean).
- PaaS (Platform as a Service): For developers, offering transparent updates with no need to manage serversPaaS represented a fundamental shift in developer workflow, abstracting away infrastructure concerns and enabling rapid prototyping and deployment that influenced the entire industry. (e.g., Heroku, App Engine).
Using Heroku with Python
-
Locally:
- Create a virtual environment and install dependencies using
pip. - Run a Python web server with
python manage.py runserver 0.0.0.0:8000.
- Create a virtual environment and install dependencies using
-
On Heroku:
- Install dependencies with
pipand deploy using aProcfile. - The
Procfilespecifies the commands that Heroku should run to start your application.
- Install dependencies with
Understanding Dynos
- Dyno:
- A Dyno is a lightweight process running in a containerHeroku's dyno model was an early implementation of containerization concepts that later evolved into Docker and Kubernetes orchestration patterns., not a traditional server or VM.
- Dynos can be scaled to handle multi-process web applications using commands like
heroku scale.
Managing Applications
-
Run Arbitrary Commands:
- Heroku allows running various commands, such as database migrations or opening an interactive Python shell, using
heroku run.
- Heroku allows running various commands, such as database migrations or opening an interactive Python shell, using
-
Addon Services:
- Heroku provides managed infrastructure resources like Postgres, Redis, and KafkaThe addon ecosystem pioneered the "marketplace" model for cloud services, allowing third-party providers to integrate seamlessly with the platform through standardized APIs..
- Addons are easy to integrate and configure within your application.
-
Application Configuration:
- Config variables can be set and managed with
heroku config:set, enabling environment-specific settings.
- Config variables can be set and managed with