RavenDb Design Question

41 views
Skip to first unread message

Oguzhan Topcu

unread,
Jan 28, 2013, 1:29:25 AM1/28/13
to rav...@googlegroups.com
Hi,

I have simple question.

Let's say there are User and UserSkill aggreagate roots

public class UserSkill{
public string Id{get;set;}
public string Name {get;set;}
}

public class User{
public string Id{get;set;}
public string UserName {get;set;}
public string[] UserSkillIds{get;set;}
}

In this sceneraio supposed as we dont use denormalization. so we only put UserSkillIds to User.

My question is, if i replace UserSkillId with "userskill/" and only store integer value as int[] UserSkillIds, will it run faster on search queries on userskillids?

Thanks.

Oguzhan Topcu

unread,
Jan 28, 2013, 1:45:36 AM1/28/13
to rav...@googlegroups.com
by the way i want to ask another questions for ravendb,

1-) when i want to read a "single" field,

Is all document deserializing? or only field deserializing?

2-) when i want to write a single field is all document serializing over again? or single field serializing?

28 Ocak 2013 Pazartesi 08:29:25 UTC+2 tarihinde Oguzhan Topcu yazdı:

Oren Eini (Ayende Rahien)

unread,
Jan 28, 2013, 2:04:03 AM1/28/13
to ravendb
No, it will no, and I would recommend you would use the full ids.


--
You received this message because you are subscribed to the Google Groups "ravendb" group.
To unsubscribe from this group, send email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Oren Eini (Ayende Rahien)

unread,
Jan 28, 2013, 2:04:49 AM1/28/13
to ravendb
1) The whole document is deserialized if you actually hit the disk, you'll usually use the cache, instead.
2) Yes



--

Oguzhan Topcu

unread,
Jan 28, 2013, 2:39:18 AM1/28/13
to rav...@googlegroups.com
thanks for quick reply oren.

28 Ocak 2013 Pazartesi 09:04:49 UTC+2 tarihinde Oren Eini yazdı:

Chris Marisic

unread,
Jan 28, 2013, 1:04:58 PM1/28/13
to rav...@googlegroups.com
RavenDB is not RDBMS, stop thinking your identifiers are numbers. You are creating impedance mismatch with raven to use int ids, it will let you do it but you gain NOTHING and introduce subtle complexities into your model. The cost of using ints far exceeds the bits you will have flying around for a few more characters of text.
Reply all
Reply to author
Forward
0 new messages