1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>NoSQL: Data access control</TITLE>
<LINK HREF="NoSQL-8.html" REL=next>
<LINK HREF="NoSQL-6.html" REL=previous>
<LINK HREF="NoSQL.html#toc7" REL=contents>
</HEAD>
<BODY BGCOLOR="#fff0e0">
<A HREF="NoSQL-8.html">Next</A>
<A HREF="NoSQL-6.html">Previous</A>
<A HREF="NoSQL.html#toc7">Contents</A>
<HR>
<H2><A NAME="sec-dataaccess"></A> <A NAME="s7">7. Data access control</A> </H2>
<H2><A NAME="ss7.1">7.1 General</A>
</H2>
<P>Since tables are regular UNIX files, I have so far
found no need to implement, and have the associated
overhead of, general data access controls in NoSQL.
Setting the UNIX permissions on files or directory has
proven very useful and effective. This is another example
of how the NoSQL system works "with" UNIX, not in addition
to it, e.g. not duplicating UNIX functions.
<P>The Revision Control System (RCS) is one of the best
configuration management tools available, it can be used
for version control of many types of files, including
tables. Most NoSQL operators can utilize tables
that are under RCS control by using a command like:
<P>
<BLOCKQUOTE><CODE>
<PRE>
co -p table | row ... | column ... | justify
</PRE>
</CODE></BLOCKQUOTE>
<P>This checks out a table, sends it to
'row', then to 'column', and finally prints the data
with 'justify'. In general, any series of commands
necessary can be constructed to do a given task even
if the tables are checked into RCS.
<P>
<H2><A NAME="ss7.2">7.2 Write concurrency control</A>
</H2>
<P>When the 'edittable' operator is used (which modifies a table
in place)
there could be a possibility of silmultaneous writing of a
table by multiple users. That is, if two or more users,
on the same computer or perhaps on different computers on a
network, attempted to modify a given table with
'edittable' at the same time, the table could
become corrupted. To prevent this, write concurrency
control is provided by the use of a lockfile, and is in
effect whenever a user runs 'edittable' against the table.
<P>The name of the lockfile is the name of the table
being modified, with a suffix of ".lock". For example a
table named "main.rdb" would have a lockfile named
"main.rdb.lock". The lockfile is placed in the same
directory as the table itself and is removed
after the modification process is complete, even if the
operation is aborted with an INTERRUPT signal (CONTROL-C
or <DEL>).
When an attempt to use
this utility is made and there is already a valid
lockfile associated with the referenced table an error
message is produced and the utility exits.
<P>
<HR>
<A HREF="NoSQL-8.html">Next</A>
<A HREF="NoSQL-6.html">Previous</A>
<A HREF="NoSQL.html#toc7">Contents</A>
</BODY>
</HTML>
|