Minimizing network hops during saving

Minimizing network hops during saving

Old forum URL: forums.lhotka.net/forums/t/3892.aspx


ajj3085 posted on Tuesday, November 13, 2007

Hi,

My application is working, and my users are mostly happy.  One thing is that some users are now in another office, so performance over our T1 is becoming an issue.  For the most part, its an issue for users saving quotes or orders, etc.

The problem is that each object persists itself, resulting in a call to the db.  Everything is running in local mode.  With a large document, this can generate around 55 seperate calls (50 items each, and then a few more of "header" information). 

Pre-Csla, I wrote functionality into the our custom data layer which allowed you to "batch" commands.  It basically would not execute the sql call, instead it would build it and tack it onto the end of a string.  When you called the finish, it sent the entire string (which would be all the individual calls) to the database and get the results back.  I don't think i can do something similar here.

One option would be to turn on Remoting.  I think that would work, since the remoting host would be the database server itself, and it would mean only one back and forth over the network.  Although I thought I followed all the Csla best practices, there does seem to be issues with going this route that I'll have to debug.  I'm also not sure if that would be the proper solution to my problem.

Any other ideas out there?  Or should I just use remoting?

Thanks
Andy

RockfordLhotka replied on Tuesday, November 13, 2007

Networking infrastructure requirements/limitations is one of the primary drivers for switching from 2-tier to 3-tier. If I were you, I'd try to resolve the issues you mention and just try using a remote data portal. Odds are good that this will improve performance for the people making those calls across the constricted network link.

ajj3085 replied on Tuesday, November 13, 2007

Rocky,

I'll go this route then; I thought I had the wrong reasons for switching to remote, but it sounds like I have all the right ones.


Thanks
Andy

RockfordLhotka replied on Tuesday, November 13, 2007

I always encourage people to go with 2-tier deployments if possible, because more tiers increases complexity and cost.

 

But it is important to recognize when the value of 3-tier outweighs that complexity/cost. The primary three motivators are:

 

1.       Security – using an app server allows you to shift the database credentials from clients to the server, adding security because a would-be hacker (or savvy end-user) would need to hack into the app server to get those credentials.

2.       Network infrastructure limitations – sometimes a 3-tier solution can help offload processing from CPU-bound or memory-bound machines, or it can help minimize network traffic over slow or congested links. This is your situation the way it sounds, because direct database communication is a chatty dialog, and using an app server allows a single blob of data to go across the slow link, and the chatty dialog to occur across a fast link, so it should result in a net win for performance.

3.       Scalability – using an app server provides for database connection pooling. The trick here, is that if you don’t need it, you’ll harm performance by having an app server, so this is only useful if database connections are taxing your database server. Given the state of modern database hardware/software, scalability isn’t a big deal for the vast majority of applications anymore.

 

Rocky

 

 

From: ajj3085 [mailto:cslanet@lhotka.net]
Sent: Tuesday, November 13, 2007 3:59 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] Minimizing network hops during saving

 

Rocky,

I'll go this route then; I thought I had the wrong reasons for switching to remote, but it sounds like I have all the right ones.


Thanks
Andy


Copyright (c) Marimer LLC