version 1.1, 2002/06/28 20:30:29
|
version 1.2, 2003/07/22 14:47:00
|
Line 1
|
Line 1
|
<html>
|
<html> |
<head>
|
|
<meta name=Title content="Session Three: lonsql (Gerd)">
|
<head> |
<meta http-equiv=Content-Type content="text/html; charset=macintosh">
|
|
<title>Session Three: lonsql (Gerd)</title>
|
<meta name=Title content="Session Three: lonsql (Gerd)"> |
<style><!--
|
|
.Section1
|
<meta http-equiv=Content-Type content="text/html; charset=macintosh"> |
{page:Section1;}
|
|
.Section2
|
<title>Session Three: lonsql (Gerd)</title> |
{page:Section2;}
|
|
-->
|
<style><!-- |
</style>
|
|
</head>
|
.Section1 |
<body bgcolor=#FFFFFF class="Normal" lang=EN-US>
|
|
<div class=Section1>
|
{page:Section1;} |
<h2>Session Three: lonsql (Gerd)</h2>
|
|
<p>This section describes issues associated with LON-CAPA and a SQL database.</p>
|
.Section2 |
<p>The SQL database in LON-CAPA is used for catalog searches against resource
|
|
metadata only. The authoritative version of the resource metadata is Ð as
|
{page:Section2;} |
discussed Ð an XML-file on the normal file system (same file name as resource
|
|
plus Ò.metaÓ). The SQL-database is a cache of these files, and can be reconstructed
|
--> |
from the XML files at any time.</p>
|
|
<p>The current database is implemented assuming a non-adjustable architecture
|
</style> |
involving these data fields (specific to each version of a resource). </p>
|
|
<p> 1.<span style='font:7.0pt "Times New Roman"'> </span>
|
</head> |
title </p>
|
|
<p> 2.<span style='font:7.0pt "Times New Roman"'> </span>
|
<body bgcolor=#FFFFFF class="Normal" lang=EN-US> |
author </p>
|
|
<p> 3.<span style='font:7.0pt "Times New Roman"'> </span>
|
<div class=Section1> |
subject </p>
|
|
<p> 4.<span style='font:7.0pt "Times New Roman"'> </span>
|
<h2>Session Three: lonsql (Gerd)</h2> |
notes </p>
|
|
<p> 5.<span style='font:7.0pt "Times New Roman"'> </span>
|
<p>This section describes issues associated with LON-CAPA and a SQL database.</p> |
abstract </p>
|
|
<p> 6.<span style='font:7.0pt "Times New Roman"'> </span>
|
<p>The SQL database in LON-CAPA is used for catalog searches against resource |
mime </p>
|
|
<p> 7.<span style='font:7.0pt "Times New Roman"'> </span>
|
metadata only. The authoritative version of the resource metadata is Ð as |
language </p>
|
|
<p> 8.<span style='font:7.0pt "Times New Roman"'> </span>
|
discussed Ð an XML-file on the normal file system (same file name as resource |
creationdate </p>
|
|
<p> 9.<span style='font:7.0pt "Times New Roman"'> </span>
|
plus Ò.metaÓ). The SQL-database is a cache of these files, and can be reconstructed |
lastrevisiondate </p>
|
|
<p> 10.<span style='font:7.0pt "Times New Roman"'> </span> owner </p>
|
from the XML files at any time.</p> |
<p> 11.<span style='font:7.0pt "Times New Roman"'> </span> copyright </p>
|
|
<h3><a name="_Toc421867145">Purpose within LON-CAPA</a></h3>
|
<p>The current database is implemented assuming a non-adjustable architecture |
<p>LON-CAPA is meant to distribute A LOT of educational content to A LOT of
|
|
people. It is ineffective to directly rely on contents within the ext2 filesystem
|
involving these data fields (specific to each version of a resource). </p> |
to be speedily scanned for on-the-fly searches of content descriptions. (Simply
|
|
put, it takes a cumbersome amount of time to open, read, analyze, and close
|
<p> 1.<span style='font:7.0pt "Times New Roman"'> </span> |
thousands of files.) </p>
|
|
<p>The solution is to hash-index various data fields that are descriptive of
|
title </p> |
the educational resources on a LON-CAPA server machine. Descriptive data fields
|
|
are referred to as "metadata". The question then arises as to how
|
<p> 2.<span style='font:7.0pt "Times New Roman"'> </span> |
this metadata is handled in terms of the rest of the LON-CAPA network without
|
|
burdening client and daemon processes. I now answer this question in the format
|
author </p> |
of Problem and Solution below. </p>
|
|
<p><b>PROBLEM SITUATION:</b><span style='font-weight:normal'> If Server A wants
|
<p> 3.<span style='font:7.0pt "Times New Roman"'> </span> |
data from Server B, Server A uses a lonc process to send a database command
|
|
to a Server B lond process.</span></p>
|
subject </p> |
<p> lonc= loncapa client process A-lonc=
|
|
a lonc process on Server A</p>
|
<p> 4.<span style='font:7.0pt "Times New Roman"'> </span> |
<p> lond= loncapa daemon process</p>
|
|
<p><span style='font-family:"Courier New"'>
|
notes </p> |
database command</span></p>
|
|
<p><span style='font-family:"Courier New"'> A-lonc --------TCP/IP---------------->
|
<p> 5.<span style='font:7.0pt "Times New Roman"'> </span> |
B-lond</span></p>
|
|
<p>The problem emerges that A-lonc and B-lond are kept waiting for the MySQL
|
abstract </p> |
server to "do its stuff", or in other words, perform the conceivably
|
|
sophisticated, data-intensive, time-sucking database transaction. By
|
<p> 6.<span style='font:7.0pt "Times New Roman"'> </span> |
tying up a lonc and lond process, this significantly cripples the capabilities
|
|
of LON-CAPA servers. </p>
|
mime </p> |
<p>While commercial databases have a variety of features that ATTEMPT to deal
|
|
with this, freeware databases are still experimenting and exploring with different
|
<p> 7.<span style='font:7.0pt "Times New Roman"'> </span> |
schemes with varying degrees of performance stability.</p>
|
|
<p><b>THE SOLUTION:</b><span style='font-weight:normal'> A separate daemon process
|
language </p> |
was created that B-lond works with to handle database requests. This
|
|
daemon process is called "lonsql".</span></p>
|
<p> 8.<span style='font:7.0pt "Times New Roman"'> </span> |
<p> So,</p>
|
|
<p><span style='font-family:"Courier New"'>
|
creationdate </p> |
database command</span></p>
|
|
<p><span style='font-family:"Courier New"'> A-lonc ---------TCP/IP----------------->
|
<p> 9.<span style='font:7.0pt "Times New Roman"'> </span> |
B-lond =====> B-lonsql</span></p>
|
|
<p><span style='font-family:"Courier New"'>
|
lastrevisiondate </p> |
<---------------------------------/
|
|
|</span></p>
|
<p> 10.<span style='font:7.0pt "Times New Roman"'> </span> owner </p> |
<p><span style='font-family:"Courier New"'>
|
|
"ok, I'll get back to you..."
|
<p> 11.<span style='font:7.0pt "Times New Roman"'> </span> copyright </p> |
|</span></p>
|
|
<p><span style='font-family:"Courier New"'>
|
<h3><a name="_Toc421867145">Purpose within LON-CAPA</a></h3> |
|</span></p>
|
|
<p><span style='font-family:"Courier New"'>
|
<p>LON-CAPA is meant to distribute A LOT of educational content to A LOT of |
/</span></p>
|
|
<p><span style='font-family:"Courier New"'> A-lond <-------------------------------
|
people. It is ineffective to directly rely on contents within the ext2 filesystem |
B-lonc <======</span></p>
|
|
<p><span style='font-family:"Courier New"'>
|
to be speedily scanned for on-the-fly searches of content descriptions. (Simply |
"Guess what? I have the result!"</span></p>
|
|
<p>Of course, depending on success or failure, the messages may vary, but the
|
put, it takes a cumbersome amount of time to open, read, analyze, and close |
principle remains the same where a separate pool of children processes (lonsql's)
|
|
handle the MySQL database manipulations.</p>
|
thousands of files.) </p> |
</div>
|
|
<br
|
<p>The solution is to hash-index various data fields that are descriptive of |
clear=ALL style='page-break-before:always;'>
|
|
<div class=Section2> </div>
|
the educational resources on a LON-CAPA server machine. Descriptive data fields |
</body>
|
|
</html>
|
are referred to as "metadata". The question then arises as to how |
|
|
|
this metadata is handled in terms of the rest of the LON-CAPA network without |
|
|
|
burdening client and daemon processes. I now answer this question in the format |
|
|
|
of Problem and Solution below. </p> |
|
|
|
<p><b>PROBLEM SITUATION:</b><span style='font-weight:normal'> If Server A wants |
|
|
|
data from Server B, Server A uses a lonc process to send a database command |
|
|
|
to a Server B lond process.</span></p> |
|
|
|
<p> lonc= loncapa client process A-lonc= |
|
|
|
a lonc process on Server A</p> |
|
|
|
<p> lond= loncapa daemon process</p> |
|
|
|
<p><span style='font-family:"Courier New"'> |
|
|
|
database command</span></p> |
|
|
|
<p><span style='font-family:"Courier New"'> A-lonc --------TCP/IP----------------> |
|
|
|
B-lond</span></p> |
|
|
|
<p>The problem emerges that A-lonc and B-lond are kept waiting for the MySQL |
|
|
|
server to "do its stuff", or in other words, perform the conceivably |
|
|
|
sophisticated, data-intensive, time-sucking database transaction. By |
|
|
|
tying up a lonc and lond process, this significantly cripples the capabilities |
|
|
|
of LON-CAPA servers. </p> |
|
|
|
<p>While commercial databases have a variety of features that ATTEMPT to deal |
|
|
|
with this, freeware databases are still experimenting and exploring with different |
|
|
|
schemes with varying degrees of performance stability.</p> |
|
|
|
<p><b>THE SOLUTION:</b><span style='font-weight:normal'> A separate daemon process |
|
|
|
was created that B-lond works with to handle database requests. This |
|
|
|
daemon process is called "lonsql".</span></p> |
|
|
|
<p> So,</p> |
|
|
|
<p><span style='font-family:"Courier New"'> |
|
|
|
database command</span></p> |
|
|
|
<p><span style='font-family:"Courier New"'> A-lonc ---------TCP/IP-----------------> |
|
|
|
B-lond =====> B-lonsql</span></p> |
|
|
|
<p><span style='font-family:"Courier New"'> |
|
|
|
<---------------------------------/ |
|
|
|
|</span></p> |
|
|
|
<p><span style='font-family:"Courier New"'> |
|
|
|
"ok, I'll get back to you..." |
|
|
|
|</span></p> |
|
|
|
<p><span style='font-family:"Courier New"'> |
|
|
|
|</span></p> |
|
|
|
<p><span style='font-family:"Courier New"'> |
|
|
|
/</span></p> |
|
|
|
<p><span style='font-family:"Courier New"'> A-lond <------------------------------- |
|
|
|
B-lonc <======</span></p> |
|
|
|
<p><span style='font-family:"Courier New"'> |
|
|
|
"Guess what? I have the result!"</span></p> |
|
|
|
<p>Of course, depending on success or failure, the messages may vary, but the |
|
|
|
principle remains the same where a separate pool of children processes (lonsql's) |
|
|
|
handle the MySQL database manipulations.</p> |
|
|
|
</div> |
|
|
|
<br |
|
|
|
clear=ALL style='page-break-before:always;'> |
|
|
|
<div class=Section2> </div> |
|
|
|
</body> |
|
|
|
</html> |
|
|