667481 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 23 Messages: 23 Messages: 23 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

Article: Avoiding J2EE data layer bottlenecks

Posted by: Dion Almaer on April 05, 2004 DIGG
Christopher Keene has released an article that defines three common causes of application data bottlenecks and suggests approaches for eliminating them. He discusses model-intensive requirements, transaction-intensive requirements, and data-intensive requirements.

Read Christopher in An ounce of prevention: Avoid J2EE data layer bottlenecks

Threaded replies

·  Article: Avoiding J2EE data layer bottlenecks by Dion Almaer on Mon Apr 05 11:25:05 EDT 2004
  ·  Article: Avoiding J2EE data layer bottlenecks by Craig Wohlfeil on Mon Apr 05 16:19:54 EDT 2004
    ·  Article: Avoiding J2EE data layer bottlenecks by ABC DEF on Mon Apr 05 17:38:16 EDT 2004
      ·  Apply Paretto's law by glauco scheffel on Tue Apr 06 10:49:23 EDT 2004
  ·  Article: Avoiding J2EE data layer bottlenecks by Kit Davies on Tue Apr 06 08:09:47 EDT 2004
    ·  Good article and word of caution. by Michal Harezlak on Tue Apr 06 10:52:00 EDT 2004
      ·  Good article and word of caution. by Cameron Purdy on Tue Apr 06 11:45:16 EDT 2004
        ·  Good article and word of caution. by Donald Smith on Wed Apr 07 06:50:24 EDT 2004
        ·  Limitations of jcache for J2EE applications by Chris Keene on Thu Apr 08 20:14:33 EDT 2004
          ·  Limitations of jcache for J2EE applications by Cameron Purdy on Thu Apr 08 22:04:21 EDT 2004
            ·  Limitations of jcache for J2EE applications by Sue Llewellyn on Fri Apr 09 19:16:01 EDT 2004
              ·  Why JDO + JCache makes sense by Patrick Linskey on Tue Apr 13 11:49:41 EDT 2004
                ·  Not *ALL* O/R Mapping Products... by Jim Barton on Thu Apr 22 11:05:11 EDT 2004
      ·  Good article and word of caution. by Donald Smith on Wed Apr 07 06:58:05 EDT 2004
  ·  Caution modifier + more OR info by Chris Keene on Tue Apr 06 17:13:19 EDT 2004
    ·  Journalists for you. by Michal Harezlak on Wed Apr 07 02:52:47 EDT 2004
      ·  Journalists for you. by Chris Keene on Thu Apr 08 12:30:11 EDT 2004
    ·  Anyone using SQL user-defined types? by Bertrand Fontaine on Wed Apr 07 05:43:38 EDT 2004
      ·  Anyone using SQL user-defined types? by Christian Bauer on Wed Apr 07 06:53:00 EDT 2004
        ·  Anyone using SQL user-defined types? Stored Procedures by Chris Keene on Wed Apr 07 15:37:22 EDT 2004
          ·  Mapping to stored procs by Patrick Linskey on Mon Apr 12 19:31:37 EDT 2004
            ·  Full object-relational mapping to stored procedures by Chris Keene on Wed Apr 21 12:58:29 EDT 2004
            ·  Mapping to stored procs by DODO DODO on Mon Apr 26 10:53:17 EDT 2004
              ·  re: stored procedures by Cameron Purdy on Mon Apr 26 13:36:08 EDT 2004
  Message #116689 Post reply Post reply Post reply Go to top Go to top Go to top

Article: Avoiding J2EE data layer bottlenecks

Posted by: Craig Wohlfeil on April 05, 2004 in response to Message #116638
Ummm, did I read this wrong or is he actually suggesting the usage of Entity EJBs to AVOID data access bottlenecks? Seems a bit odd, no?

  Message #116701 Post reply Post reply Post reply Go to top Go to top Go to top

Article: Avoiding J2EE data layer bottlenecks

Posted by: ABC DEF on April 05, 2004 in response to Message #116689
Naw, he's just warning against taking automated mappings lightly because they can have severe performance consequences.

  Message #116792 Post reply Post reply Post reply Go to top Go to top Go to top

Article: Avoiding J2EE data layer bottlenecks

Posted by: Kit Davies on April 06, 2004 in response to Message #116638
Good article. Very clear.

