Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Caching web applications in Java

  • What is the better way to cache a Java Web Application using MySQL? to improve performance.
  • What are the best techniques to do it?
  • It is better to do this at the application level or database level?

I'm new to this, so, sorry if I'm wrong.

like image 934
Denees Avatar asked Jan 23 '12 15:01

Denees


3 Answers

Well there are ways to have some performance tips both at database levels and Application levels.

For database levels here are few inputs

  1. Query optimization
  2. Indexes creation on frequent asked data.

For some ORM layers like hibernate it also provides some sort of mechanism to cache the outputs in primary levels and secondary levels.

For application levels we have many options few of them are

1.EHCache 2. Memcached

JCS

here is a complete list of java based caching frameworks

java-caching-system

and some googling will help you to find many other options for UI layers there are lots of area of improvements like

  1. Proper use of HTTP headers
  2. Less number of server Hits.
  3. Way to load javascripts
  4. Way to load CSS files
  5. use of CDN severs

Yahoo has very good blog for this.YSLOW from YAHOO.If you are in the early stage of development i will suggest not to go for them as they lead to premature optimization and can lead to may problems.

like image 166
Umesh Awasthi Avatar answered Sep 27 '22 22:09

Umesh Awasthi


Why don't you look at below links which could help you.

Article1

Article2

like image 43
Ravi Vanapalli Avatar answered Sep 27 '22 23:09

Ravi Vanapalli


Frameworks exist for this purpose and Ehcache is one of them. Here you can read up on how you can use it:ehcache

like image 21
Thomas Johan Eggum Avatar answered Sep 27 '22 22:09

Thomas Johan Eggum