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

1.1     ! www         1: <html>
        !             2: <head>
        !             3: <meta name=Title content="Session Three: lonsql (Gerd)">
        !             4: <meta http-equiv=Content-Type content="text/html; charset=macintosh">
        !             5: <title>Session Three: lonsql (Gerd)</title>
        !             6: <style><!--
        !             7: .Section1
        !             8: 	{page:Section1;}
        !             9: .Section2
        !            10: 	{page:Section2;}
        !            11: -->
        !            12: </style>
        !            13: </head>
        !            14: <body bgcolor=#FFFFFF class="Normal" lang=EN-US>
        !            15: <div class=Section1> 
        !            16:   <h2>Session Three: lonsql (Gerd)</h2>
        !            17:   <p>This section describes issues associated with LON-CAPA and a SQL database.</p>
        !            18:   <p>The SQL database in LON-CAPA is used for catalog searches against resource 
        !            19:     metadata only. The authoritative version of the resource metadata is Ð as 
        !            20:     discussed Ð an XML-file on the normal file system (same file name as resource 
        !            21:     plus Ò.metaÓ). The SQL-database is a cache of these files, and can be reconstructed 
        !            22:     from the XML files at any time.</p>
        !            23:   <p>The current database is implemented assuming a non-adjustable architecture 
        !            24:     involving these data fields (specific to each version of a resource). </p>
        !            25:   <p> 1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
        !            26:     title </p>
        !            27:   <p> 2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
        !            28:     author </p>
        !            29:   <p> 3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
        !            30:     subject </p>
        !            31:   <p> 4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
        !            32:     notes </p>
        !            33:   <p> 5.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
        !            34:     abstract </p>
        !            35:   <p> 6.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
        !            36:     mime </p>
        !            37:   <p> 7.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
        !            38:     language </p>
        !            39:   <p> 8.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
        !            40:     creationdate </p>
        !            41:   <p> 9.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span> 
        !            42:     lastrevisiondate </p>
        !            43:   <p> 10.<span style='font:7.0pt "Times New Roman"'>&nbsp; </span> owner </p>
        !            44:   <p> 11.<span style='font:7.0pt "Times New Roman"'>&nbsp; </span> copyright </p>
        !            45:   <h3><a name="_Toc421867145">Purpose within LON-CAPA</a></h3>
        !            46:   <p>LON-CAPA is meant to distribute A LOT of educational content to A LOT of 
        !            47:     people. It is ineffective to directly rely on contents within the ext2 filesystem 
        !            48:     to be speedily scanned for on-the-fly searches of content descriptions. (Simply 
        !            49:     put, it takes a cumbersome amount of time to open, read, analyze, and close 
        !            50:     thousands of files.) </p>
        !            51:   <p>The solution is to hash-index various data fields that are descriptive of 
        !            52:     the educational resources on a LON-CAPA server machine. Descriptive data fields 
        !            53:     are referred to as &quot;metadata&quot;. The question then arises as to how 
        !            54:     this metadata is handled in terms of the rest of the LON-CAPA network without 
        !            55:     burdening client and daemon processes. I now answer this question in the format 
        !            56:     of Problem and Solution below. </p>
        !            57:   <p><b>PROBLEM SITUATION:</b><span style='font-weight:normal'> If Server A wants 
        !            58:     data from Server B, Server A uses a lonc process to send a database command 
        !            59:     to a Server B lond process.</span></p>
        !            60:   <p>&nbsp;&nbsp;&nbsp; lonc= loncapa client process&nbsp;&nbsp;&nbsp; A-lonc= 
        !            61:     a lonc process on Server A</p>
        !            62:   <p>&nbsp;&nbsp;&nbsp; lond= loncapa daemon process</p>
        !            63:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        !            64:     database command</span></p>
        !            65:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; A-lonc&nbsp; --------TCP/IP----------------&gt; 
        !            66:     B-lond</span></p>
        !            67:   <p>The problem emerges that A-lonc and B-lond are kept waiting for the MySQL 
        !            68:     server to &quot;do its stuff&quot;, or in other words, perform the conceivably 
        !            69:     sophisticated, data-intensive, time-sucking database transaction.&nbsp; By 
        !            70:     tying up a lonc and lond process, this significantly cripples the capabilities 
        !            71:     of LON-CAPA servers. </p>
        !            72:   <p>While commercial databases have a variety of features that ATTEMPT to deal 
        !            73:     with this, freeware databases are still experimenting and exploring with different 
        !            74:     schemes with varying degrees of performance stability.</p>
        !            75:   <p><b>THE SOLUTION:</b><span style='font-weight:normal'> A separate daemon process 
        !            76:     was created that B-lond works with to handle database requests.&nbsp; This 
        !            77:     daemon process is called &quot;lonsql&quot;.</span></p>
        !            78:   <p>&nbsp; So,</p>
        !            79:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        !            80:     database command</span></p>
        !            81:   <p><span style='font-family:"Courier New"'>&nbsp; A-lonc&nbsp; ---------TCP/IP-----------------&gt; 
        !            82:     B-lond =====&gt; B-lonsql</span></p>
        !            83:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        !            84:     &lt;---------------------------------/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        !            85:     |</span></p>
        !            86:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        !            87:     &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; 
        !            88:     |</span></p>
        !            89:   <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; 
        !            90:     |</span></p>
        !            91:   <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; 
        !            92:     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/</span></p>
        !            93:   <p><span style='font-family:"Courier New"'>&nbsp; A-lond&nbsp; &lt;-------------------------------&nbsp; 
        !            94:     B-lonc&nbsp;&nbsp; &lt;======</span></p>
        !            95:   <p><span style='font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        !            96:     &quot;Guess what? I have the result!&quot;</span></p>
        !            97:   <p>Of course, depending on success or failure, the messages may vary, but the 
        !            98:     principle remains the same where a separate pool of children processes (lonsql's) 
        !            99:     handle the MySQL database manipulations.</p>
        !           100: </div>
        !           101: <br
        !           102: clear=ALL style='page-break-before:always;'>
        !           103: <div class=Section2> </div>
        !           104: </body>
        !           105: </html>

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