![]() |
NoSQL: a non-SQL RDBMS
|
|
Database SchemaA Database Schema is a set of two files containing certain pieces of meta-information regarding the tables that comprise a NoSQL database. Such two files can take any names, but I will refer to them as the file schema and the field schema. Such schema files are just like any other NoSQL table, and can be manipulated with all the standard NoSQL commands and operators. In the explanations that follow I will make use of an hypotetical "school management" database. Our school has courses, and each course is followed by a certain number of students. We will therefore have three tables in the database:
Course Credit Room Day Time Teacher ------ ------ ----- ---------- ----- ------- chem-1 2 HA-18 2003-10-12 14:00 1 cs-101 3 DB-1 2003-10-11 10:00 2 econ-1 1 RB-8 2003-10-10 09:00 2 his-10 3 HA-18 2003-11-12 15:00 3
Student First Last Year Phone
------- ------- ---------- ---- -------
1 Thomas Jefferson 1 9876
2 George Washington 1 87654
3 Ronald Reagan 1 7654210
4 William Clinton 1 6542109
Course Student ------ ------- chem-1 1 chem-1 2 chem-1 3 cs-101 2 cs-101 4 econ-1 1 econ-1 2 econ-1 3 his-10 1
And here's what a file schema table for our "school management" database will look like, as displayed by the NoSQL
Table Path Edit -------------- ---------------- ---------------------- course ./course course_student ./course.student ./course.student-edits student ./student Such a schema shows a typical many-to-many database relation (one student can take many courses and one course involves many students). Here's what the table columns mean:
The second Database Schema file is the field schema. It contains the list of all column names that comprise a database, associated with the table names they belong to. The table names are those listed in the file schema previously explained. Here is the field schema table of our sample school management database: Column Table Flags ------- -------------- ----- Course course K Course course_student k Credit course Day course h First student Last student Phone student Room course Student student K Student course_student k Teacher course Time course h Year student
As you can see, fields that occur in multiple tables are listed multiple times, one time per table, and thus the fieldlist table key is the concatenation of
The Database Schema files can contain additional, application-specific columns beside the basic ones explained above; all such columns should have names that begin with one upper-case letter followed by lower-case letters.
The
Each
Trackbacks (2) | New trackback | Comments (0) | Print |