He mentions Toplink & EdgeXtend as data services layer candidates. Are there any others, or maybe a comparison chart?

Regards
Kit

  Message #116814 Post reply Post reply Post reply Go to top Go to top Go to top

Apply Paretto's law

Posted by: glauco scheffel on April 06, 2004 in response to Message #116701
Most code fall into Paretto's law - the 80-20 rule - in
which the vast majority of code can be automated consistently by code generators and mapping tools without problems - applying MDA.
Few classes will consume substantial work to have a good performance to access data. The best way to give good performance in this points is a good sql programmer.

  Message #116817 Post reply Post reply Post reply Go to top Go to top Go to top

Good article and word of caution.

Posted by: Michal Harezlak on April 06, 2004 in response to Message #116792
Good article, but leaves out JDO, Hibernate and such which are not as mature as EdgeXtend and TopLink but provide alternative to price at (I apologize if I am mistaken but I think it is close number) 10K and 15K per CPU EdgeXtend and TopLink. Most people have probably noticed Christopher Keene is CEO of Persistence Software maker of EdgeXtend.

  Message #116828 Post reply Post reply Post reply Go to top Go to top Go to top

Good article and word of caution.

Posted by: Cameron Purdy on April 06, 2004 in response to Message #116817
Toplink is included with Oracle 9iAS (depending on the edition) so if you're an all-Oracle shop, you probably already have it. OTOH, I'm not sure if you can even buy it separately any more.

Most people have probably noticed Christopher Keene is CEO of Persistence Software maker of EdgeXtend.

They have now ..

Peace,

Cameron Purdy
Tangosol, Inc.
Coherence: Clustered JCache for Grid Computing!

  Message #116887 Post reply Post reply Post reply Go to top Go to top Go to top

Caution modifier + more OR info

Posted by: Chris Keene on April 06, 2004 in response to Message #116638
The "true" author of the article was actually Richard Jensen, who is a Senior Architect at Persistence Software (JavaWorld mixed up the authors - maybe just because they had my bio handy). So although the article is evilly twisted with subliminal messages to make you want to buy only our OR mapping, it at least has *some* basis in technical fact.

For more info on this subject, try the folling links:
1. Scott Ambler's OR mapping white papers http://www.ambysoft.com/onlineWritings.html
2. Doug Barry's OR mapping white papers
http://www.service-architecture.com/object-relational-mapping/articles/index.html
3. A very complete but somewhat unreadable comparison of OR tools is here
http://c2.com/cgi/wiki?ObjectRelationalToolComparison
4. Persistence Software's (evilly slanted) OR mapping white papers
http://www.persistence.com/technology/index.html
5. Download our Eclipse OR mapping plug-in for Java at:
http://www.persistence.com/download/index.html

- chris keene
The Putative but not Actual Author of "Deep O/R Mapping"
www.persistence.com

  Message #116934 Post reply Post reply Post reply Go to top Go to top Go to top

Journalists for you.

