NoSQL database modeling (when converting from SQL database)

I have an SQL database that I want to convert to NoSQL (I am currently using RavenDB)

Here are my tables:

Trace:

ID (PK, bigint, not null)
DeploymentID (FK, int, not null)
AppCode (int, not null)

Deployment:

DeploymentID (PK, int, not null)
DeploymentVersion (varchar(10), not null)
DeploymentName (nvarchar(max), not null)

Application:

AppID (PK, int, not null)
AppName (nvarchar(max), not null)

I currently have these rows in my tables:

Trace:

ID: 1 , DeploymentID: 1, AppCode: 1
ID: 2 , DeploymentID: 1, AppCode: 2 
ID: 3 , DeploymentID: 1, AppCode: 3 
ID: 3 , DeploymentID: 2, AppCode: 1

Deployment:

DeploymentID: 1 , DeploymentVersion: 1.0, DeploymentName: "Test1"
DeploymentID: 2 , DeploymentVersion: 1.0, DeploymentName: "Test2"

Application:

AppID: 1 , AppName: "Test1"
AppID: 2 , AppName: "Test2"
AppID: 3 , AppName: "Test3"

My question is: HOW should I create my NoSQL document model?

Should it look like this:

trace/1
{
 "Deployment": [ { "DeploymentVersion": "1.0", "DeploymentName": "Test1" } ],
 "Application": "Test1"
}

trace/2
{
 "Deployment": [ { "DeploymentVersion": "1.0", "DeploymentName": "Test1" } ],
 "Application": "Test2"
}

trace/3
{
 "Deployment": [ { "DeploymentVersion": "1.0", "DeploymentName": "Test1" } ],
 "Application": "Test3"
}

trace/4    
{
 "Deployment": [ { "DeploymentVersion": "1.0", "DeploymentName": "Test2" } ],
 "Application": "Test1"
}

But what if Deployment 1 changes? Do I have to go through each document and change the data?

And when should links be used in NoSQL?

+5
source share
2 answers

, Raven, . , . , , .

, , , . , , , , , . , .

(?), , :) , , .

"" " ":

DO: . 20/80 , 20% UX 80% - / - - . , . , A) -, B)

DONT: "N + 1". , N N , , N . , # 3...

DO: ( UX) , . 3729 , , , . , . " 20 ". , () UX 20. DB get.

DO: . , , ( StackOverflow - ). , , . , . .

: . Twitter - : 99.99% ///. .

. NoSQL (, Cassandra)

+7

, . .

, , .

: , . , , , (, , ) (, SQL) (, ) . ...

SQL, , , , , , . , . , , , , ( ).

, , , .

+1

All Articles