Djangocon: gamers do REST - Angel RamboiΒΆ

Tags: djangocon, django

(One of the summaries of a talk at the 2014 djangocon.eu.)

Angel Ramboi works for a company, demonware that provides services for games, like leaderboards and so.

They mostly use REST for communication. Interoperability and scalability are great. The whole web is one big REST API in a way, actually, so using REST is almost a guarantee that you can scale your service and that you can get it robust.

Their stack: django 1.6, python 2.7, mysql 5.6 (sharded), CentOS and apache+mod_wsgi. So nothing really fancy and exotic. They take reliability very seriously.

REST API design? Read Roy Fielding’s thesis. Afterwards you’ll be surprised at the elegance of it all. GET/POST/PUT/DELETE verbs for a CRUD API. HTTP for the communication protocol. JSON is handy for representation (they even use some light-weight schema validation). They use a pragmatic approach: “good enough” is better than “perfect”.

For development, they use github. Development is on branches. When everything is ready, they package it up as an RPM and deploy it.

They do app configuration with YAML. It works better for them than python settings files as you can also use it for other applications. And in their case they can now also run config checkers over the config, detecting errors.

Django shines with its middleware. They added one to log all errors. They have a graph that shows the number of errors over time. When it suddenly shoots up, you know you have some work to do.

They differentiate between “logging” and “metrics”. Logging is for errors, metrics for regular measurements like response times. Graphite is used for showing them. (Note: see yesterday’s talk about visibility for web developers)

Auth: they use json auth tokens (update: added link to json auth tokens)

http://reinout.vanrees.org/images/2014/Gare_de_Lyon.jpg

Gare de Lyon, Paris

blog comments powered by Disqus
 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):