473,756 Members | 4,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ObjectDataSourc e and Efficient 3-tier Design

I'm in need of some design suggestions!

We have a fairly large DB with thousands of users accessing data
throughout the day. I have been given the task of restructuring a
core part of the web application. It will be a design example for the
rest of the site and I really want to get it right the first time!

Basically we need to present a lot of data to the user. On a single
page, we summarize about 5000 rows (grouped so they don't look at more
than about 200 at a time). I'm struggling with a good 3-tier design
and the performance of accessing so much data.

In the main table, call it A, we have about 10 FKs per row, and we
need data from about 7 other tables using those FKs. Table A has a
lot of columns (50 or so). Of the 5000 rows in A, it probably joins
to 4500 rows in B, which also has 50 or so columns. These two tables
are most of the data we need to present. Table A is updated
frequently, Table B is not.

So, how would you structure the DAL and BLL objects to be efficient?
I would really like to cache the data, but I'm worried that I would
run out of memory on the web servers. I would also prefer to keep the
DAL close to the structure of the DB, instead of cooking the results
with several joins. But, if that doesn't make sense, I'd love to hear
suggestions.

How would you efficiently load these objects? I don't want it to be
too chatty creating the objects, so it seems like I need to
instantiate whole blocks of objects.

Thanks!

Jami

Jan 3 '07 #1
2 3191

The quickest way to get the data from the db, would be to use an IDataReader
in a DAL object.
The DAL object can return this IDataReader to the Biz layer.
You can loop on the IDataReader, and create mini objects, and then add them
to an <Listgeneric collection.
Is your data "read only", ...

And ....
5000 rows in A, it probably joins
to 4500 rows in B,
for every row A, do the B rows always go back to 1 distinct A, or can a B be
associated with more than one A?
If yes, then ...you'll have different options vs if no.
Also see:
6/5/2006
Custom Objects and Tiered Development II // 2.0
http://sholliday.spaces.live.com/blog/
...

Are your summary rows something the database can do? (SUM AVG, etc)
or do you need to load the data.
...

Here are some hints:

With asp.net 2.0, You can cache a search result. I usually cached a strong
dataset here.
The gridview binds to a ObjectDataSourc e. You can populate the
ObjectDataSourc e with the cached copy of the data.

For stressed out web servers, look at the WeakReference object.
Post some more info about your need.........


"Jami Bradley" <jb******@go.da sh.asi.comwrote in message
news:fs******** *************** *********@4ax.c om...
I'm in need of some design suggestions!

We have a fairly large DB with thousands of users accessing data
throughout the day. I have been given the task of restructuring a
core part of the web application. It will be a design example for the
rest of the site and I really want to get it right the first time!

Basically we need to present a lot of data to the user. On a single
page, we summarize about 5000 rows (grouped so they don't look at more
than about 200 at a time). I'm struggling with a good 3-tier design
and the performance of accessing so much data.

In the main table, call it A, we have about 10 FKs per row, and we
need data from about 7 other tables using those FKs. Table A has a
lot of columns (50 or so). Of the 5000 rows in A, it probably joins
to 4500 rows in B, which also has 50 or so columns. These two tables
are most of the data we need to present. Table A is updated
frequently, Table B is not.

So, how would you structure the DAL and BLL objects to be efficient?
I would really like to cache the data, but I'm worried that I would
run out of memory on the web servers. I would also prefer to keep the
DAL close to the structure of the DB, instead of cooking the results
with several joins. But, if that doesn't make sense, I'd love to hear
suggestions.

How would you efficiently load these objects? I don't want it to be
too chatty creating the objects, so it seems like I need to
instantiate whole blocks of objects.

Thanks!

Jami

Jan 3 '07 #2
On Wed, 3 Jan 2007 17:11:21 -0500, "sloan" <sl***@ipass.ne twrote:
>
The quickest way to get the data from the db, would be to use an IDataReader
in a DAL object.
The DAL object can return this IDataReader to the Biz layer.
You can loop on the IDataReader, and create mini objects, and then add them
to an <Listgeneric collection.
Is your data "read only", ...
A is read/write (although with 20M rows and 5000 updates a day, it is
mostly read only!)

B is almost read/only (350K rows, probably 20 updates/day).

The data in A is user specific, the data in B is shared among many
users. I would like to keep the data in B shared at the application
level if I can fit it!

We have quite a few 'constant' tables that would be purely read only.
>
And ....
5000 rows in A, it probably joins
>to 4500 rows in B,

for every row A, do the B rows always go back to 1 distinct A, or can a B be
associated with more than one A?
If yes, then ...you'll have different options vs if no.
A always references exactly one B (FK is in A, non-null)
>

Also see:
6/5/2006
Custom Objects and Tiered Development II // 2.0
http://sholliday.spaces.live.com/blog/
..

Are your summary rows something the database can do? (SUM AVG, etc)
or do you need to load the data.
I think the summary can and should be done by the DB (count and group
by). I've toyed with the idea of preloading all 5000 rows for
performance, but I think it will be better to be lazy to avoid
unnecessary loads.
>

..

Here are some hints:

With asp.net 2.0, You can cache a search result. I usually cached a strong
dataset here.
The gridview binds to a ObjectDataSourc e. You can populate the
ObjectDataSour ce with the cached copy of the data.

For stressed out web servers, look at the WeakReference object.
Our web servers are underutilized at the moment. When we start
caching more of the data, though, weak references might be an
interesting option.

Right now, our DB is stressed because of the repeated queries for
data. That I hope to resolve with the web server caching of the data.
>

Post some more info about your need.........
I've been reading most of the day and I'm putting together a prototype
now. The basic model is similar to the PetShop DAL/BLL/Model:

