ExpressionEngine:git:本地开发:远程数据库

时间:2021-05-13 23:31:23

To those of you that are trying to be good little developers and version control their ExpressionEngine sites with git, how do you handle your database?

对于那些试图成为优秀小开发人员和版本控制他们的ExpressionEngine网站的人,你如何处理你的数据库?

In my limited experience with multiple developers working on one ExpressionEngine site, we've had to all run off of a single MySQL development database running on a remote web server. For those of you that have tried this, it is PAINFULLY slow. Page loads can easily take 5-10 seconds making development extremely difficult. It would be quicker to work off of a remote development server. I am trying to steer away from working off of a remote MySQL server in order to be able to work from anywhere and not depend on Internet connection speed/quality.

由于我在一个ExpressionEngine网站上工作的多个开发人员的经验有限,我们不得不运行在远程Web服务器上运行的单个MySQL开发数据库。对于那些试过这个的人来说,它很慢。页面加载可能需要5-10秒才能使开发变得非常困难。远程开发服务器的处理速度会更快。我试图避开远程MySQL服务器的工作,以便能够在任何地方工作,而不依赖于Internet连接速度/质量。

Just wondering how others handle their MySQL databases.

只是想知道其他人如何处理他们的MySQL数据库。

Do all of your developers run off of one central database? Have you dealt with slowness issues like we have?

您的所有开发人员都使用一个*数据库吗?你有没有像我们一样处理缓慢的问题?

Do you keep your database under version control? How do you handle export/imports among multiple developers and multiple branches?

您是否将数据库置于版本控制之下?您如何处理多个开发人员和多个分支机构之间的导出/导入?

With one developer I can import/export/commit the database very easily but as soon as you add another developer to the mix, it gets very VERY muddy. Looking forward to hearing everyone's thoughts on this mammoth topic.

有了一个开发人员,我可以非常轻松地导入/导出/提交数据库,但只要你添加另一个开发人员,它就变得非常混乱。期待听到每个人对这个庞大话题的看法。

Thanks!

谢谢!

4 个解决方案

#1


2  

Have you looked at the EE Profiler recently? You'll probably notice in the neighborhood of 20-80 queries on your home page depending on it's complexity.

你最近看过EE Profiler吗?您可能会在主页上看到20-80个查询,具体取决于它的复杂程度。

The problem is that, for each query, MySQL must execute a remote request for data, download the response, and then present ExpressionEngine it's data. The 20-80 round trips to the database is what's causing your delay and I don't think there is much you can do about it. When using a remote (outside our network) database, I get the same delay as you.

问题是,对于每个查询,MySQL必须执行远程数据请求,下载响应,然后呈现ExpressionEngine它的数据。数据库的20-80次往返是导致您延误的原因,我认为您无法做太多事情。当使用远程(我们的网络外)数据库时,我会得到与您相同的延迟。

When MySQL is running on your machine or the production server, it doesn't have the added network requests causing latency in it's requests for data. This is the difference.

当MySQL在您的计算机或生产服务器上运行时,它没有添加的网络请求导致其数据请求的延迟。这是不同的。

As for fixes, all you can do is move to a database hosted on your internal network. We have a Linux machine that mimics our production environment that we use for staging. Since it's on our network, we can use the local IP address in our database.php file. This is much faster.

至于修复,您所能做的就是移动到内部网络上托管的数据库。我们有一台Linux机器,模仿我们用于分段的生产环境。由于它在我们的网络上,我们可以在database.php文件中使用本地IP地址。这要快得多。

The problem that we still have is the issue of channels/fields/entries. When a developer is working on a new section, they'll likely need to create a new channel and fields and/or new entries. When we're ready to push that functionality to production, we have to manually make those changes on the production server as there is no way to reliably export them. I am hopeful of this addon though---we'll see.

我们仍然存在的问题是频道/字段/条目的问题。当开发人员处理新部分时,他们可能需要创建新的频道和字段和/或新条目。当我们准备将该功能推向生产时,我们必须在生产服务器上手动进行这些更改,因为无法可靠地导出它们。我对这个插件充满希望---我们会看到。

#2


7  

It seems there is a lot of time lost on failing DNS requests, with a remote database.

对于使用远程数据库的DNS请求失败,似乎有很多时间丢失。

