Reliability and Availability Support in MySQL database server. Royyana Muslim ... MySQL seems to be a standard database for web hosting services as well as ...
Stream duplication as an Alternative Approach To Provide Reliability and Availability Support in MySQL database server Royyana Muslim Ijtihadie*, Graduate School of Science and Technology, Kumamoto University Institut Teknologi Sepuluh Nopember, Surabaya, Indonesia Yoshifumi Chisaki , Graduate School of Science and Technology, Kumamoto University Tsuyoshi Usagawa , Graduate School of Science and Technology, Kumamoto University Abstract- Recently, MySQL has gained its popularity, since it has been widely used around the world for many purposes. Many critical applications are using MySQL as their standard database server. Therefore the reliability and availability is required. Consequently, to provide such requirements, replication and backup system has been already supported in MySQL. However, replication system in MySQL requires internal configuration modification which can be done only by administrator and very unlikely for common user, particularly in server that is usually shared with another users. Meanwhile, backup and restore activity can not be done in realtime fashion. Hence, there is a demand to build a reliability system for MySQL database server which allows common user to prepare server using common interface instead of administrator interface. This paper discuss a stream duplication approach of providing backup support for MySQL database server. SQL request duplication method is expected to be able to duplicate SQL request coming from MySQL client and forward it toward assigned MySQL servers.. Index Terms- MySQL, Database, Reliability, Availability,. LMS Synchronization, Backup System.
F
I. INTRODUCTION
or years, providing reliability and availability is a concern in database systems. It is a compulsory thing for the enterprises in order to deal with data recovery as their plan for prevention for data lost. Enterprises have spent huge expenses for such requirements which is worth to implement. There are huge demands of using database server that can be used for small and medium institutes and not mainly concern so much about reliability and availability even though it might be needed for certain situations. Mysql has been one of the world`s popular database server[1]. It is easy to use and operate, and open source as well. MySQL seems to be a standard database for web hosting services as well as web applications . PhpMyAdmin [2], a web hosting standard database operating console, makes common users able to operate MySQL easily Many applications such as Moodle[3] or Dokeos[4] open source web based Learning Management System (LMS) has also relied on MySQL as their back-end database server. Such situations have led to a requirement of data backup method for its reliability and availability. MySQL has also supported such requirement so far. There are many options available for users or can be said, experienced system administrator to implement, for example Replication, DBRD, and so on. Implementing whichever choice requires some extra efforts for the common user. Particularly, For example, for those who
uses MySQL in web hosting environment, which usually run in shared environment (Virtual Private Server). It might be unlikely to implement such configuration unless they buy special services or dedicated server which might led to additional expenses. Another example, teachers who had run and depended on LMS for all of their courses, and need simple way to backup their contents, might use it for their own reliability system with no much involvement for experienced system administrator. Hence, there is a demand to build a system to provide reliability and availability in MySQL that is easy to implement, manage, and operate by common users. Reliability and availability discussed in this paper are mainly related to data backup mechanism in LMS. This paper will discuss stream duplication approach in order to provide reliability and availability for a group of MySQL database server. This approach can also be implemented for dynamic synchronization of learning contents among distributed moodle systems [5], but in different way, to support its backup system. II. IMPLEMENTATION In this proposed system, backup means providing redundancy of data among MySQL servers. SQL statements generated by LMS that affect data alteration will be distributed among MySQL servers in order to make all MySQL servers execute the same activity. Should the main MySQL failed, it can be simply switched to server that is formerly backup MySQL server to assign it as the main MySQL server. SQL statement that does not affect data alteration will not be distributed. Such SQL statement will only be fetched from particular standby MySQL server. The backup architecture for this system is mainly using a centralized log processor that located in the middle between client and real MySQL server. MySQL-proxy will take place as a bridge to redirect and copy the request stream to backup system. In this approach we will use a log file that will contain successful transactions and later propagated to backup system. MySQL has been provided with a tool named MySQLproxy [6]. MySQL-proxy is a program designed to sit between client and MySQL server. MySQL-proxy is also equipped with a user level scripting language called Lua [7]. Lua is a scripting language that allows users to develop their own program for their own purposes such as monitoring, load balancing, query analysis, and many other purposes. Further, such features of MySQL-proxy will be used as a part of
implementation of our approach. According to [8], algorithm for maintaining remote backup copy fall into two categories: 1-safe and 2-safe, In 2safe algorithm, all updates to the data are applied in both copies. In 1-safe systems, transactions first commit at the primary site and are later propagated to the backup. Evaluation of remote backup systems for transaction processing systems [9] showed that using 1-safe system has a potential to cause limited number of data lost. On the other hand, 2-safe system is preferable if data lost is intolerable, supported also with fast processor and not serious lock contention. Therefore, we selected to the 1-safe system in order to meet its simplicity and tolerant to network and processor limitation. We assumed that LMS activity of transaction is not quite high and not very intensive in processor usage. Proposed system resemble in abstract in Fig 1.
INSERT statement with example data. Data will be inserted into table named test1. It is expected that the data will be distributed to all MySQL servers and gives the result that table test1 in each server would have similar content. Before execution
After Execution
A
Main server B
MySQL backup #1 C
MySQL backup #2 Fig. 2. Table test1 alteration after experiment.
Fig. 1. Abstract architecture of proposed system.
In this architecture, there will be 3 (three) main parts involved. First, LMS clients who will act as MySQL client which makes a request to MySQL server. Second, Message Router, a software running at application layer which is put in the middle of communication between client and MySQL server, and MySQL real server which will act as a main MySQL database server where all SQL statements will be processed and all data will be retrieved. Message Router is implemented using MySQL-proxy. This Message Router will be specified as MySQL server access point by its clients. It will accept the connection, fetches SQL statement request, and forwards it to both MySQL real server and MySQL backup servers in order to provide redundancy. Log processor is a transaction activity catcher. Log processor will be looking for and getting information from the file named LOG produced by Message Router, if it contains data manipulation statement, then it will be executed in MySQL backup system.
Fig 2. shows that the content of table test1 in all MySQL servers are exactly the same after execution. Please note that the field ts is an exception, it is just used to indicate time differences between real MySQL server and its backups during insertion. IV. CONCLUSION AND FUTURE WORKS In this stage, the approach is successfully implemented and works well. However, there are still questions about performance issues which is now under examination. V. ACKNOWLEDGMENT A part of this research is supported by Strategic Information and Communications R&D Promotion Programme – Regional topic (SCOPE) #082310003. VI. REFERENCES [1] [2] [3] [4] [5]
III. EXAMPLE OF THE SYSTEM The implementation and experiment have been conducted in HICC laboratory, Kumamoto University., using laptop computers that are not mainly aimed for server purposes. For experiment, we use 3 MySQL servers, 2 for backups, 1 for main server, 1 for Message Router, and 1 for client (database connection will be targeted to Message Router). To show the functionality of this approach, a small program will be executed and run in client to execute 5 consecutive
[6] [7] [8] [9]
MySQL market share, http://www.MySQL.com/whyMySQL/marketshare/ PhpMyAdmin, http://www.phpmyadmin.net/ Moodle, http://www.moodle.org Dokeos, http://www.dokeos.org Tsuyoshi Usagawa, Achmad Affandi, Bekti Cahyo Hidayanto, Meita Rumbayan, Toshiro Ishimura, Yoshifumi Chisaki, Dynamic synchronization of learning contents among distributed moodle systems, Proceeding of JSET, e2a-245-06, pp. 1011-1012, (2009.9) MySQL-proxy, http://dev..mysql.com/doc/refman/5.1/en/MySQLproxy.html Lua scripting language, http://www.lua.org Gray, J. N., and Reuter, A. 1988. Transaction processing. Course Notes from CS#445, Stanford Univ., Spring Term, Stanford, Calif. Christos A. Polyzois , Hector Garcia-Molina, Evaluation of remote backup algorithms for transaction processing systems, ACM SIGMOD Record, v.21 n.2, p.246-255, June 1, 1992