Peter Thomas gives us the full picture of a Java web application call stack. It’s very impressive. It shows about 100 call frames, annotated with the different layers of the architecture. The comments there debate the question of whether this is a good thing or a bad thing.
I was curious about the equivalent stack for our current mod_python/Django/MySQL architecture. I won’t paste the actual stack trace here (opinions differ about the extent to which work details can be discussed in a blog), but here’s the breakdown by layer:
- mod_python: 1 stack frame
- Django’s mod_python support: 3 stack frames
- Our view infrastructure: 3 stack frames
- Our business logic: 3 stack frames
- Django’s ORM: 4 stack frames
- Django’s MySQL support: 2 stack frames
- MySQL’s Python layer: 3 stack frames
for a grand total of 19 Python stack frames between Apache and MySQL, six of which are our code. I won’t claim to know whether this is better or worse, just comparing.