Scaling the Enterprise Application Using the Ruby component,Mongrel Handlers and Mysql Sharding.
Some of the enterprise application shouldn't scale with rails engine,which is occupies more RAM space and we need to run more rails instance to handle the more request.
For this case we have option to use ruby components,Mongrel handlers not a rails mongrel server and Mysql Sharding.
When we compare the memory space of the rails mongrel servers and mongrel handlers.The mongrel handlers occupies less RAM space relatively 40% less then the rails mongrel servers.
This mongrel handlers will accept the request from the outside world and we can redirect to our ruby component to do our business logic and save it in the database.
When we come to the Mysql Sharding,which means we are saving the records in the different database and mysql physical servers.So it will give you more efficient way of saving records with the less configuration physical servers and help you for cost of the servers.
Using this method of saving datas in the database will give you tremendous amount of capacity.
While generating the reports or analytics for the saved data we should have the seperate ruby component which read the shard database and generate the reports as per our requirement.
In this way we can achive more capable of handling request through the mongrel handlers and using ruby component which is pure core level of code which give you more performance compare to handling the request through the Rails Engine which basically do dipatch to controller and action and then return the results.
And the Mysql sharding also will help you to handle the large number of datas and generating the reports.
Comparing the Rails Mongrel Servers and Mongrel Handlers.
-Rails Mongrel Servers Instance occupy RAM Space of - 150 mB
-Mongrel Handlers occupy RAM Space of - 90 mB
Comparing Accepting Request through Rails Mongrel Servers and Mongrel Handlers.
-Rails Mongrel Servers Instance will handle the single request at a time.
-Mongrel Handlers will handle more then 10-15 request at a time.
Comparing Normal Mysql and Mysql Sharding.
-Noraml Myql can handle only limited records and it will get hang when the record get larger and larger.
-In Sharding of Mysql will have the capability to handle more datas.Because it saves the datas in different databse and different physical servers.
Comparing Ruby Component and Rails Engine.
- When we are calling the pure Ruby component and Ruby DBI which is direct coding gives you performance to do the business logic for large entrerprise application.
-When we are using the rails engine it basically do the ground work like dipatching to controller and interact to the model and finally fetch the results.which have lot of work to do and it will affect the performance.
Basic Understanding of the above discussion:
1.When we are looking for the web application like displaying the pages and fetch the values based on the user interaction we have to go for the Rails.
2.When we are looking for background process like handling the process asychronously and managing the massive amount of datas in mysql we can go for the ruby component,mongrel handlers and shard mysql.
Tuesday, October 6, 2009
Subscribe to:
Posts (Atom)