File:  [LON-CAPA] / doc / gutshtml / SessionThre2.html
Revision 1.2: download - view: text, annotated - select for diffs
Tue Jul 22 14:47:00 2003 UTC (20 years, 9 months ago) by bowersj2
Branches: MAIN
CVS tags: version_2_9_X, version_2_9_99_0, version_2_9_1, version_2_9_0, version_2_8_X, version_2_8_99_1, version_2_8_99_0, version_2_8_2, version_2_8_1, version_2_8_0, version_2_7_X, version_2_7_99_1, version_2_7_99_0, version_2_7_1, version_2_7_0, version_2_6_X, version_2_6_99_1, version_2_6_99_0, version_2_6_3, version_2_6_2, version_2_6_1, version_2_6_0, version_2_5_X, version_2_5_99_1, version_2_5_99_0, version_2_5_2, version_2_5_1, version_2_5_0, version_2_4_X, version_2_4_99_0, version_2_4_2, version_2_4_1, version_2_4_0, version_2_3_X, version_2_3_99_0, version_2_3_2, version_2_3_1, version_2_3_0, version_2_2_X, version_2_2_99_1, version_2_2_99_0, version_2_2_2, version_2_2_1, version_2_2_0, version_2_1_X, version_2_1_99_3, version_2_1_99_2, version_2_1_99_1, version_2_1_99_0, version_2_1_3, version_2_1_2, version_2_1_1, version_2_1_0, version_2_12_X, version_2_11_X, version_2_11_4_uiuc, version_2_11_4_msu, version_2_11_4, version_2_11_3_uiuc, version_2_11_3_msu, version_2_11_3, version_2_11_2_uiuc, version_2_11_2_msu, version_2_11_2_educog, version_2_11_2, version_2_11_1, version_2_11_0_RC3, version_2_11_0_RC2, version_2_11_0_RC1, version_2_11_0, version_2_10_X, version_2_10_1, version_2_10_0_RC2, version_2_10_0_RC1, version_2_10_0, version_2_0_X, version_2_0_99_1, version_2_0_2, version_2_0_1, version_2_0_0, version_1_99_3, version_1_99_2, version_1_99_1_tmcc, version_1_99_1, version_1_99_0_tmcc, version_1_99_0, version_1_3_X, version_1_3_3, version_1_3_2, version_1_3_1, version_1_3_0, version_1_2_X, version_1_2_99_1, version_1_2_99_0, version_1_2_1, version_1_2_0, version_1_1_X, version_1_1_99_5, version_1_1_99_4, version_1_1_99_3, version_1_1_99_2, version_1_1_99_1, version_1_1_99_0, version_1_1_3, version_1_1_2, version_1_1_1, version_1_1_0, version_1_0_99_3, version_1_0_99_2, version_1_0_99_1, version_1_0_99, version_1_0_3, version_1_0_2, version_1_0_1, version_1_0_0, version_0_99_5, version_0_99_4, loncapaMITrelate_1, language_hyphenation_merge, language_hyphenation, bz6209-base, bz6209, HEAD, GCI_3, GCI_2, GCI_1, BZ4492-merge, BZ4492-feature_horizontal_radioresponse, BZ4492-feature_Support_horizontal_radioresponse, BZ4492-Support_horizontal_radioresponse
Convert GUTs HTML to PROPER line endings.

    1: <html>
    2: 
    3: <head>
    4: 
    5: <meta name=Title content="Session Three: lonsql (Gerd)">
    6: 
    7: <meta http-equiv=Content-Type content="text/html; charset=macintosh">
    8: 
    9: <title>Session Three: lonsql (Gerd)</title>
   10: 
   11: <style><!--
   12: 
   13: .Section1
   14: 
   15: 	{page:Section1;}
   16: 
   17: .Section2
   18: 
   19: 	{page:Section2;}
   20: 
   21: -->
   22: 
   23: </style>
   24: 
   25: </head>
   26: 
   27: <body bgcolor=#FFFFFF class="Normal" lang=EN-US>
   28: 
   29: <div class=Section1> 
   30: 
   31:   <h2>Session Three: lonsql (Gerd)</h2>
   32: 
   33:   <p>This section describes issues associated with LON-CAPA and a SQL database.</p>
   34: 
   35:   <p>The SQL database in LON-CAPA is used for catalog searches against resource 
   36: 
   37:     metadata only. The authoritative version of the resource metadata is Ð as 
   38: 
   39:     discussed Ð an XML-file on the normal file system (same file name as resource 
   40: 
   41:     plus Ò.metaÓ). The SQL-database is a cache of these files, and can be reconstructed 
   42: 
   43:     from the XML files at any time.</p>
   44: 
   45:   <p>The current database is implemented assuming a non-adjustable architecture 
   46: 
   47:     involving these data fields (specific to each version of a resource). </p>
   48: 
   49:   <p> 1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
   50: 
   51:     title </p>
   52: 
   53:   <p> 2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
   54: 
   55:     author </p>
   56: 
   57:   <p> 3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
   58: 
   59:     subject </p>
   60: 
   61:   <p> 4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
   62: 
   63:     notes </p>
   64: 
   65:   <p> 5.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
   66: 
   67:     abstract </p>
   68: 
   69:   <p> 6.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
   70: 
   71:     mime </p>
   72: 
   73:   <p> 7.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
   74: 
   75:     language </p>
   76: 
   77:   <p> 8.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
   78: 
   79:     creationdate </p>
   80: 
   81:   <p> 9.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
   82: 
   83:     lastrevisiondate </p>
   84: 
   85:   <p> 10.<span style='font:7.0pt "Times New Roman"'>&nbsp; </span> owner </p>
   86: 
   87:   <p> 11.<span style='font:7.0pt "Times New Roman"'>&nbsp; </span> copyright </p>
   88: 
   89:   <h3><a name="_Toc421867145">Purpose within LON-CAPA</a></h3>
   90: 
   91:   <p>LON-CAPA is meant to distribute A LOT of educational content to A LOT of 
   92: 
   93:     people. It is ineffective to directly rely on contents within the ext2 filesystem 
   94: 
   95:     to be speedily scanned for on-the-fly searches of content descriptions. (Simply 
   96: 
   97:     put, it takes a cumbersome amount of time to open, read, analyze, and close 
   98: 
   99:     thousands of files.) </p>
  100: 
  101:   <p>The solution is to hash-index various data fields that are descriptive of 
  102: 
  103:     the educational resources on a LON-CAPA server machine. Descriptive data fields 
  104: 
  105:     are referred to as &quot;metadata&quot;. The question then arises as to how 
  106: 
  107:     this metadata is handled in terms of the rest of the LON-CAPA network without 
  108: 
  109:     burdening client and daemon processes. I now answer this question in the format 
  110: 
  111:     of Problem and Solution below. </p>
  112: 
  113:   <p><b>PROBLEM SITUATION:</b><span style='font-weight:normal'> If Server A wants 
  114: 
  115:     data from Server B, Server A uses a lonc process to send a database command 
  116: 
  117:     to a Server B lond process.</span></p>
  118: 
  119:   <p>&nbsp;&nbsp;&nbsp; lonc= loncapa client process&nbsp;&nbsp;&nbsp; A-lonc= 
  120: 
  121:     a lonc process on Server A</p>
  122: 
  123:   <p>&nbsp;&nbsp;&nbsp; lond= loncapa daemon process</p>
  124: 
  125:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  126: 
  127:     database command</span></p>
  128: 
  129:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; A-lonc&nbsp; --------TCP/IP----------------&gt; 
  130: 
  131:     B-lond</span></p>
  132: 
  133:   <p>The problem emerges that A-lonc and B-lond are kept waiting for the MySQL 
  134: 
  135:     server to &quot;do its stuff&quot;, or in other words, perform the conceivably 
  136: 
  137:     sophisticated, data-intensive, time-sucking database transaction.&nbsp; By 
  138: 
  139:     tying up a lonc and lond process, this significantly cripples the capabilities 
  140: 
  141:     of LON-CAPA servers. </p>
  142: 
  143:   <p>While commercial databases have a variety of features that ATTEMPT to deal 
  144: 
  145:     with this, freeware databases are still experimenting and exploring with different 
  146: 
  147:     schemes with varying degrees of performance stability.</p>
  148: 
  149:   <p><b>THE SOLUTION:</b><span style='font-weight:normal'> A separate daemon process 
  150: 
  151:     was created that B-lond works with to handle database requests.&nbsp; This 
  152: 
  153:     daemon process is called &quot;lonsql&quot;.</span></p>
  154: 
  155:   <p>&nbsp; So,</p>
  156: 
  157:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  158: 
  159:     database command</span></p>
  160: 
  161:   <p><span style='font-family:"Courier New"'>&nbsp; A-lonc&nbsp; ---------TCP/IP-----------------&gt; 
  162: 
  163:     B-lond =====&gt; B-lonsql</span></p>
  164: 
  165:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  166: 
  167:     &lt;---------------------------------/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  168: 
  169:     |</span></p>
  170: 
  171:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  172: 
  173:     &quot;ok, I'll get back to you...&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  174: 
  175:     |</span></p>
  176: 
  177:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  178: 
  179:     |</span></p>
  180: 
  181:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  182: 
  183:     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/</span></p>
  184: 
  185:   <p><span style='font-family:"Courier New"'>&nbsp; A-lond&nbsp; &lt;-------------------------------&nbsp; 
  186: 
  187:     B-lonc&nbsp;&nbsp; &lt;======</span></p>
  188: 
  189:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  190: 
  191:     &quot;Guess what? I have the result!&quot;</span></p>
  192: 
  193:   <p>Of course, depending on success or failure, the messages may vary, but the 
  194: 
  195:     principle remains the same where a separate pool of children processes (lonsql's) 
  196: 
  197:     handle the MySQL database manipulations.</p>
  198: 
  199: </div>
  200: 
  201: <br
  202: 
  203: clear=ALL style='page-break-before:always;'>
  204: 
  205: <div class=Section2> </div>
  206: 
  207: </body>
  208: 
  209: </html>
  210: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>