Posted by: Michal Harezlak on April 07, 2004 in response to Message #116887
Apart from being evil entity sublimely influencing unsuspecting public (BTW it made me want to buy a bottle o'vanilla coke) I still see chance of redemption for you Chris. Giving credit when it is due (Richard’s article) is a rare occurrence in today’s power and fame hungry world.

You must forgive my suspiciousness on account of my growing up in a communist country where one had to suspect even one’s brother, for it were strenuous times.

Regards.

  Message #116950 Post reply Post reply Post reply Go to top Go to top Go to top

Anyone using SQL user-defined types?

Posted by: Bertrand Fontaine on April 07, 2004 in response to Message #116887
An approach I never find discussed is to work with SQL user-defined types (UDTs). For example, you can define an SQL type ADDRESS to be used in a table CONTACT:

CREATE TYPE ADDRESS (
    STREET VARCHAR(40),
    CITY VARCHAR(40),
    ...
);

CREATE TABLE CONTACT (
    FIRSTNAME VARCHAR(40),
    LASTNAME VARCHAR(40),
    LOCATION ADDRESS,
    ...
);

The ADDRESS type can then be mapped one-to-one to a Java Address class implementing the java.sql.SQLData interface part of JDBC 2.0. No impedance mismatch, and you get all the usual benefits of a database, including caching.

Anyone having real life experience using that approach? What are the pros and cons? After all, all leading database vendors support UDTs and JDBC 2.0 is around for quite a few years now...

  Message #116955 Post reply Post reply Post reply Go to top Go to top Go to top

Good article and word of caution.

Posted by: Donald Smith on April 07, 2004 in response to Message #116828
Toplink is included with Oracle 9iAS (depending on the edition) so if you're an all-Oracle shop, you probably already have it. OTOH, I'm not sure if you can even buy it separately any more.
Yup, you always have been able to buy it separately, and still can. Still supports any app server, any database, any IDE.

 - Don

  Message #116956 Post reply Post reply Post reply Go to top Go to top Go to top

Anyone using SQL user-defined types?

Posted by: Christian Bauer on April 07, 2004 in response to Message #116950
You can't define new operators for your new types, so UDTs in SQL have been (probably will be) useless. It's also pretty much non-portable and very very weak in features. BTW, a good book you can read in one afternoon about databases, SQL and it's flaws: http://www.amazon.com/exec/obidos/tg/detail/-/0201485559

So far, I've only heard from one person using UDTs (with PostgreSQL) and never seen any database that extensively uses them. There are many reasons for that so we can still dream that someone implements a real relational type system.

  Message #116957 Post reply Post reply Post reply Go to top Go to top Go to top

Good article and word of caution.

Posted by: Donald Smith on April 07, 2004 in response to Message #116817
(I apologize if I am mistaken but I think it is close number) 10K and 15K per CPU EdgeXtend and TopLink.
Nah, TopLink is at most $5k per cpu. Named user pricing can make it even much less. Moreover, it's royalty free for ISV and embedded apps.

 - Don

  Message #117024 Post reply Post reply Post reply Go to top Go to top Go to top

Anyone using SQL user-defined types? Stored Procedures

Posted by: Chris Keene on April 07, 2004 in response to Message #116956
One interesting alternative for simplifying the object-relational mapping is to use stored procedures. This enables a considerable amount of massaging/mapping to be done within the database, with the objective of making the actual object-relational mapping itself easier.

In companies with a strong DBA group, stored procedures can sometimes be the only way "unwashed" programmers are allowed to get access to the pure inner sanctum of corporate data.

Although OR mapping to stored procedures can be an elegant approach, it may not be supported by your CMP or JDO or whatever flavor of data layer you're using. Self-servingly, this is something supported by "best-of-breed" data layers like Oracle Toplink or Persistence Edgextend.

See this link for an example of how this can work:

http://support.persistence.com/Discussion/viewmsg.asp?Mid=89

- chris

  Message #117190 Post reply Post reply Post reply Go to top Go to top Go to top

Journalists for you.

Posted by: Chris Keene on April 08, 2004 in response to Message #116934
Oh, I'm just as power and fame hungry as the next capitalist running dog. Just craftier and hence more dangerous ;-)

  Message #117411 Post reply Post reply Post reply Go to top Go to top Go to top

Limitations of jcache for J2EE applications

Posted by: Chris Keene on April 08, 2004 in response to Message #116828
For the kinds of data access performance problems described in this article, it is not clear that a temporary caching API like JCache offers additional value.

Many data mapping products, from Toplink to EdgeXtend to some JDO flavors to Hibernate offers not just caching, but clustered caching.

The applications where JCache would be more appropriate would be applications with no persistent data or with very simple data access such as JDBC.

- chris

  Message #117423 Post reply Post reply Post reply Go to top Go to top Go to top

Limitations of jcache for J2EE applications

Posted by: Cameron Purdy on April 08, 2004 in response to Message #117411
Chris: Many data mapping products, from Toplink to EdgeXtend to some JDO flavors to Hibernate offers not just caching, but clustered caching.

Five JDO vendors and Hibernate support clustered caching by using Tangosol Coherence, which is (or will be when it becomes published) jCache compliant.

Chris: The applications where JCache would be more appropriate would be applications with no persistent data or with very simple data access such as JDBC.

You're joking, right? ;-)

Peace,

Cameron Purdy
Tangosol, Inc.
Coherence: Clustered JCache for Grid Computing!

  Message #117501 Post reply Post reply Post reply Go to top Go to top Go to top

Limitations of jcache for J2EE applications

Posted by: Sue Llewellyn on April 09, 2004 in response to Message #117423
For what it's worth, we are evaluating a JDO solution right now that has its own caching built in. I suppose we could use jcache instead of the built in caching, but what would be the point?

  Message #117714 Post reply Post reply Post reply Go to top Go to top Go to top

Mapping to stored procs

Posted by: Patrick Linskey on April 12, 2004 in response to Message #117024
One interesting alternative for simplifying the object-relational mapping is to use stored procedures.
One downside of this approach in the context of this thread is that pushing additional work onto the database server (as opposed to the presumably clustered application tier) is that this will actually increase load on the database, making it more of a point of failure than less. So, while stored procs can help out with dumbing down your mappings, this can be bad for overall system scalability.
Although OR mapping to stored procedures can be an elegant approach, it may not be supported by your CMP or JDO or whatever flavor of data layer you're using. Self-servingly, this is something supported by "best-of-breed" data layers like Oracle Toplink or Persistence Edgextend.
Well, I guess that by that definition, Kodo is also "best-of-breed", with a couple differences -- you just need to return to us the primary keys at a minimum, and we'll work out the rest from there, and you can also use stored procs for inserts/updates/deletes as well as selects. See http://docs.solarmetric.com/ref_guide_enterprise_sql.html for details about selects via stored procs.

-Patrick

  Message #117802 Post reply Post reply Post reply Go to top Go to top Go to top

Why JDO + JCache makes sense

Posted by: Patrick Linskey on April 13, 2004 in response to Message #117501
For what it's worth, we are evaluating a JDO solution right now that has its own caching built in. I suppose we could use jcache instead of the built in caching, but what would be the point?
Most of the JDO implementations and O/R mapping products that I've used have built-in caching, but their distributed caching is either non-existent or relatively naive. At best, you'll see some sort of variant on a Seppuku pattern, in which a commit in one VM will trigger other VMs to drop the modified data from their caches (if present). So, each VM will have its own partial, semi-autonomous data cache. That's how Kodo's data cache behaves by default, for example.

This is acceptable for many applications, but when you start really hitting your database hard (i.e., load == 1 on the db machine), this becomes a good area for improvement. It's in this type of situation when a more aggressive caching algorithm, such as clustered caching managing updates coherently (instead of evicting modified data), will be particularly valuable. That's why we added support for Coherence to Kodo JDO. It means that data that is being used and modified a lot is always available from the clustered cache, and that means that the VMs in the cluster are not being forced to always go back to the db for fresh values.

There are even more aggressive options available, such as aggregating the caching resources of all the VMs into one giant cache, and grouping and coalescing database updates together using write-behind caching. In large-scale clusters, these options make a significant difference in how far the application can scale up without completely soaking the database (i.e., load == 1).

-Patrick

--
Patrick Linskey
Kodo JDO
http://solarmetric.com

  Message #119012 Post reply Post reply Post reply Go to top Go to top Go to top

Full object-relational mapping to stored procedures

Posted by: Chris Keene on April 21, 2004 in response to Message #117714
You are right that tying the OR mapping to stored procedures can make more work for the database. However, there are several situations where the OR mapping needs to map to a set of database stored procedures, not just for selects, but also for deletes, updates and (especially) inserts. Examples include:
1. Some companies have standards for data access that reqire all data access to go throught stored procedures to ensure data integrity (DBAs never trust those pesky programmers to get all the data semantics right ;-))
2. As mentioned before, stored procedures may be used to create a virtual table by integrating data from several other tables
3. Inserts are often done through stored procedure to ensure that the right rules are followed in creating a primary key (see trust issue above)

