Performance of the Spring Framework - in concern

Discussions

Performance and scalability: Performance of the Spring Framework - in concern

  1. I am looking for your opinion on performances of the Spring Framework. I am new to the Spring and, being also naïve, have suggested that this framework should not change Best Practices in the application design. My colleagues have told me that I am wrong. In my system, I have multiple threads each of which performs the same operation on different data including a) storing data in the database, and b) sending notification message via a MOM system (not necessary via JMX). Since the data is highly important, I suggested that each thread has to perform individual unit of work and independently communicate with DB and MOM in spite of the performance hit for the thread caused by the re-connecting to the DB and MOM. In my case, access to DB and MOM is single-threaded. So, the alternative solution based on sharing of the single connection to DB and MOM respectively was proposed on the basis that Spring Framework is too slow in injection and instantiation of the connection objects. The risk of loosing everything if next communication hangs and risk of global performance hit caused by sequential data transmission (obvious bottleneck), were considered less risky than performance degradation caused by the Spring Framework. It is hard to believe in that but I do not have a chance to really measure comparative performances. Please, share your experience with regards to that matter with me. Sincerely, - Michael Poulin
  2. Hi Michael I would like to suggest that you consider using the Spring module which supports GigaSpaces to address your concerns. This approach can provide you a single solution which will speed up your data access and address your messaging concerns. This will enable you to maintain your data in a reliable fashion in memory (speeding up data access for your application code) and continue to persist it into the DB in an asynchronous fashion. The GigaSpaces IMDG (In-Memory-Data-Grid) would be injected into your application using the Spring DAO abstraction allowing you to decouple that layer from other parts of your code. That means that you should be able to plug-in this module quite easily. In addition to that you can handle the messaging piece in similar fashion using the spring Remoting abstraction. This approach has already been proven effective by one of our customers: a top-tier banking firm, in increasing the scalability and performance of their spring-based application. You can find more information about using GigaSpaces in this way on the following pages: Open source reference implementation using the Spring Modules GigaSpaces Spring documentation Deploying spring application as distributed dynamic services Nati S. CTO GigaSpaces Write Once Scale Anywhere
  3. What you have described is a typical multi-threaded transactional system, and you can use Spring to do it quite easily. It is probably as easy as having a single transaction wrap the JDBC and JMS work, and committing them together. Nati's product also does JMS, so it could slot in there and maybe eliminate a 2PC requirement (a good idea if the 2PC is the expensive part). Either way, though, I think that Spring will not make your app any faster or slower, since the Spring "work" will take about 0ms while the JMS and JDBC work will take all the time. Also, check out the Spring 2.0 support for Coherence. Peace, Cameron Purdy Tangosol Coherence: The Java Data Grid