Announcement Announcement Module
No announcement yet.
Hibernate listeners /propagation/ Using hibernate to search LARGE mysql table Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hibernate listeners /propagation/ Using hibernate to search LARGE mysql table


    A large part of our Spring app revolves around an events table which has about 10 million rows which is expected to grow fast

    Basically we started with a normal mysql innodb table (with indexed columns). Because the table was large, and the fact that it needed to be searched in various orders and on many different columns as well as paged then searches became quite slow.

    To help get around this, we have implemented a pattern in our current application which tries to make use of mysql's MEMORY tables. (these are tables that are stored in main memory).

    We decided to create a events_memory mysql 'memory' table initially created from the contents of the original table and then implement a custom hibernate listener pattern to propagate all CRUD on the original table to the memory table so that they are kept in synch.

    I wanted to know what peoples thoughts were on this and whether there are better solutions.?

    Secondly I want to talk about the configuration and implementation of this pattern as Im worried whether parts of it are incorrect…

    See attachment for code walkthroughAttachment

    So far it seems to hold up but hasn't hit any real heavy usage. It seems to propagate stuff correctly but would really appreciate some other folks opinions or maybe if they could point me to some good resource or text as most of this has been based on bits and pieces I have found on hibernate site and other articles.

    Im also not so impressed with the onPreUpdateCollection hibernate offers
    Attached Files