Slide 1

Slide 1 text

Redshift with Django What it is and how to use it from our favourite web framework

Slide 2

Slide 2 text

Redshift is Postgresql* *kind of

Slide 3

Slide 3 text

If it looks like a duck, swims like a duck, and quacks like a duck...

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

Rows Columns Redshift has a column disk layout vs Postgres rows layout

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

Multiple databases configuration in Django

Slide 10

Slide 10 text

Raw queries

Slide 11

Slide 11 text

Thanks! Any questions, you can find me at: http://flagzeta.org @flagZ “Federico Marani” on Google