简体   繁体   English

以跨平台方式维护Mysql数据库架构的最佳实践是什么?

[英]What are best practices for maintaining a Mysql database schema in a cross platform way?

We have two software stacks, Ruby on Rails and Java, that share a single Mysql database. 我们有两个软件堆栈,Ruby on Rails和Java,它们共享一个Mysql数据库。 We're using the Jooq Java database abstraction layer, which works by reading an existing database schema and generating code. 我们正在使用Jooq Java数据库抽象层,该层通过读取现有数据库架构并生成代码来工作。

We have been relying on Rails migrations to keep track of schema changes, but our Java developers are unfamiliar with this, and our Rails devs have had to dig us out of problems more than once. 我们一直依靠Rails迁移来跟踪模式更改,但是我们的Java开发人员对此并不熟悉,并且我们的Rails开发人员不得不不止一次地使我们摆脱问题。 It's also a rather cumbersome process, making a schema change can take 5-10 minutes, whereas it would take seconds if modifying the schema directly through a tool like MySql Workbench. 这也是一个相当麻烦的过程,进行模式更改可能需要5到10分钟,而如果直接通过MySql Workbench之类的工具修改模式,则将花费几秒钟。

It would be preferable to have a solution for modifying our DB schema that wasn't tied to Rails, can anyone recommend a suitable approach? 最好有一个解决方案来修改与Rails无关的数据库模式,有人可以推荐合适的方法吗?

I guess you could take a look at Liquibase . 我想你可以看看Liquibase It's a Java-based tool, but as I understand it would suit some of your requirements. 这是一个基于Java的工具,但是据我了解,它可以满足您的一些要求。 Using that tool you are able to express the database content (both structure and data), then run such a tool against a running database and the tool will tell you what changes are missing and will apply them. 使用该工具,您可以表达数据库的内容(结构和数据),然后针对正在运行的数据库运行这样的工具,该工具将告诉您缺少哪些更改并将其应用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java background / daemon / service跨平台最佳实践 - java background/daemon/service cross platform best practices 用git开发具有相同内核的跨平台Java应用程序的最佳方法是什么? - What is the best way to develop cross-platform Java applications with the same core, with git? 处理跨平台程序的COM端口的最佳方法? - Best way to deal with COM ports for a cross-platform program? 最佳实践:什么是处理字节协议的最佳方法 - Best practices: What's the best way to treat byte protocol (可能)数百个移动客户端访问 MySQL 数据库的最佳方式是什么? - What is the best way for (potentially) hundreds of mobile clients to access a MySQL database? 在 MYSQL 数据库中存储 base64 字符串的最佳方法是什么? - What is the best way to store base64 string in MYSQL database? XML模式位置最佳实践 - XML schema location best practices 在嵌入式HSQL数据库中创建模式的最佳方法 - Best way to create schema in embedded HSQL database 什么是在Java中选择随机种子的跨平台方式? - What is a cross platform way to select a random seed in Java? 存储与数据库连接相关的信息的最佳实践是什么? - What is the best practices to store database connection related information?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM