Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Designing Fast & Scalable Python MicroServices with Django @ PyCon SK 2018

Designing Fast & Scalable Python MicroServices with Django @ PyCon SK 2018

Presented at PyCon SK 2018 on March 10th 2018. It describes a set of optimizations that one can go through in order to build fast & scalable MicroServices in Python using Django.

Dinesh Joshi

March 10, 2018
Tweet

More Decks by Dinesh Joshi

Other Decks in Programming

Transcript

  1. Outline • Reference App • Request & Response Pipeline •

    Middleware • ORM • Measuring Performance • Caching • Async Processing
  2. • Django ◦ Application Framework • Postgres ◦ Persistent Storage

    • Redis ◦ Cache • Celery ◦ Async Distributed Task Queue Reference App Database (Postgres) Cache (Redis) Celery Tasks Queue Django App django App
  3. Request & Response Pipeline 1 WSGI Handler Middleware (Request) 2

    View 3 Request duration Middleware (Response) 4 Don’t Block!
  4. • Audit & Remove unnecessary middleware • Use ◦ Conditional

    GET middleware ◦ GzipMiddleware ◦ Cached Sessions Middleware: Accelerating Responses
  5. • Read heavy workloads • Boosts performance many-folds for cached

    responses • View Level or custom • Invalidation is complex Caching
  6. Request & Response Pipeline 1 WSGI Handler Middleware (Request) 2

    View 3 Request duration Middleware (Response) 4 Don’t Block!