Click here to Skip to main content
15,894,825 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Unrelated data layer question. Pin
Mark Churchill28-Jan-08 20:11
Mark Churchill28-Jan-08 20:11 
GeneralRe: Unrelated data layer question. Pin
dojohansen11-Feb-08 8:10
dojohansen11-Feb-08 8:10 
GeneralRe: Unrelated data layer question. Pin
dojohansen11-Feb-08 8:04
dojohansen11-Feb-08 8:04 
GeneralDAL Design Question Pin
Waleed Eissa24-Jan-08 2:42
Waleed Eissa24-Jan-08 2:42 
GeneralRe: DAL Design Question Pin
Mark Churchill25-Jan-08 4:24
Mark Churchill25-Jan-08 4:24 
GeneralRe: DAL Design Question Pin
led mike25-Jan-08 4:40
led mike25-Jan-08 4:40 
GeneralRe: DAL Design Question Pin
Mark Churchill25-Jan-08 4:55
Mark Churchill25-Jan-08 4:55 
GeneralRe: DAL Design Question Pin
Waleed Eissa27-Jan-08 3:16
Waleed Eissa27-Jan-08 3:16 
Hi Mark, thanks a lot for your help, but would you mind explaining in more details?

Mark Churchill wrote:
You can send multiple queries and get multiple responses in one round trip.


Well, actually I doubt this could be of much benefit in my case as I'm creating a web application so my queries will always be based on user actions so there's no way to send multiple queries at the same time in my case.

Mark Churchill wrote:
The stored procedures aren't giving you any benefit here - its just creating noise.


Could you explain more please? I understand that you want me to go with one table so why not use sprocs in that case? We won't have the problem of caching query plans for every table as we're going to use only one table.

Mark Churchill wrote:
If I was designing this app i'd probably go with a Thread table inheriting Post, and giving Post a reference to the parent Thread (and possibly also the Post that was replied to - if you wanted to track that). Add your Thread table referencing Group as well for your groups. That lets you pull whole threads out off one index in one select, and Threads for each Group. Then I'd use Diamond Binding to handle my DAL...


I'm a little lost here, what exactly do you mean by inheritance here? I was going to use a ParentPostID INT NULL field in the ForumPosts table (see the CREATE TABLE section in my original post) which will refer to the thread, is that what you mean? I was also going to index that field so that I can find threads and replies fast if this what you mean by pulling out the threads.

So I was exactly going to index the PostID, GroupID, ParentPostID and PostDate fields (this is why I thought about separating the data into tables, one table for each group, as I thought I would have too many indexes, 4 indexes as you can see, and this could affect the inserts performance tremendously)

By the way, if one table will be used, the PostID will be by group not an identity field. I was only going to use identity fields if had a table for each group but not with a single table (this is done for scalability sake, to be easy to move data to other databases or even tables with the same structure in the same database), I'll have another table with the last id used for every group e.g.

CREATE TABLE LastUsedID
(
GroupID INT NOT NULL,
LastUsedID INT NOT NULL
)

Thanks again for all your help, waiting for your reply...


GeneralRe: DAL Design Question Pin
Mark Churchill27-Jan-08 5:19
Mark Churchill27-Jan-08 5:19 
GeneralRe: DAL Design Question Pin
Waleed Eissa1-Feb-08 18:58
Waleed Eissa1-Feb-08 18:58 
GeneralRe: DAL Design Question Pin
Ashfield30-Jan-08 4:24
Ashfield30-Jan-08 4:24 
QuestionBeta Testing? Develop Tech? Pin
Chrispie12323-Jan-08 19:00
Chrispie12323-Jan-08 19:00 
AnswerRe: Beta Testing? Develop Tech? Pin
Paul Conrad25-Jan-08 15:56
professionalPaul Conrad25-Jan-08 15:56 
GeneralVisual Studio 2005 collaboration Pin
Mike Nelson22-Jan-08 1:47
Mike Nelson22-Jan-08 1:47 
GeneralRe: Visual Studio 2005 collaboration Pin
led mike22-Jan-08 4:59
led mike22-Jan-08 4:59 
GeneralRe: Visual Studio 2005 collaboration Pin
Mike Nelson22-Jan-08 7:49
Mike Nelson22-Jan-08 7:49 
GeneralRe: Visual Studio 2005 collaboration Pin
led mike22-Jan-08 7:58
led mike22-Jan-08 7:58 
GeneralRe: Visual Studio 2005 collaboration Pin
Mike Nelson28-Jan-08 2:55
Mike Nelson28-Jan-08 2:55 
GeneralRe: Visual Studio 2005 collaboration Pin
led mike28-Jan-08 5:58
led mike28-Jan-08 5:58 
GeneralRe: Visual Studio 2005 collaboration Pin
Mike Nelson28-Jan-08 7:41
Mike Nelson28-Jan-08 7:41 
GeneralRe: Visual Studio 2005 collaboration Pin
led mike28-Jan-08 8:42
led mike28-Jan-08 8:42 
GeneralRe: Visual Studio 2005 collaboration Pin
Mike Nelson28-Jan-08 9:34
Mike Nelson28-Jan-08 9:34 
GeneralRe: Visual Studio 2005 collaboration Pin
led mike28-Jan-08 9:51
led mike28-Jan-08 9:51 
GeneralRe: Visual Studio 2005 collaboration Pin
Mike Nelson29-Jan-08 2:15
Mike Nelson29-Jan-08 2:15 
GeneralFree tool for UML Pin
mhmo21-Jan-08 2:42
mhmo21-Jan-08 2:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.