Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Dineshkarthik/c397f8f7639ecae3902b484df0bd8785 to your computer and use it in GitHub Desktop.
Save Dineshkarthik/c397f8f7639ecae3902b484df0bd8785 to your computer and use it in GitHub Desktop.
Example Architecture Decision Records (ADRs)

ADR-004: Select Flask as Python Web Framework

Context

We need to select a Python web framework for our new analytics application. Key criteria:

  • Easy to use and get started
  • Good performance
  • Flexible and modular
  • Built-in caching support

The application will have multiple APIs serving data dashboards and reports. Caching is important to optimize response times for repeated requests.

Considered Options

  • Flask - A lightweight framework with few dependencies. Easy to get started and very customizable.
  • FastAPI - A modern web framework focused on performance and OpenAPI docs. Asynchronous.
  • Django - A full-featured framework. Includes ORM, admin interface, etc out of the box.

Decision

We will use Flask as our web framework.

Rationale

While Django leads in features, it is more complex than we need for this app. FastAPI is very compelling for its performance and docs, but lacks caching support.

Flask provides a simple, flexible core we can build on precisely for our use case. It has robust caching support through plugins like Flask-Caching. We can add plugins for ORM, docs, etc as needed.

Implications

  • Engineers will need to learn Flask.
  • We will implement Flask-Caching for route and data caching.
  • We may need to integrate ORM separately using Flask-SQLAlchemy or directly using SQLAlchemy.

Related Decisions

  • ADR-005: Use Redis for caching

In summary, Flask meets our needs for an easy to use, flexible and customizable web framework with excellent caching support through plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment