Stored Procedure VS JAVA App
Stored Procedure VS JAVA App.
| Stored Procedure | JAVA Application |
Performance | Very good The performance is good because To perform is stored in cache memory. To execute in database without sending and receiving a long SQL statement will be able to reduce network traffic. | Good If Comparing a single SP and java, SP is better than java. In case of whole system, When regarding ORMapping(e.x. Hibernate), java Can use the cash memory.. Java can distribute service processing in application layer. In means DB load reduction. |
Transaction | Good(in DB) SP ensure transaction more than java(), because of execution in DB. | Good(DB çè jdbc çè WebApp) IF we prepare security system, It is no problem. For ensuring transaction, transaction is in charge of WAS(WEBAPP) and can ensure CRUD. Concerning transaction, we have been arguing that the rocking strategy. It is also security system. |
Security | Good SP compiled in DB Server and managed in DB. |
|
Maintenance | NOT BAD WebApp may be simplified. PL-SQL is also easy. Both return values and validation checking can ensure reliability However, If including validation and preparing test SP and document and SP is properly organized, SP is good this point of view but it is difficult.
| Good Java can separate business control and DB control. Java can be support various test tool for reliability. |
Conclusion
1. I think it is necessary to use. However, before using SPl, We must consider whether only once business or not, whether business is not likely to expand, whether business focus on DB for efficiency. After we consider efficiency method, we can use SP. However, If we can get similar performance without SP, we should not use SP. Using SP should be optional, not mandatory.
2. SP does not support all of RDMS and SP is not compatible with each other well. (I herd that AXA will be not change DB vender(Oracle) ) It is reason that we use J2EE and comply their agreement. If we don’t consider porting, we can not use J2EE.
3. Regarding maintenance, We know that SP is easy language. Point of view is when occur an error, we ensure Rapid response for Reliability so we have to equip the tools for test and development.
when occur an error, we should examine all tables with relation to SP. However java can development in parses and ensure reliability with unit test and rapid response is possible than SP.
Of course, We can manage SP more easily via validation code. However, validation code is involved in each SP so duplicate validation codes are occurred every SP for duplicate purpose
In that case, we will get bad performance although we use SP for performance. Moreover, Validation codes are not managed easily.
4. In the past from the viewpoint of maintenance, C includes a SQL in the CS environment(Client and Server) generally so Sp is more useful than to check the parsing error as using C.
These days, Web-Service-Architecture is different from past environment
5. If our system architecture target work toward 3-tiers, OOP, maintenance and loose coupling, We must not use SP as possible but we get the best performance as SP so if some business has heavy traffic, in that case, we can use SP for performance partially.
출처 : http://onecellboy.tistory.com/25
[출처] Stored Procedure VS JAVA App.|작성자 야진