Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Is wrong duplicate data in NoSQL (MongoDB)?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Claudio Holanda Jr.  
View profile  
 More options Nov 5 2012, 2:03 pm
From: "Claudio Holanda Jr." <claudi...@gmail.com>
Date: Mon, 5 Nov 2012 11:03:38 -0800 (PST)
Local: Mon, Nov 5 2012 2:03 pm
Subject: Is wrong duplicate data in NoSQL (MongoDB)?

Hi, after a goodbye kiss to MySQL and some dig into
MongoDB non-relational way, i've found some questions and couldn't find any
direct answer to that.

The mais question about non-relacional databases is, imagine
this environment:

I have three tables:

*Clients | Suppliers | Orders*

Each one have it's own info:
*Clients* have phone, name, etc per row,
*Suppliers* have adress, fax, etc,
*Orders *(pay attention, now comes the crux) instead, have both clients who
is ordering, and the Supplier who owns the product.

In MySQL i would simply create a column called "clientID" and "supplierID"
to refer to the respective datas.
*
*
*Now the question is:*
*
*
The table clients and Suppliers already have their infos, to transform this
database into non-relational, how the schema would be?
Should i made a refer the collection Order to the collection Suppliers and
Clients? Like:

{
    ...
    clientID: ObjectId("s7d5f075s87627d6f798"),
    supplierID: ObjectID("234k0873n34982m932")
    ...

}

I really can't think in a different way to make it, sorry about that,
its difficulty to change the way we see database after many years using
relational ones...

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Octavian Covalschi  
View profile  
 More options Nov 5 2012, 5:00 pm
From: Octavian Covalschi <octavian.covals...@gmail.com>
Date: Mon, 5 Nov 2012 15:59:38 -0600
Local: Mon, Nov 5 2012 4:59 pm
Subject: Re: [mongodb-user] Is wrong duplicate data in NoSQL (MongoDB)?

Well, you don't have to denormalize if you don't need to... you're fine
with what you did, especially when consuming that order one by one... the
only issue you may have is when displaying a list of orders and having just
these 2 ids will make your app to do more requests... so, in my opinion is
all about how are you going to use these orders...

For example, if you need to display client's and suplier's names in order
list, you could add those fields in order collection something like this:

{
    ...
    clientID: ObjectId("s7d5f075s87627d6f798"),
    supplierID: ObjectID("234k0873n34982m932")
    cname : "Jane Smith",
    sname: "Best Buy"
    ...

}

But I'd suggest to read more about mongodb and schema design. You can start
here http://www.mongodb.org/display/DOCS/Schema+Design

On Mon, Nov 5, 2012 at 1:03 PM, Claudio Holanda Jr. <claudi...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »