Using Yii with Large scale application

Hi all,

First of all, I must say that I like Yii very much. It runs so fast and easily to develop new site. I have some small project with Yii and made them run well.

Currently, I am having a new project, which maybe require large scale Application, I am working in a local Newspaper and they want to develop a new Media Site with Video, Music streaming,…

I have searched through Google a lot but seems cannot find good information for me to start on this :(

I have some questions about this project, please kindly help me and other newbies like me to understand :

So, first of all, I think I will have a Backend Server which handle all basic administrator stuff. A DB server to storage item info.

I want to have some front servers which receive requests from the Load Balancer, but how can I synchronize files between these front servers. Ex : When an editor uploads a new video, should this video files be saved on these front servers and then it can be streamed to the users ?

Can Yii handle this ?

Thank you very much you guys

Have a nice day

Syncronizing/mirroring files is more a task of linux nfs or some handmade bash scripts, I think. You can implement it with Yii’s yiic commands but I think bash/nfs will be much more efficient for this task.

Hi Samdark,

Thank you very much for your reply. Can you help me a little bit more. If you have to build a large scale web app, how are you going to structure your server and file management ?

Have a nice day

It depends on planned load, amount of content, visitors and growth.

Personally I would start with one server and nothing really related to high load. When project will go live and if it will ever start to produce such a load I’ll rewrite its parts to handle more and more requests.

Thank you Samdark for your reply. I am curious cause my local newspaper now serve about 1 millions pageviews/day. But the current CMS is wriiten on .Net, now we want to make a better CMS based on PHP. I think I found some solutions for this. I will post on here when everything more clear.

All the best wishes Samdark

You may wish to look at Scalr as a platform for hosting a site that needs to scale. It does load balancing (using nginx), and can increase the number of application servers (apache) as well as handle increasing the number of MySQL databases (including masters & slaves).

Add in a CDN network for your media (look at MaxCDN - it supports streaming content) and you have the basic recipe for a cloud-based scalable web site.

As for synchronising files - one option is to store your code in a hosted subversion or git repository and then when a server is spawned, download the latest version of the code. So when you are thinking about building scalable web solutions, you have to think of your servers as being entirely expendable. That way you’re forced to build your architecture in such a way that if something breaks, it’s no big deal.

And if you want to try all this our for next to no money - sign up for a 12 month free Amazon Web Services account and play around with micro servers until you know what you want. Scalr is also free for a basic plan.

I’m considering this type of architecture for my Yii web project, so it may be worth a look. But if you have more money, then you may want to check out RightScale (more costly, but better supported).

/Rob