0
HBASE版本:0.94.10HBASE嵌套數據模型
初級保健系統的NOSQL設計數據模型的新手。我已經規範化了樣本DB關係模型,例如HBASE-0.94.0
Patient table:
============
1) Patient_id - PK
2) Added_BY
3) Gender
4) Usual_GP
,
Patient Name table: [One to many relationship with patient [One] Name[Many]]
1) Name_id
2) Patient_id - FK
3) Name_type
4) First name
5) Last Name
6) Middle name
,
Patient address table: [One to many relationship with patient [One] address[Many]]
1) Address_id
2) Patient_id - FK
3) Address_type
4) Line1
5) Line2
6) Line 3
7) Line 4
8) Line 5
,
Patient Phone table: [One to many relationship with patient [One] Phone[Many]]
1) Phone_id
2) Patient_id - FK
3) PhoneType
4) Phoneno
5) ext
,
Medication and other details
1)Entry_id
2)Patient_id - FK [One to many relationship with patient [One] Medication[Many]]
3)Start_date
4)End_date
5)Code
6)Medicine description
7)Dosage details
8) Number of authorised
9) Number issued
對於上面的Normalized數據模型,我在下面創建了示例NoSQL數據模型,我希望數據模型適用於Document base NOSQL。需要將以下數據模型轉換爲基於HBASE列的數據模型,請幫助我。
Patient :{Patient_id:22,
Added_by:Doctor1,
Gender:Male,
UsualGP: Doctor2,
PatName:[
{NameType:Usual, FirstName:Hari, LastName:prasad,Middlename:' '},
{NameType:Other, FirstName:John,LastName:prasad,Middlename:kenndy}
]
PatAddr:[
{AddType:Usual, Line1:2, Line2:Harrington road, Line3: near central, Line4:Newyork,Line5:NY008},
{AddType:Tmp, Line1:2, Line2:Mylapore road, Line3: near Zoo, Line4:WashingtonDC,Line5:WA00098}
]
PatPhone:[
{PhoneType:Usual, Phoneno:4453443344, ext:099},
{PhoneType:Tmp, Phoneno:9198332342343, ext:}
]
PatMedication:[
{MedStardate:'01/01/2013', MedEndDate:'', Code:'Snomode', MedDesc:'Paracetmol', DosDet:'Take 2 daily', Noauth: 5, Issue: 3},
{MedStardate:'01/05/2013', MedEndDate:'01/05/2013', Code:'readcode', MedDesc:'Avil', DosDet:'Take 1 daily', Noauth: 3, Issue: 1},
{MedStardate:'01/10/2013', MedEndDate:'24/10/13', Code:'readcode', MedDesc:'Metacin', DosDet:'Take 2 daily', Noauth: 5, Issue: 3},
]
}
歡迎來到SO,請先閱讀本文:http://stackoverflow.com/questions/how-to-ask向我們展示您的嘗試。 – Tafari
爲什麼選擇HBase?它是用於非關係數據庫的! – Kris