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

Redshift with Django

Redshift with Django

A simplified introduction to Redshift and how can Django fit in. Talk given at DJUGL June 2017.


Federico Marani

June 13, 2017


  1. Redshift with Django What it is and how to use

    it from our favourite web framework
  2. Redshift is Postgresql* *kind of

  3. If it looks like a duck, swims like a duck,

    and quacks like a duck...
  4. Redshift is an “OLAP” version of Postgresql Have to average

    1 billion values? In under 1 min? Mostly append to tables? No transactio ns or referential integrity? Yes Yes Yes Yes No No No No I don’t know
  5. Rows Columns Redshift has a column disk layout vs Postgres

    rows layout
  6. Performance comparison Column-oriented Row-oriented Aggregate on a single column Fast

    Slow SELECT on many columns table Fast Slow INSERT/UPDATE on single rows Slow Fast SELECT single row Slow Fast
  7. Do not try this at home - Build a CRUD

    app on Redshift (low performance) - Use Django ORM on Redshift (common ops have low performance) - Use Django migrations on Redshift (types are slightly different) - Columns are NULLable by default - Optimize it (or change tables) like you would on Postgresql
  8. None
  9. Multiple databases configuration in Django

  10. Raw queries

  11. Thanks! Any questions, you can find me at: http://flagzeta.org @flagZ

    “Federico Marani” on Google