Showing posts with label Performance. Show all posts
Showing posts with label Performance. Show all posts

Saturday, December 13, 2008

mysql replication

MySQL provides ability to replicate a database in a Master/Slave fashion. All write and update operations are done on Master instance and are written to a binary log. This log is read by slave instances to replicate the changes. Replication is done in asynchronous mode, slaves keep track of the location within the log.

When would you use a replication ?
1) For high scalability, read off of slaves and writes on Master.
2) For backups.
3) For having a copy of data to resource intensive analytics without hindering master server performance.

Hibernate OutOfMemoryException

When working with large number of Hibernate objects returned by a query, hibernate caches these objects in 1st level cache. To avoid running out of heap space use session.flush(), session.clear() and ScrollableResults.