<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
    <channel>
        <title>CUBRID Automated Scripts for DB Hosting Service</title>
        <link>http://www.cubrid.org/?mid=cubrid_automated_scripts_hosting_service</link>
        <description>CUBRID Automated Scripts for DB Hosting Service</description>
        <language>en</language>
        <pubDate>Thu, 06 Jan 2011 09:54:16 -0800</pubDate>
        <lastBuildDate>Fri, 16 Sep 2011 08:54:05 -0800</lastBuildDate>
        <generator>XpressEngine 1.4.4.1</generator>
                        										        <item>
            <title>CUBRID Automated Scripts for DB Hosting Service</title>
            <dc:creator>admin</dc:creator>
            <link>http://www.cubrid.org/cubrid_automated_scripts_hosting_service</link>
            <guid isPermaLink="true">http://www.cubrid.org/cubrid_automated_scripts_hosting_service</guid>
                                    <description><![CDATA[<h1>CUBRID Automated Scripts for DB Hosting Service</h1>

<div class="contents-table" style="display: block; ">
<h3 id="">Table of Contents</h3>
<ul>
<li><a class="toTop">Back to Top</a></li>
<li><a href="#overview">1. Overview</a></li>
<ul>
<li><a href="#downloads">Downloads</a></li>
</ul>
<li><a href="#limitations">2. Limitation</a></li>
<li><a href="#configurations">3.Configuration</a></li>
<ul>
<li><a href="#architecture-1">Architecture 1</a></li>
<li><a href="#architecture-2">Architecture 2</a></li>
</ul>
<li><a href="#scripts">4. Scripts</a></li>
<ul>
<li><a href="#list">Script list</a></li>
<li><a href="#details">Script Details</a></li>
<ul>
<li><a href="#makedb">makedb.sh</a></li>
<li><a href="#removedb">removedb.sh</a></li>
<li><a href="#chpwdb">chpwdb.sh</a></li>
<li><a href="#listdb">listdb.sh</a></li>
<li><a href="#backupdb">backupdb.sh</a></li>
<li><a href="#restored">restored.sh</a></li>
</ul>
</ul>
<li><a href="#sugguestions">5. Suggestions</a></li>
</ul>
</div>

<h2 id="overview">1. Overview</h2>

<p>Often we receive requests from Hosting companies and other developers to publish some scripts for automated installation and administration of CUBRID in hosting environment. So this article explains how you can automate the installation process, manage the database quota, users, etc.</p>

<p>Below you can download the automation scripts <b>for easy administration of CUBRID database</b>. Besides this article, you can refer to code comments, provided in each script file, when you optimize them for your hosting system. At the moment of writing this article top 3 major hosting service providers in Korea already provide CUBRID DB hosting. As we gather requirements from other hosting company, we will be publishing new materials that you can use for your service.</p>

<h3 id="downloads">Downloads</h3>

<table class="blackcap rowbg">
<thead>
<tr>
	<td width="160">File name</td>
	<td>Size</td>
</tr>
</thead>
<tbody>
<tr>
	<td><a href="/files/docs/misc/hosting_db_script.zip">hosting_db_script.zip</a></td>
	<td>5 KB</td>
</tr>
</tbody>
</table>

<h2 id="limitations">2. Limitation</h2>

<p>Before proceeding, let's review the limitations which hosting companies come across when installing CUBRID for their environment.</p>

<ul><li><b>User Quota:</b>&nbsp;there is no feature in CUBRID to limit <i>DB quota</i>, <i>CPU usage</i>,
<i>Memory usage</i>&nbsp;for each user. However, you can put limitations on your operating system. Since&nbsp;in CUBRID&nbsp;there is one&nbsp;<b>cub_server</b>&nbsp;process running for each database, <b>system
administrators can monitor each useros DB process</b>. Moreover, you can <b>limit
the number of connections per a single user </b>by assigning a broker to each of them.</li><li><b>Administration Tool:</b>&nbsp;currently we provide only two administration tools: one is
<a href="/cubrid_manager" target="_self">CUBRID Manager</a><i>,</i>&nbsp;the other is <a href="/about_cubrid_web_query" target="_self">CUBRID WebQuery</a>. We have already started the development of phpCubridAdmin, and analogue for popular phpMyAdmin. So, please wait a little more. We are
working hard on bringing it to you by mid 2011.</li></ul>

<h2 id="configurations">3.Configuration</h2>

<p>Below you can see two different architectures hosting companies can use to provide the CUBRID database hosting. Basically, they are similar to that of original <a href="/cubrid_architecture" target="_self">CUBRID architecture</a>.</p>

<h3 id="architecture-1">Architecture 1</h3>

<p><img src="http://www.cubrid.org/files/attach/images/49/080/004/cubrid-architecture-in-hosting-environment.png" alt="cubrid-architecture-in-hosting-environment.png" width="456" height="503" editor_component="image_link"/><br /></p><p>This architecture proposes a hosting service solution consisting of a single CUBRID Server machine with&nbsp;<b>N</b>&nbsp;number of brokers for <b>N</b> number of users. Thus, you can control the number of client connections per user by configuring each broker parameters.</p><p>However,&nbsp;you cannot use full resources in the system because each broker process consumes default resources all the time.</p>

<h3 id="architecture-2">Architecture 2</h3>

<p><img src="http://www.cubrid.org/files/attach/images/49/080/004/cubrid-architecture-in-hosting-environment-2.png" alt="cubrid-architecture-in-hosting-environment-2.png" width="456" height="503" editor_component="image_link"/></p><p>In this architecture, a single broker handles connections from many users. However, for efficient system resources management (this is one reason why CUBRID is optimized for Web applications), CUBRID's broker is designed to manage connection pooling and load balancing.&nbsp;Therefore, if a certain&nbsp;useros web service will drive more traffic than other users' and heavily load the database server, this&nbsp;will affect rest of userso services, too. Thus, this architecture is good for small-sized services.</p>

<h2 id="scripts">4. Scripts</h2>

<h3 id="list">Script list</h3>

<table class="blackcap rowbg">
<thead>
<tr>
	<td width="160">Category</td>
	<td>Script file name</td>
	<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
	<td rowspan="3">Hosting User Related</td>
	<td>makedb.sh</td>
	<td>Script for creating a database and DB user</td>
</tr>
<tr>
	<td>removed.sh</td>
	<td>Script for deleting a database</td>
</tr>
<tr>
	<td>chpwdb.sh</td>
	<td>Script for changing DB useros password </td>
</tr>
<tr>
	<td rowspan="3">DB Admin Related</td>
	<td>listdb.sh</td>
	<td>Script for listing name of all databases</td>
</tr>
<tr>
	<td>backupdb.sh</td>
	<td>Script for DB Backup</td>
</tr>
<tr>
	<td>restored.sh</td>
	<td>Script for DB Restore</td>
</tr>
</tbody>
</table>

<h3 id="details">Script Details</h3>

<h4 id="makedb">makedb.sh</h4>

<table class="blackcap rowbg">
<thead>
<tr>
	<td width="160"></td>
	<td>Creating a new database</td>
</tr>
</thead>
<tbody>
<tr>
	<td>Prototype</td>
	<td>./makedb.sh &lt;userid&gt; &lt;password&gt;</td>
</tr>
<tr>
	<td>Parameter</td>
	<td><b>Userid:</b> Database name and its username<br /><b>Password:</b> DB user’s password of the new database</td>
</tr>
<tr>
	<td>Etc.</td>
	<td>CUBRID creates DB user (DBA/PUBLIC user) by default. You should change each password in the <b>DBA_PASS</b>, <b>PUBLIC_PASS</b> parameter in the script.</td>
</tr>
</tbody>
</table>

<h4 id="removedb">removedb.sh</h4>

<table class="blackcap rowbg">
<thead>
<tr>
	<td width="160"></td>
	<td>Removing a database</td>
</tr>
</thead>
<tbody>
<tr>
	<td>Prototype</td>
	<td>./removedb.sh &lt;userid&gt;</td>
</tr>
<tr>
	<td>Parameter</td>
	<td><b>Userid:</b> Database name to remove</td>
</tr>
<tr>
	<td>Etc.</td>
	<td></td>
</tr>
</tbody>
</table>

<h4 id="chpwdb">chpwdb.sh</h4>

<table class="blackcap rowbg">
<thead>
<tr>
	<td width="160"></td>
	<td>Changing a DB user’s password</td>
</tr>
</thead>
<tbody>
<tr>
	<td>Prototype</td>
	<td>./chpwdb.sh &lt;dbname&gt; &lt;userid&gt; &lt;password&gt;</td>
</tr>
<tr>
	<td>Parameter</td>
	<td><b>Dbname:</b> database name to change<br /><b>Userid:</b> username to change<br /><b>Password:</b> new password of the user</td>
</tr>
<tr>
	<td>Etc.</td>
	<td>You should set the value of DBA_PASS parameter in the script.</td>
</tr>
</tbody>
</table>

<h4 id="listdb">listdb.sh</h4>

<table class="blackcap rowbg">
<thead>
<tr>
	<td width="160"></td>
	<td>List all name of existing databases in the server</td>
</tr>
</thead>
<tbody>
<tr>
	<td>Prototype</td>
	<td>./listdb.sh</td>
</tr>
<tr>
	<td>Parameter</td>
	<td></td>
</tr>
<tr>
	<td>Etc.</td>
	<td>Each database name is listed by a collon delimiter ( : ).</td>
</tr>
</tbody>
</table>

<h4 id="backupdb">backupdb.sh</h4>

<table class="blackcap rowbg">
<thead width="160">
<tr>
	<td></td>
	<td>Backup the database</td>
</tr>
</thead>
<tbody>
<tr>
	<td>Prototype</td>
	<td>./backupdb.sh &lt;dbname&gt;</td>
</tr>
<tr>
	<td>Parameter</td>
	<td><b>dbname:</b> database name to backup</td>
</tr>
<tr>
	<td>Etc.</td>
	<td></td>
</tr>
</tbody>
</table>

<h4 id="restored">restored.sh</h4>

<table class="blackcap rowbg">
<thead>
<tr>
	<td width="160"></td>
	<td>Restore the database</td>
</tr>
</thead>
<tbody>
<tr>
	<td>Prototype</td>
	<td>./restored.sh &lt;dbname&gt;</td>
</tr>
<tr>
	<td>Parameter</td>
	<td><b>dbname:</b> database name to restore</td>
</tr>
<tr>
	<td>Etc.</td>
	<td></td>
</tr>
</tbody>
</table>

<h2 id="sugguestions">5. Suggestions</h2>

<p>Unfortunately we do not know well how hosting infrastructure is configured and what its internal workflow is. Therefore, if you have any sugguestions how we can improve CUBRID so that it is easy to use in the hosting environment, please let us know on <a href="http://twitter.com/?status=%40cubrid%20" target="_blank">Twitter</a> or <a href="/forum" target="_blank">CUBRID Forum</a>. We are willing to know and gather more information on hosting services. If you request any materials or features, we will do our best to deliver them to you as soon as possible.</p>]]></description>
                        <pubDate>Thu, 06 Jan 2011 08:58:41 -0800</pubDate>
                        <category>hosting</category>
                        <category>architecture</category>
                                </item>
            </channel>
</rss>
