user730153
user730153

Reputation: 791

Python/Django - Web Application Performance

I'm currently working on a social web application using python/django. Recently I heard about the PHP's weakness on large scale projects, and how hippo-php helped Facebook to overcome this barrier. Considering a python social web application with lot of utilization, could you please tell me if a similar custom tool could help this python application? In what way? I mean which portion (or layer) of application need to be written for example in c++? I know that it's a general question but someone with relevant experience I think that could help me.

Thank you in advance.

Upvotes: 0

Views: 1533

Answers (3)

Abdelouahab
Abdelouahab

Reputation: 7549

You can think about PostgreSQL as Oracle, so from what I've found on the internet (because I am also a beginner) here is the order of DBs from smaller projects, to biggest:

  1. SQLite
  2. MySql
  3. PostgreSQL
  4. Oracle

Upvotes: 1

Torsten Engelbrecht
Torsten Engelbrecht

Reputation: 13486

Don't try to scale too early! Of course you can try to be prepared but most times you can not really know where you need to scale and therefore spend a lot of time and money in wrong direction before you recognize it.

Start your webapp and see how it goes (agreeing with Spacedman here).

Though from my experience the language of your web app is less likely going to be the bottleneck. Most of the time it starts with the database. Many times it simply a wrong line of code (be it just a for loop) and many other times its something like forgetting to use sth. like memcached or task management. As said, find out where it is. In most cases its better to check something else before blaming the language speed for it (since its most likely not the problem!).

Upvotes: 1

Spacedman
Spacedman

Reputation: 94192

The portion to rewrite in C++ is the portion that is too slow in Python. You need to figure out where your bottleneck is, which you can do by load testing or just waiting until users complain.

Of course, even rewriting in C++ might not help. Your bottleneck might be the database (move to a separate, faster DB server or use sharding) or disk, or memory, or anything. Find bottleneck, work out how to eliminate bottleneck, implement. With 'test' inbetween all those phases. General advice.

There's normally no magic bullet, and I imagine Facebook did a LOT of testing and analysis of their bottlenecks before they tried anything.

Upvotes: 3

Related Questions