forked from PhiladelphiaGameLab/Lux
-
Notifications
You must be signed in to change notification settings - Fork 0
Database structures
Alpha59 edited this page Apr 14, 2015
·
2 revisions
Mongo is a document database that utilizes collections of documents.
{
_id: ObjectId("507f1f77bcf86cd799439011"),
// This is the area that developers are able to
// upsert via the **Asset Management API**, they are not given upsert access
// to the lux_info
,lux_info:{
// Information being stored by other APIs
}
}
{
_id: ObjectId("507f1f77bcf86cd799439011"),
values:{ // set by **User Management API**
email:
name:
phone_num:
ect.
},
profile_access_level: // set by **User Management API**
permissions:{
,assets:{
0: [] // creator
1: [] // owner
2: [] // editor
3: [] // viewer
4: [] // denied
},
social_network:{
chat:
inbox:
join:
// other things that can be restricted
}
},
suspension_status:{
user_level:{
bool:
reason:
time:
last_suspension:{
time:
reason:
}
},
system_level:{
bool:
reason:
time:
last_suspension:{
time:
reason:
}
},
},
loc:{
type: "Point"
, coordinates: [ 40, 5 ]
},
lux_info{
// stuff like the user's access_token
}
}
{
"_id" : ObjectId("54eb780f883e4ae10378ec6b"),
"user_id" : ObjectId("54ae0b30e43ca55e86db0eb3"),
"levels1" : [ ],
"levels2" : [
{
checkpoint_id: ObjectId("54ae0b30e43ca55e86db0eb3"),
metric1:
metric2:
metric3:
}
],
items: [ ],
info:{
// key->values
}
"time_created" : "2015-02-23T18:57:18.975Z",
"last_time_modified" : "2015-02-23T18:57:18.975Z"
}
{
// This portion is a direct copy of the document in the Asset's database
//
//
"publication_info" : {
"sender" : ObjectId("54ae0b30e43ca55e86db0eb3"),
"timestamp" : "0.97971300 1422309133",
"priority" : NumberLong(0),
"checked_by" : {
"python" : false,
"node" : false
}
}
}
{
"_id" : ObjectId("54b6bc6f98cac76ee552f548"),
subscription:{
collection:
,"query" : {
// A Query that can be used by the Asset's Database
},
}
"subscribers" : [
{
"id" : ObjectId("54b3f81898cac76ee552e27f")
// meta data
}
],
// more meta data
"timestamp" : "0.47691600 1421261964"
}
{
"_id" : ObjectId("54b6bc6f98cac76ee552f548"),
subscriber:{
"id" : ObjectId("54b3f81898cac76ee552e27f")
// meta data
}
sockets:{
websocket:{}
udp_socket:{}
ect:{}
}
}
{
"_id" : ObjectId("54b6bc6f98cac76ee552f548"),
// This portion of the document is dedicated to session info
// and can be accessed via a key->value pair system
lux_info:{
user_id:ObjectId("54b6bc6f98cac76ee552f548"), // this is optional for restoring session in the future
,expiration:
,session_id:
,cookie_id:
// other meta data
}
}
{
_id: ObjectId("507f1f77bcf86cd799439011"),
url: // url to access the document on S3
access_rights:
owner:
uploader:
time_uploaded:
file_info:{
type:
size:
name:
ect.
}
lux_info:{
// whatever meta data you want, just don't return it to the client
}
}
{
_id: ObjectId("507f1f77bcf86cd799439011"),
values:{ // set by **User Management API**
email:
name:
phone_num:
ect.
},
profile_access_level: // set by **User Management API**
permissions:{
,assets:{
owner: []
creator:[]
editor:[]
viewer:[]
denied:[]
}
social_network:{
chat:
inbox:
join:
// other things that can be restricted
}
},
suspension_status:{
user_level:{
bool:
reason:
time:
last_suspension:{
time:
reason:
}
},
system_level:{
bool:
reason:
time:
last_suspension:{
time:
reason:
}
},
},
{
loc:{
type: "Point"
, coordinates: [ 40, 5 ]
}
}
}
{
"_id" : ObjectId("54b6bc6f98cac76ee552f548"),
page_name:
section_name:
section_body:
lux_info:{
rendering_settings:{
engine:
parameters:
}
// whatever meta data you want, just don't return it to the client
}
}
{
"_id" : ObjectId("54b6bc6f98cac76ee552f548"),
page_name:
section_name:
section_handler:
section_short:
... // steal these areas from wordpress
section_full:
lux_info:{
// whatever meta data you want, just don't return it to the client
}
timestamp:
}
{
_id: ObjectId("507f1f77bcf86cd799439011"),
service:
base_url:
in_OAuth_url:{
key:value
access_token:ajdsnsadsa
client_id:adasfdskjab
// other key:value pairs for
},
in_Server_url:{
key:value
access_token:ajdsnsadsa
client_id:adasfdskjab
// other key:value pairs for
}
}
Neo4j is a powerful graph database that uses JSON documents on both of the nodes and edges
("31232132132131232312", // neo4j id
{
values:{
about:
age_range:
birthday:
emails:[]
ect.
}
,lux_info:{
// whatever metadata you want. Just don't return this to the client
}
}
)
("31232132132131232312", // neo4j id
{
values:{
}
,lux_info:{
// whatever metadata you want. Just don't return this to the client
}
}
)