In all of these situations, the object-relational mapping needs to map all object operations (create, read, update, delete) to the appropriate stored procedure.

For more information, see http://www.persistence.com/technology/mapping.html" target="_blank">object-relational mapping

- chris
The technology leader for object-relational mapping and distributed caching
www.persistence.com

  Message #119162 Post reply Post reply Post reply Go to top Go to top Go to top

Not *ALL* O/R Mapping Products...

Posted by: Jim Barton on April 22, 2004 in response to Message #117802
Most of the JDO implementations and O/R mapping products that I've used have built-in caching, but their distributed caching is either non-existent or relatively naive. At best, you'll see some sort of variant on a Seppuku pattern, in which a commit in one VM will trigger other VMs to drop the modified data from their caches (if present).
<vendor>
Not *ALL* O/R mapping products with integrated caching use the "naive" Seppuku pattern. Persistence, for example, sends a single image of modified data to other servers upon commit, which is automatically applied to the remote cache. Thus, remote caches neither drop the modified data nor do they require a trip to the database on the next request for the modified object.

Incidentally, this works not only in JVMs but tranparently across platforms: Java, C++, and .NET.
</vendor>

Jim Barton
Persistence Software

  Message #119535 Post reply Post reply Post reply Go to top Go to top Go to top

Mapping to stored procs

