Skip to main content
Post Reopened by gnat, Martijn Pieters, Bart van Ingen Schenau, CommunityBot
Changed to a single question, not opinion based
Source Link
johna
  • 171
  • 1
  • 9

Getting back to basics with website Will using multiple recordsets in one database accessrequest be more efficient?

I am redeveloping an old ecommerce website which is currently written in C# ASP.NET 2.0.

I have the opportunity to develop using whatever language and technique I like.

Because this is a reasonably high volume website and has suffered performance issues I want to develop in the most efficient manner possible.

I am contemplating developing in ASP.NET WebPages (Razor). I also plan to use SqlClient to access the database. As I will be the sole developer and, although I appreciate that future changes are inevitable, I feel that having the UI and data access in the same page/script will be manageable for a site such as this with a small number of pages.

To minimise database trips (using SQL Server 2012), as database performance is the usual bottleneck in the current system, I am looking at creating stored procedures that return everything required for the current page in one query as multiple recordsets. 

For example the home page query might return the promotional banner image filenames and text, the new release products, the top selling products, etc. Then using SqlDataReader get the data from each recordset as needed and dispose of the connection and reader whenThe product page might return the last recordset has been read. I don't plan to use any data transfer objectsproduct details, related products, etc.

I chose SqlClient over Webmatrixcan't remember seeing this technique used often if at all.Data as I can specify command type of stored procedure and specify parameter Is returning all data types and lengths which I understand improves performance as query plans can be reused.

Will these methods provide maximum performance and arein a single database request more efficient than retrieving the same data in several database requests? Are there any issues with the above.flaws in doing this?

Getting back to basics with website database access

I am redeveloping an old ecommerce website which is currently written in C# ASP.NET 2.0.

I have the opportunity to develop using whatever language and technique I like.

Because this is a reasonably high volume website and has suffered performance issues I want to develop in the most efficient manner possible.

I am contemplating developing in ASP.NET WebPages (Razor). I also plan to use SqlClient to access the database. As I will be the sole developer and, although I appreciate that future changes are inevitable, I feel that having the UI and data access in the same page/script will be manageable for a site such as this with a small number of pages.

To minimise database trips (using SQL Server 2012), as database performance is the usual bottleneck in the current system, I am looking at creating stored procedures that return everything required for the current page in one query as multiple recordsets. For example the home page query might return the promotional banner image filenames and text, the new release products, the top selling products, etc. Then using SqlDataReader get the data from each recordset as needed and dispose of the connection and reader when the last recordset has been read. I don't plan to use any data transfer objects.

I chose SqlClient over Webmatrix.Data as I can specify command type of stored procedure and specify parameter data types and lengths which I understand improves performance as query plans can be reused.

Will these methods provide maximum performance and are there any issues with the above.

Will using multiple recordsets in one database request be more efficient?

I am redeveloping an old ecommerce website which is currently written in C# ASP.NET 2.0.

Because this is a reasonably high volume website and has suffered performance issues I want to develop in the most efficient manner possible.

To minimise database trips (using SQL Server 2012), as database performance is the usual bottleneck in the current system, I am looking at creating stored procedures that return everything required for the current page in one query as multiple recordsets. 

For example the home page query might return the promotional banner image filenames and text, the new release products, the top selling products, etc. The product page might return the product details, related products, etc.

I can't remember seeing this technique used often if at all. Is returning all data in a single database request more efficient than retrieving the same data in several database requests? Are there any flaws in doing this?

Post Closed as "Opinion-based" by Philipp, CommunityBot, DougM, gnat
deleted 26 characters in body
Source Link
johna
  • 171
  • 1
  • 9

I am redeveloping an old ecommerce website which is currently written in C# ASP.NET 2.0.

I have the opportunity to develop using whatever language and technique I like.

Because this is a reasonably high volume website and has suffered performance issues I want to develop in the most efficient manner possible.

I am contemplating developing in ASP.NET WebPages (Razor). I also plan to use SqlClient to access the database. As I will be the sole developer and, although I appreciate that future changes are inevitable, I feel that having the UI and data access in the same page/script will be manageable for a site such as this with a small number of pages.

To minimise database trips (using SQL Server 2012), as database performance is the usual bottleneck in the current system, I am looking at creating stored procedures that return everything required for the current page in one query as multiple recordsets. For example the home page query might return the promotional banner image filenames and text, the new release products, the top selling products, etc. Then using SqlDataReader get the data from each recordset as needed and dispose of the connection and reader when the last recordset has been read. I don't plan to use any data transfer objects.

I chose SqlClient over Webmatrix.Data as I can specify command type of stored procedure and specify parameter data types and lengths which I understand improves performance as query plans can be reused.

Just looking for opinions on whetherWill these methods will provide maximum performance orand are there any issues with the above.

I am redeveloping an old ecommerce website which is currently written in C# ASP.NET 2.0.

I have the opportunity to develop using whatever language and technique I like.

Because this is a reasonably high volume website and has suffered performance issues I want to develop in the most efficient manner possible.

I am contemplating developing in ASP.NET WebPages (Razor). I also plan to use SqlClient to access the database. As I will be the sole developer and, although I appreciate that future changes are inevitable, I feel that having the UI and data access in the same page/script will be manageable for a site such as this with a small number of pages.

