8
Simple Way to Increase The Performance of Rails App : Database Optimization www.railscarma.com

Data base management rc p pt

Embed Size (px)

Citation preview

Page 1: Data base management rc p pt

Simple Way to IncreaseThe

Performance of Rails App :Database Optimization

www.railscarma.com

Page 2: Data base management rc p pt

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

Page 3: Data base management rc p pt

We are going to focus on DataBase Optimization

www.railscarma.com

Page 4: Data base management rc p pt

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

Page 5: Data base management rc p pt

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

Page 6: Data base management rc p pt

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

Page 7: Data base management rc p pt

To read full article visit RailsCarma Blog

www.railscarma.com

Page 8: Data base management rc p pt

Thank You

www.railscarma.com