Posted by: DODO DODO on April 26, 2004 in response to Message #117714
One interesting alternative for simplifying the object-relational mapping is to use stored procedures.
One downside of this approach in the context of this thread is that pushing additional work onto the database server (as opposed to the presumably clustered application tier) is that this will actually increase load on the database, making it more of a point of failure than less. So, while stored procs can help out with dumbing down your mappings, this can be bad for overall system scalability
Personally I don't think so.The overall performance will be better since you get rid of network latency(unless you try to do some heavy FP calculations in the stored proc:-))). In some engines SPs will guarantee you a better access plan reuse. The packages in Oracle can simulate(emulate?) pretty well OO(unfortunately you'll become an Oracle shop.)
And the author of one OR tool mentioned in his blog that he doesn't really understand what's a hash join. And THAT is scarry and not scalable.

  Message #119561 Post reply Post reply Post reply Go to top Go to top Go to top

re: stored procedures

Posted by: Cameron Purdy on April 26, 2004 in response to Message #119535
DODO DODO: The overall performance will be better since you get rid of network latency(unless you try to do some heavy FP calculations in the stored proc:-))). In some engines SPs will guarantee you a better access plan reuse. The packages in Oracle can simulate(emulate?) pretty well OO(unfortunately you'll become an Oracle shop.)

You're absolutely right, and if you're already an Oracle shop and plan to remain that way, it's not such a terrible thing. ;-)

If the application is well architected up front, you can put the "functionality" into Stateless Session Beans, with a "least common denominator" CMP/CMR entity EJB implementation behind it, for example. Then, you can start to optimize specific parts of the application by moving the logic into stored procedures, called directly from the session EJBs. The down side is that it can cause some issues with applications that use some entity EJB-based data access and some stored procedures, since the entity cache can end up with stale data. It's a very doable architecture, but it does require careful planning, and some detailed understanding of how the application server manages entity EJBs, particularly caches that cross transactional boundaries (e.g. some of the WebLogic advanced features.)

Peace,

Cameron Purdy
Tangosol, Inc.
Coherence: Clustered JCache for Grid Computing!

New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com

Dependency Injection in Java EE 6 - Part 1

Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (November 2, Article)

SAML: It's Not just for Web services

SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options. (September 28, Article)

Programming is Also Teaching Your Team

Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team. (September 22, Article)

Can Java EE Deliver The Asynchronous Web?

Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies. (July 14, Article)

JSF Flex

JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags. (June 29, Article)

The Rules of SOA - A Road to a Successful SOA Implementation

In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project. (June 23, Tech Talk)

Ari Zilka Talks About Terracotta 3.1

Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now. (June 15, Tech Talk)

Enterprise Application Integration, and Spring

In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements. (June 15, Tech Talk)

Google Web Toolkit: An Introduction

In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls. (June 4, Tech Talk)

Just Enough Early Architecture to Guide Development

Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable. (May 28, Tech Talk)

Productive Programmer: On the Lam from the Furniture Police

This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work. (May 26, Tech Talk)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application. (May 19, Article)

Auto-Scaling Your Existing Web Application

In this session Nati Shalom demonstrates how to take a standard Java EE web application and scale it out or down dynamically without changes to the application code. Seeing as most web applications are over-provisioned to meet infrequent peak loads, this is a dramatic change because it enables growing your application as needed, when needed, without paying for unutilized resources. (May 19, Tech Talk)

Free Book PDF Download: Mastering EJB Third Edition

Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)

Application Server Matrix

The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map