Annotation of doc/gutshtml/SessionThre2.html, revision 1.2

1.2     ! bowersj2    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>