Cassandra数据库迁移工具设计与实现
发布时间:2018-01-26 06:04
本文关键词: 数据库迁移工具 Cassandra数据库 Maven 出处:《华南理工大学》2015年硕士论文 论文类型:学位论文
【摘要】:当今社会,大多数应用程序都是需要管理大量数据的企业应用程序。从事这类项目的开发团队常常将数据库视为与应用程序完全脱离的单独实体。造成这种现象的原因是组织结构经常将数据库团队从应用程序开发团队分离出来。这种分离导致了一定的问题:需要手工变更数据库,不能与团队的其他成员分享数据库变更,不同的人可能使用不一致的方法变更数据库或数据,数据库版本之间变更的手工管理方法效率低下,使开发人员无法与数据变更保持同步。而且,还可能使应用程序的用户遇到与数据不一致和数据损坏等问题。鉴于手工迁移数据库的问题,企业更倾向于使用自动化迁移工具来完成数据库的迁移,但是目前存在的绝大多数此类工具都是面向于传统的关系型数据库,对于新型的Nosql,如我们公司所使用的Cassandra,并没有太多的选择。本文介绍一款用于Cassandra的自动化数据库迁移工具的设计。该工具的目标是对指定的目录下的CQL脚本和JAVA脚本进行分析,检测哪些脚本已执行或未执行,然后生成一个执行任务列表。根据该执行列表上的任务执行脚本,在执行过程中记录执行日志,便于开发者后来进行调试,并将执行过程中的状态记录在数据库的一张名为VersionTable表中。该工具采用Java语言编写,使用Maven作为项目管理工具来完成自动化部署工作。通过Maven的本地化配置,企业现有的平台能够很好的使用该工具。经过测试,在使用该数据库迁移工具后,企业的开发人员能够清楚数据库的状态,知道哪些脚本已经执行,并可根据执行日志来修正脚本中的语法错误,大大提高了生产效率。
[Abstract]:In today's society. Most applications are enterprise applications that need to manage large amounts of data. Development teams working on such projects often treat databases as separate entities completely separate from the application. This is due to groups. Weaving structures often separate database teams from application development teams. This separation leads to problems:. The database needs to be changed manually. Database changes cannot be shared with other members of the team, different people may use inconsistent methods to change databases or data, and manual management of changes between database versions is inefficient. Prevents developers from keeping pace with data changes. Also, it is possible to expose application users to problems such as data inconsistency and data corruption, given the problem of manually migrating the database. Enterprises prefer to use automated migration tools to complete database migration, but most of these tools are oriented to the traditional relational database, for the new Nosql. Like the Cassandra used by our company. This article introduces the design of an automated database migration tool for Cassandra. The goal of the tool is to implement CQL and JAVA scripts in a specified directory. Analysis. Detect which scripts have been executed or not executed, and then generate a list of execution tasks. According to the task execution script on the execution list, the execution log is recorded during execution so that the developer can debug it later. And the state of the execution is recorded in a database named VersionTable table. The tool is written in Java language. Use Maven as the project management tool to complete the automated deployment. Through the localized configuration of Maven, the existing platform of the enterprise can make good use of the tool. After using the database migration tool, enterprise developers are able to know the state of the database, which scripts have been executed, and correct syntax errors in scripts based on the execution log. The production efficiency is greatly improved.
【学位授予单位】:华南理工大学
【学位级别】:硕士
【学位授予年份】:2015
【分类号】:TP311.13
【参考文献】
相关期刊论文 前4条
1 黄贤立;;NoSQL非关系型数据库的发展及应用初探[J];福建电脑;2010年07期
2 夏文忠;;Log4J在学生管理系统中的开发与应用[J];电脑编程技巧与维护;2009年10期
3 罗林球;孟琦;李晓;苏国平;张澄澈;;异构数据库迁移的设计和实现[J];计算机应用研究;2006年12期
4 张俊;;用Maven简化你的项目管理[J];程序员;2006年09期
,本文编号:1464885
本文链接:https://www.wllwen.com/guanlilunwen/xiangmuguanli/1464885.html