473,385 Members | 1,453 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,385 software developers and data experts.

ObjectDataSource 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 3175

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 ObjectDataSource. You can populate the
ObjectDataSource 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.dash.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 #2
On Wed, 3 Jan 2007 17:11:21 -0500, "sloan" <sl***@ipass.netwrote:
>
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 ObjectDataSource. You can populate the
ObjectDataSource 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.dash.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
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...
0
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...
2
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" ...
10
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...
4
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"...
2
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...
14
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...
2
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...
5
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.