广告网络基础设施意见 MySQL的? Memcached的? MongoDB的?

We are planning to create an advertisement network. As any normal online advertisement network, we would provide ad serving, reporting (stats) and a little browsing site for publishers/advertisers.

Because the application would get huge impression (ad serving) requests, our application must be able to quickly insert data to log impressions and clicks, log the count of impressions and clicks for every publisher/advertiser. This data then would be used to monitor impressions/clicks from publishers and to generate reports.

Right now we have planned the whole system to be based on PHP, MySQL (InnoDB), php-eAccelerator, Memcached (just to store active ads)

Problems/Issues

Scaling...

I seriously feel that our application is not going to scale well when our traffic grows.

MySQL insertion and UPDATES would surely be the bottleneck. Also how to distribute this all to multiple servers so that our application may scale according to load.

Can anyone please help propose a structure of the application especially for impressions logging and calculation? Would MongoDB be a better solution in any way?

Any help would be highly appreciated.

I've built several high-volume statistical collection systems using MySQL. They perform fairly well so long as you keep ahead of the scaling curve with careful planning. In particular, if you're doing lots of INSERT or UPDATE queries, heavy writes, you'll need to keep your row sizes smaller, using INT from a look-up table instead of VARCHAR columns for instance, and pay careful attention to how big your indexes are getting.

Always, always simulate your schema with massive amounts of test data. Abuse it to the breaking point, fix it, and abuse it all over again. You want to see smoke or you're not trying hard enough. Remember, hardware makes a massive difference, so be careful to use something as close as possible to the deployment target. Your SSD notebook will blow the doors off of a server with 15K enterprise drives in a RAID10 setup, for example, if you're doing heavy writes.

That being said, you might want to look at Redis. It's not a relational database, but it's several orders of magnitude faster than MySQL for things like "add one to column X" or "give me Y count for Z interval" type operations.