Professional Documents
Culture Documents
@jespern
• Who am I?
• Bitbucket in summary
• Behind the scenes
• Lessons learned
Opening .exe files -> Basic -> PHP (.php3) -> C -> Perl -> Python
Bitbucket in summary
The entire website is 100% django, only parts that aren’t are background stuff like scripts,
various SSH stuff, hooks.
• On production:
• HAProxy, nginx, gunicorn, puppet.
• Roll out once a week, hotfixes go out
instantly.
• Testing:
• Selenium for functional tests.
• Kong for headless tests (@ericholscher)
• Bamboo for CI (just getting there.)
Experiences over the years, things that helped us and things that didn’t.
Stay idiomatic
Doing this has helped us *so* much. It’s not always the most intuitive thing to do, but it
comes in very handy in so many situations.
From our codebase (actual code):
Basically everything’s like this, from the core concept of Repositories to everything else we
do.
Everything’s an app
• Repositories
• Issue tracker
• User accounts (SSH, etc.)
• Compare view
• ...
...lead into where you can point them for the documentation (next slide.)
“Where’re the docs?”
https://docs.djangoproject.com/
Really nice to be able to just point people there. They can go there and learn all the Django
idioms.
• Kinda feels like you’re shoe-horning
sometimes
• ..
CNAME is one thing we had to really twist Django into doing for us.
Transactional = involving the disk (we obviously do this a lot), handling errors, rolling back,
etc. The Django ORM isn’t *that* great. Certainly suffices, but does dumb things like
redundant joins and the transactional stuff (we use Postgres -- mention isolation levels.)
We stick to idioms
For better or worse.. Usually better.
Don’t do vendor lock-in! We did (AWS - S3/cloudfront, but mostly EBS), and it hurt is quite a
bit down the line. The places in which we didn’t, came in *really* handy.
We took the pain of making sane technology choices and decisions early -- often a good
idea. AWS great for bootstrap, but we didn’t make use of anything we couldn’t replace later
(EBS looks like a disk).
Embrace it!
Design your app in such a way that you’re not bound to any specific technology or vendor.
Changes *will* happen, whether it’s to replace a bad technology, or more often, to make
something scale better.
Good choices we made
• Linux
• Django
• WSGI
• No need to pick a DB
WSGI was awesome, as there’s a ton of WSGI hosts out there -- we’ve been through
mod_wsgi, uwsgi, and now gunicorn. Hell, we even ran FastCGI.
We could rip out postgres for mysql or whatever any day.
Open source
Piggyback on existing efforts, stand on the shoulders of giants. Don’t fear NIH.
We use stuff like...
• Celery, South, etc.
• -(social)registration,
-compressor, ...
• django-dogslow
• tipper