Simple wrapper classes for the data
DAL to create those wrappers
BLL will proxy the data for now and provide methods to insert/update
the data properly (we have extensive business logic).

The data is presented at three levels:
Summary info (I'll make a specific DAL/BLL for this)
'Top level information' This is the common information presented for
a row of data from A (including all of it's subordinate tables)
'Detailed information' This is shown when the user explicitly expands
a single row.

The user would typically show the summary, expand one to show approx.
200 rows, then show details of a few of the 200. This routine would
be repeated over their session, usually within the same summary.

Right now, I'm leaning towards segmenting the data and lazy loading
the detailed portion. Several important parts of the summary
information are kept in table B, so I may have to preload the B rows
even to get the top level information. It is tempting to just stick
it in the DAL for A, but I think that will be a problem later on when
I develop the BLL for B.

Jami
>

"Jami Bradley" <jb******@go.da sh.asi.comwrote in message
news:fs******* *************** **********@4ax. com...
>I'm in need of some design suggestions!

We have a fairly large DB with thousands of users accessing data
throughout the day. I have been given the task of restructuring a
core part of the web application. It will be a design example for the
rest of the site and I really want to get it right the first time!

Basically we need to present a lot of data to the user. On a single
page, we summarize about 5000 rows (grouped so they don't look at more
than about 200 at a time). I'm struggling with a good 3-tier design
and the performance of accessing so much data.

In the main table, call it A, we have about 10 FKs per row, and we
need data from about 7 other tables using those FKs. Table A has a
lot of columns (50 or so). Of the 5000 rows in A, it probably joins
to 4500 rows in B, which also has 50 or so columns. These two tables
are most of the data we need to present. Table A is updated
frequently, Table B is not.

So, how would you structure the DAL and BLL objects to be efficient?
I would really like to cache the data, but I'm worried that I would
run out of memory on the web servers. I would also prefer to keep the
DAL close to the structure of the DB, instead of cooking the results
with several joins. But, if that doesn't make sense, I'd love to hear
suggestions.

How would you efficiently load these objects? I don't want it to be
too chatty creating the objects, so it seems like I need to
instantiate whole blocks of objects.

Thanks!

Jami
Jan 3 '07 #3

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

Similar topics

3
2652
by: avezina | last post by:
We would like to use those new cool features of Asp.Net 2.0 like the ObjectDataSource in our project. I tried few basics examples and its work well. Let's say I have a page that displays a detail of a product. On my page I have a product name and a short description. So I declare an ObjectDataSource in my page <asp:ObjectDataSource ID="productData" runat="server" SelectMethod="GetProduct"
0
1098
by: osh | last post by:
Fellow ASP.net'ers... I am working on a solution that needs to perform a search (search criteria can be as little as 1 and as high as 20 fields) through an average of 25,000 records and return results in a GridView. I only want to return 150 results total, and page through them 10 results at a time - but I also need to grab a count from the MSSQL server as to how many TOTAL records were found. So maybe 4,500 records were found that met...
2
6269
by: J055 | last post by:
Hi I've implemented caching for my ObjectDataSource. <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" EnableCaching="True" CacheDuration="10" CacheExpirationPolicy="Sliding" SelectMethod="GetUsers" TypeName="BizObject"></asp:ObjectDataSource> This works, however I need to explicitly clear/remove the cache when I
10
4577
by: J055 | last post by:
Hi I've been trying out SqlCacheDependency using the ObjectDataSource and SQL Server 2005. It all works quite well with the minimum of configuration, e.g. <asp:ObjectDataSource ID="odsAccounts" runat="server" ... EnableCaching="true" SqlCacheDependency="CommandNotification"> .... </asp:ObjectDataSource>
4
12915
by: J055 | last post by:
Hi I thought I was trying to do something very simple but I'm have a lot of trouble trying to do the following. <asp:FormView ID="fvGroups" runat="server" DataKeyNames="GroupID" DataSourceID="odsGroups" DefaultMode="Insert" Visible="false" OnItemCommand="fvGroups_ItemCommand"> <InsertItemTemplate> <asp:DropDownList ID="ddlEditMode" runat="server"
2
6785
by: Olivier Matrot | last post by:
Hello, I'm using a gridview with objectdatasource and custom objects collections SELECT/INSERT/UPDATE/DELETE methods are using custom objects as parameters. This is working fine. But I have a problem with the object that is passed back to the update method. It contains some of the properties of the original object sent during the SELECT method, but is missing others ! How can I ensure that all original object properties not modified are...
14
14657
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control so I get the ObjectDataSource. No problem ..... ObjectDataSource src = .... //is ok i have it
2
3924
by: J055 | last post by:
Hi I have a method with the following signature: public bool UpdateSetAccounts(int items) { } How do I pass a collection of selected values in a ListBox to this ObjectDataSource UpdateMethod? I can pass the ListItemCollection in a ControlParameter, e.g.
5
4372
by: Norbert Ruessmann | last post by:
Hello group, I have a business object, which contains Orders. Each Order has a list of OrderItems. Orders are collected in a list List<Order>, OrderItems for each order are of type v<OrderItems>. From a database view this is a one to many relation. I define two GridView controls: one for displaying/editing the Orders, another one for displaying/editing the OrderItems. I also define two datasource controls (ObjectDataSource) for each...
1
5413
by: Max2006 | last post by:
Hi, I am truing to find a pattern for my Business Logic Layer to be able to work fine win ObjectDataSource's Update method. The challenge is ObjectDataSource is not able to work with an update method that accepts a strongly typed data table as parameters. We have to have an update method with all data table's columns as its parameter. Like what we have here: http://asp.net/learn/data-access/tutorial-16-cs.aspx
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10040
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9873
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9846
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.