Upload
railscarma
View
42
Download
0
Embed Size (px)
Citation preview
Simple Way to IncreaseThe
Performance of Rails App :Database Optimization
www.railscarma.com
The main areas to concentrate to improve you app performance while developing:
1. Database optimization and Query optimization
2. JavaScript, CSS optimization
www.railscarma.com
We are going to focus on DataBase Optimization
www.railscarma.com
These are the following steps to be done for database optimization : 1. Maintaining proper indexing for required
tables in the db (don’t over do indexing ,it may also lead to lowering performance.)
2. Do not write queries in loop, Its the biggest Don’t do while coding.
www.railscarma.com
3. Maintaining proper relation and association between models.
4. Fetch only when it is required and only what is required and reuse the fetched data from the db as much as possible.
www.railscarma.com
5. Optimize the query by limiting the data fetched and fetch data in batches for large amount of data.
6. Database caching can be used to reduce the response time and number of queries . We can achieve it by implementing memcached and dalli gem.
www.railscarma.com
To read full article visit RailsCarma Blog
www.railscarma.com
Thank You
www.railscarma.com