To minimise database trips (using SQL Server 2012), as database performance is the usual bottleneck in the current system, I am looking at creating stored procedures that return everything required for the current page in one query as multiple recordsets. For example the home page query might return the promotional banner image filenames and text, the new release products, the top selling products, etc. Then using SqlDataReader get the data from each recordset as needed and dispose of the connection and reader when the last recordset has been read. I don't plan to use any data transfer objects.

I chose SqlClient over Webmatrix.Data as I can specify command type of stored procedure and specify parameter data types and lengths which I understand improves performance as query plans can be reused.

Just looking for opinions on whether these methods will provide maximum performance or any issues with the above.

I am redeveloping an old ecommerce website which is currently written in C# ASP.NET 2.0.

I have the opportunity to develop using whatever language and technique I like.

Because this is a reasonably high volume website and has suffered performance issues I want to develop in the most efficient manner possible.

I am contemplating developing in ASP.NET WebPages (Razor). I also plan to use SqlClient to access the database. As I will be the sole developer and, although I appreciate that future changes are inevitable, I feel that having the UI and data access in the same page/script will be manageable for a site such as this with a small number of pages.

To minimise database trips (using SQL Server 2012), as database performance is the usual bottleneck in the current system, I am looking at creating stored procedures that return everything required for the current page in one query as multiple recordsets. For example the home page query might return the promotional banner image filenames and text, the new release products, the top selling products, etc. Then using SqlDataReader get the data from each recordset as needed and dispose of the connection and reader when the last recordset has been read. I don't plan to use any data transfer objects.

I chose SqlClient over Webmatrix.Data as I can specify command type of stored procedure and specify parameter data types and lengths which I understand improves performance as query plans can be reused.

Will these methods provide maximum performance and are there any issues with the above.

added 206 characters in body
Source Link
johna
  • 171
  • 1
  • 9

I am redeveloping an old ecommerce website which is currently written in C# ASP.NET 2.0.

I have the opportunity to develop using whatever language and technique I like.

Because this is a reasonably high volume website and has suffered performance issues I want to develop in the most efficient manner possible.

I am contemplating developing in ASP.NET WebPages (Razor). I also plan to use SqlClient to access the database. As I will be the sole developer and, although I appreciate that future changes are inevitable, I feel that having the UI and data access in the same page/script will be manageable for a site such as this with a small number of pages.

To minimise database trips (using SQL Server 2012), as database performance is the usual bottleneck in the current system, I am looking at creating stored procedures that return everything required for the current page in one query as multiple recordsets. For example the home page query might return the promotional banner image filenames and text, the new release products, the top selling products, etc. Then using SqlDataReader get the data from each recordset as needed and dispose of the connection and reader when the last recordset has been read. I don't plan to use any data transfer objects.

I chose SqlClient over Webmatrix.Data as I can specify command type of stored procedure and specify parameter data types and lengths which I understand improves performance as query plans can be reused.

Just looking for opinions on whether these methods will provide maximum performance or any issues with the above.

I am redeveloping an old ecommerce website which is currently written in C# ASP.NET 2.0.

I have the opportunity to develop using whatever language and technique I like.

Because this is a reasonably high volume website and has suffered performance issues I want to develop in the most efficient manner possible.

I am contemplating developing in ASP.NET WebPages (Razor). I also plan to use SqlClient to access the database. As I will be the sole developer and, although I appreciate that future changes are inevitable, I feel that having the UI and data access in the same page/script will be manageable for a site such as this with a small number of pages.

To minimise database trips (using SQL Server 2012), as database performance is the usual bottleneck in the current system, I am looking at creating stored procedures that return everything required for the current page in one query as multiple recordsets. For example the home page query might return the promotional banner image filenames and text, the new release products, the top selling products, etc. Then using SqlDataReader get the data from each recordset as needed and dispose of the connection and reader when the last recordset has been read. I don't plan to use any data transfer objects.

Just looking for opinions on whether these methods will provide maximum performance or any issues with the above.

I am redeveloping an old ecommerce website which is currently written in C# ASP.NET 2.0.

I have the opportunity to develop using whatever language and technique I like.

Because this is a reasonably high volume website and has suffered performance issues I want to develop in the most efficient manner possible.

I am contemplating developing in ASP.NET WebPages (Razor). I also plan to use SqlClient to access the database. As I will be the sole developer and, although I appreciate that future changes are inevitable, I feel that having the UI and data access in the same page/script will be manageable for a site such as this with a small number of pages.

To minimise database trips (using SQL Server 2012), as database performance is the usual bottleneck in the current system, I am looking at creating stored procedures that return everything required for the current page in one query as multiple recordsets. For example the home page query might return the promotional banner image filenames and text, the new release products, the top selling products, etc. Then using SqlDataReader get the data from each recordset as needed and dispose of the connection and reader when the last recordset has been read. I don't plan to use any data transfer objects.

I chose SqlClient over Webmatrix.Data as I can specify command type of stored procedure and specify parameter data types and lengths which I understand improves performance as query plans can be reused.

Just looking for opinions on whether these methods will provide maximum performance or any issues with the above.

Source Link
johna
  • 171
  • 1
  • 9
Loading