473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

What makes database connection expensive?

We all seem to know that database connections are expensive and we try
to reduce the number of database trips as much as possible.

This may sound like a stupid question: What makes a database
connection expensive? Is it memory intensive? CPU-intensive? Or does
it use a lot of bandwidth? Or none of these?

Thanks.
Jan 30 '08 #1
4 2085
Creating the connection - opening the socket and preparing datastructures -
seems to be where the expense is located relative to the speed of querying
that is.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------

"gnewsgroup" <gn********@gmail.comwrote in message
news:9b**********************************@e25g2000 prg.googlegroups.com...
We all seem to know that database connections are expensive and we try
to reduce the number of database trips as much as possible.

This may sound like a stupid question: What makes a database
connection expensive? Is it memory intensive? CPU-intensive? Or does
it use a lot of bandwidth? Or none of these?

Thanks.
Jan 30 '08 #2
On Jan 30, 12:06*pm, "Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc>
wrote:
Creating the connection - opening the socket and preparing datastructures -
seems to be where the expense is located relative to the speed of querying
that is.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively onwww.lulu.com/owc$19.99
-------------------------------------------------------
Thank you very much.
Jan 30 '08 #3
Yes I agree with Alvin and I'd also like to highlight that there are
typically a limited number of simultaneous connections permitted to the
database. So while creating and destroying database connections can be
expensive, keeping them open while they're not being used can also be
expensive.
This is why the built-in connection pooling feature of ADO.NET is so nice
even though it may not be perfectly optimal in all situations.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
http://iPhonePlaza.net
"gnewsgroup" <gn********@gmail.comwrote in message
news:9b**********************************@e25g2000 prg.googlegroups.com...
We all seem to know that database connections are expensive and we try
to reduce the number of database trips as much as possible.

This may sound like a stupid question: What makes a database
connection expensive? Is it memory intensive? CPU-intensive? Or does
it use a lot of bandwidth? Or none of these?

Thanks.
Jan 30 '08 #4
To be fair, ADO has been pooling connections long before ado.net :)

"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netwrote in
message news:8C**********************************@microsof t.com...
Yes I agree with Alvin and I'd also like to highlight that there are
typically a limited number of simultaneous connections permitted to the
database. So while creating and destroying database connections can be
expensive, keeping them open while they're not being used can also be
expensive.
This is why the built-in connection pooling feature of ADO.NET is so nice
even though it may not be perfectly optimal in all situations.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
http://iPhonePlaza.net
"gnewsgroup" <gn********@gmail.comwrote in message
news:9b**********************************@e25g2000 prg.googlegroups.com...
>We all seem to know that database connections are expensive and we try
to reduce the number of database trips as much as possible.

This may sound like a stupid question: What makes a database
connection expensive? Is it memory intensive? CPU-intensive? Or does
it use a lot of bandwidth? Or none of these?

Thanks.


Jan 31 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
6
by: Keith Smith | last post by:
I read in a Visual Studio .NET book that with C# it is now recommended to open database connections whenever you need to query a database as opposed to the traditional method of opening a database...
14
by: Nick Gilbert | last post by:
Hi, I have an asp.net application which runs from a CD-ROM using Cassini. As such, it is single user only. The application connects to an Access database when it is loaded, and keeps the same...
39
by: windandwaves | last post by:
Hi Folk I have to store up to eight boolean bits of information about an item in my database. e.g. with restaurant drive-through facility yellow windows
5
by: alingsjtu | last post by:
Hello, every body. When execute dynamic generated multiple OPENQUERY statements (which linkes to DB2) in SQLServer, I always got SQL1040N The maximum number of applications is already connected...
2
by: estherschindler | last post by:
For a lot of IT people -- everyone from software developers to tech writers to network support folks -- telecommuting is the best personal option. They get a flexible schedule, they aren't bothered...
11
by: Paul Brady | last post by:
Apparently, I have been living on the wrong planet. I have written 15 databases in Microsoft Access in the past 10 years, some of which are split, one uses ODBC interface with a SQL server, one...
13
by: cj | last post by:
I wrote this code in a windows app and it works: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim ds As New DataSet Dim...
2
by: cybervegan | last post by:
Hi, I'm a bit new to MySQL; here's a philisophical question. I'm working on getting my head round apache2+mod_python+mysql for web applications. It all seems pretty straight-forward, and I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.