3.2.1 Limitations of the Two-tier System
In a conventional two-tier system that presents the database layer as a set of shared data, a pure object-oriented approach would be to represent the database records as shared CORBA objects (in CORBA applications) or entity beans (in EJB applications). However, this approach has the following limitations:
- It does not scale well. As the number of clients increases dramatically, the server machine might be required to manage thousands (or even millions) of database objects, each requiring its own transaction context.
- It does not use network resources efficiently. When database objects are instantiated in the server machine’s memory, the entire database object is read into or written from memory regardless of how much data the client application really needs from the object.
- For EJB applications, the conventional way to access a database is via entity beans, where an entity bean represents a row in a database table. However, to access an entity bean, a client application must make two calls: the first call obtains the object reference to the entity bean, and the second call invokes a method on that entity bean. Obtaining the object reference for the client is an expensive operation, particularly in high-volume enterprise applications.
Parent topic: Increasing Scalability and Resource Utilization