Slide 1

Slide 1 text

Django and Databases Fun with

Slide 2

Slide 2 text

""Andrew speaks English like a machine gun speaks bullets."" Reinout van Rees

Slide 3

Slide 3 text

Introduction

Slide 4

Slide 4 text

from django.db import models

Slide 5

Slide 5 text

First, an aside

Slide 6

Slide 6 text

""When all you have is a hammer, everything looks like a nail"" Abraham Manslow (paraphrased)

Slide 7

Slide 7 text

Also, "NoSQL"? Really?

Slide 8

Slide 8 text

queryset.raw()

Slide 9

Slide 9 text

qs = Teacher.objects.raw(""" SELECT t.name, COUNT(s.id) FROM school_teacher AS t INNER JOIN school_student AS s ON t.id = s.teacher_id GROUP BY t.name HAVING COUNT(s.id) > 2 """)

Slide 10

Slide 10 text

queryset.aggregate()

Slide 11

Slide 11 text

qs = Teacher.objects.annotate( num_students = models.Count('student') ).filter(num_students__gt=2)

Slide 12

Slide 12 text

Search haystack __search=

Slide 13

Slide 13 text

Schema Changes

Slide 14

Slide 14 text

Changing Requirements

Slide 15

Slide 15 text

Dynamic/Unknown Data

Slide 16

Slide 16 text

Document Databases MongoDB CouchDB

Slide 17

Slide 17 text

Key-Value Stores Redis Cassandra

Slide 18

Slide 18 text

Redis Sets Sorted Sets Hashes Pub/Sub Atomicity

Slide 19

Slide 19 text

Message Queues AMQP Celery

Slide 20

Slide 20 text

Various Others Graph databases Filesystems VCSs

Slide 21

Slide 21 text

Conclusion

Slide 22

Slide 22 text

Thanks. Andrew Godwin @andrewgodwin http://aeracode.org