The connection between the database server and application server is a more limited resource than the processing capabilities of the database server? Really? What kind of database server are you using and just how slow is your network?
You may be talking about a loaded 10Mb network with a single 100MHz pentium app server with a database server on a mainframe. Or you may have a very complex and large data model with very simple application logic. In either case I'd be tempted to agree with the basic premise of your message. However a more typical high volume application might have dozens of app servers with a few redundent database servers. This is because the database server is harder to scale than the app server. In this senario, there is plenty of processing power in the app server(s).
This is not to say that stored procedures don't have their place. We use them to preform complex data manipulation tasks that cannot be handled well with straight sql queries. Since you're experience with stored procedures was positive, you're application may not lend itself to EJB. Not every one does.
--Victor
Craig McMurtry wrote:
[EMAIL PROTECTED]">
The notion that having business logic in component-based middleware rather than in stored procedures provides for better scalability is falacious. The middleware components have to retrieve data to which they apply their logic and they have to update the database with data to which they have applied their logic. Each call those components make to the database creates traffic over the finite resources of database and network connections. In practice, those resources prove to be far more of a botteneck than the processing capabilities of the database server. Hence, better scalability is achieved by simply having the component-based middleware apply security, transactional boundaries and connection management to calls from the presentation tier, and pass incoming data to stored procedures which implement the business logic, update the database and retrieve the data the presentation tier needs subsequently.
I've tried the business logic in component-based middleware solution and was surprised by how poorly it performed and scaled. Read Transactional COM+, (which is as pertinent to the EJB platform as it is to COM+), and since tried the business logic in stored procedures solution and have been very impressed with how it performs and scales.