Start your MySQL server with start mysqld with --skip-name-resolve. (More information on this topic can be found here: http://dev.mysql.com/doc/refman/5.0/en/host-cache.html)

使用--skip-name-resolve启动mysqld启动MySQL服务器。 (有关此主题的更多信息,请访问:http://dev.mysql.com/doc/refman/5.0/en/host-cache.html)

Having a remote database still seems to be the best way for us to work on a project with multiple developers.

拥有一个远程数据库似乎仍然是我们与多个开发人员合作项目的最佳方式。

#3


5  

I almost always use a central database for development. Depending which host you use, the speed difference may not be huge.

我几乎总是使用*数据库进行开发。根据您使用的主机,速度差异可能不大。

Obviously, if you're not making changes to the database, i.e. only doing template development, keeping the database in sync is not as needed, so you could potentially bring up a local copy of the database. You just have to remember to repeat any database changes, if you do end up making some.

显然,如果您没有对数据库进行更改,即只进行模板开发,则保持数据库同步不是必需的,因此您可能会调出数据库的本地副本。你必须记住重复任何数据库更改,如果你最终做了一些。

As far as version control, I keep a copy of my base EE install's SQL file in my base repository. Other than that I don't usually keep copies of the database in Git, so I don't do a lot of importing/exporting, etc.

至于版本控制,我在我的基础存储库中保留了我的基本EE安装的SQL文件的副本。除此之外,我通常不会在Git中保存数据库的副本,所以我不做很多导入/导出等。

#4


2  

In my company (4 developers) we each run our own DB locally. But recently I tested Rackspace Cloud Databases (but there are other cloud db providers) for a heavy DB that could become difficult to run on a little laptop. It's relatively less expensive than running our own db server, and it can be setup or deleted in the minute.

在我的公司(4个开发人员)中,我们每个人都在本地运行自己的DB但最近我测试了Rackspace云数据库(但还有其他云数据库提供商),因为重型数据库很难在小型笔记本电脑上运行。它比运行我们自己的数据库服务器便宜,而且可以在一分钟内设置或删除它。

#1


2  

Have you looked at the EE Profiler recently? You'll probably notice in the neighborhood of 20-80 queries on your home page depending on it's complexity.

你最近看过EE Profiler吗?您可能会在主页上看到20-80个查询,具体取决于它的复杂程度。

The problem is that, for each query, MySQL must execute a remote request for data, download the response, and then present ExpressionEngine it's data. The 20-80 round trips to the database is what's causing your delay and I don't think there is much you can do about it. When using a remote (outside our network) database, I get the same delay as you.

问题是,对于每个查询,MySQL必须执行远程数据请求,下载响应,然后呈现ExpressionEngine它的数据。数据库的20-80次往返是导致您延误的原因,我认为您无法做太多事情。当使用远程(我们的网络外)数据库时,我会得到与您相同的延迟。

When MySQL is running on your machine or the production server, it doesn't have the added network requests causing latency in it's requests for data. This is the difference.

当MySQL在您的计算机或生产服务器上运行时,它没有添加的网络请求导致其数据请求的延迟。这是不同的。

As for fixes, all you can do is move to a database hosted on your internal network. We have a Linux machine that mimics our production environment that we use for staging. Since it's on our network, we can use the local IP address in our database.php file. This is much faster.

至于修复,您所能做的就是移动到内部网络上托管的数据库。我们有一台Linux机器,模仿我们用于分段的生产环境。由于它在我们的网络上,我们可以在database.php文件中使用本地IP地址。这要快得多。

The problem that we still have is the issue of channels/fields/entries. When a developer is working on a new section, they'll likely need to create a new channel and fields and/or new entries. When we're ready to push that functionality to production, we have to manually make those changes on the production server as there is no way to reliably export them. I am hopeful of this addon though---we'll see.

我们仍然存在的问题是频道/字段/条目的问题。当开发人员处理新部分时,他们可能需要创建新的频道和字段和/或新条目。当我们准备将该功能推向生产时,我们必须在生产服务器上手动进行这些更改,因为无法可靠地导出它们。我对这个插件充满希望---我们会看到。

#2


7  

It seems there is a lot of time lost on failing DNS requests, with a remote database.

对于使用远程数据库的DNS请求失败,似乎有很多时间丢失。

Start your MySQL server with start mysqld with --skip-name-resolve. (More information on this topic can be found here: http://dev.mysql.com/doc/refman/5.0/en/host-cache.html)

使用--skip-name-resolve启动mysqld启动MySQL服务器。 (有关此主题的更多信息,请访问:http://dev.mysql.com/doc/refman/5.0/en/host-cache.html)

Having a remote database still seems to be the best way for us to work on a project with multiple developers.

拥有一个远程数据库似乎仍然是我们与多个开发人员合作项目的最佳方式。

#3


5  

I almost always use a central database for development. Depending which host you use, the speed difference may not be huge.

我几乎总是使用*数据库进行开发。根据您使用的主机,速度差异可能不大。

Obviously, if you're not making changes to the database, i.e. only doing template development, keeping the database in sync is not as needed, so you could potentially bring up a local copy of the database. You just have to remember to repeat any database changes, if you do end up making some.

显然,如果您没有对数据库进行更改,即只进行模板开发,则保持数据库同步不是必需的,因此您可能会调出数据库的本地副本。你必须记住重复任何数据库更改,如果你最终做了一些。

As far as version control, I keep a copy of my base EE install's SQL file in my base repository. Other than that I don't usually keep copies of the database in Git, so I don't do a lot of importing/exporting, etc.

至于版本控制,我在我的基础存储库中保留了我的基本EE安装的SQL文件的副本。除此之外,我通常不会在Git中保存数据库的副本,所以我不做很多导入/导出等。

#4


2  

In my company (4 developers) we each run our own DB locally. But recently I tested Rackspace Cloud Databases (but there are other cloud db providers) for a heavy DB that could become difficult to run on a little laptop. It's relatively less expensive than running our own db server, and it can be setup or deleted in the minute.

在我的公司(4个开发人员)中,我们每个人都在本地运行自己的DB但最近我测试了Rackspace云数据库(但还有其他云数据库提供商),因为重型数据库很难在小型笔记本电脑上运行。它比运行我们自己的数据库服务器便宜,而且可以在一分钟内设置或删除它。