Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best scaling methodologies for a highly traffic web application?

Tags:

performance

We have a new project for a web app that will display banners ads on websites (as a network) and our estimate is for it to handle 20 to 40 billion impressions a month.

Our current language is in ASP...but are moving to PHP. Does PHP 5 has its limit with scaling web application? Or, should I have our team invest in picking up JSP?

Or, is it a matter of the app server and/or DB? We plan to use Oracle 10g as the database.

like image 219
tester2001 Avatar asked Dec 03 '22 07:12

tester2001


1 Answers

No offense, but I strongly suspect you're vastly overestimating how many impressions you'll serve.

That said:

PHP or other languages used in the application tier really have little to do with scalability. Since the application tier delegates it's state to the database or equivalent, it's straightforward to add as much capacity as you need behind appropriate load balancing. Choice of language does influence per server efficiency and hence costs, but that's different than scalability.

It's scaling the state/data storage that gets more complicated.

For your app, you have three basic jobs:

  1. what ad do we show?
  2. serving the add
  3. logging the impression

Each of these will require thought and likely different tools.

The second, serving the add, is most simple: use a CDN. If you actually serve the volume you claim, you should be able to negotiate favorable rates.

Deciding which ad to show is going to be very specific to your network. It may be as simple as reading a few rows from a database that give ad placements for a given property for a given calendar period. Or it may be complex contextual advertising like google. Assuming it's more the former, and that the database of placements is small, then this is the simple task of scaling database reads. You can use replication trees or alternately a caching layer like memcached.

The last will ultimately be the most difficult: how to scale the writes. A common approach would be to still use databases, but to adopt a sharding scaling strategy. More exotic options might be to use a key/value store supporting counter instructions, such as Redis, or a scalable OLAP database such as Vertica.

All of the above assumes that you're able to secure data center space and network provisioning capable of serving this load, which is not trivial at the numbers you're talking.

like image 183
Jason Watkins Avatar answered Jun 05 '23 06:06

Jason Watkins