Web 应用程序部署和数据库/运行时数据管理

发布于 2024-10-20 03:55:10 字数 912 浏览 0 评论 0原文

我决定最终彻底确定我团队的部署流程。我们剩下的最后一个痛点是管理数据库和运行时数据迁移/管理。这里有两个例子,虽然存在很多:

  • 如果发布新的“上传”功能,自动创建上传目录并配置权限。在以后的版本中,验证存在/权限 - 永远、自动。
  • 如果数据库中的值(假设帐户状态为“注册”)不再有效,则根据一组业务规则,自动将数据库中的数据迁移到正确的值。

我有兴趣实现一个框架,该框架允许开发人员像管理和部署代码一样轻松地管理和部署这些更改。

所以第一个问题是:1。有哪些工具/框架可以提供这种能力?

一般来说,这似乎是任何给定语言和平台中的一个问题。在我的具体案例中,我正在部署一个 .NET MVC2 应用程序,该应用程序使用 Fluent NHibernate 进行数据库抽象。我的部署过程中已经有一个可以触发 NHibernate 的 SchemaUpdate 的工具 - 这太棒了。

为了以自己的方式解决这个问题,我构建了一个工具,该工具将扫描目标程序集以查找从某个抽象类(部署)继承的类。该抽象类公开了挂钩,您可以在应用程序代码库的上下文中覆盖并实现您自己的任意部署代码。 Deployment 类还提供版本控制机制,并且该工具管理给定正在运行的应用程序的当前“部署版本”。然后,自定义 NAnt 任务将其与 NAnt 部署脚本粘合在一起,在适当的时间触发挂钩。

这似乎运作良好,并且确实满足了我的目标 - 但这是我的抱怨,并引出了我的第二个问题:2。当然,我刚刚写的内容肯定已经存在。如果是这样,你能指点一下吗?3。有没有人开始走这条路并深入了解这种方法的问题?

最后,如果存在这样的东西,但不在 .NET 平台上,请仍然让我知道 - 因为我更有兴趣移植一个已知的解决方案而不是从零开始我自己的解决方案。

谢谢大家,我非常感谢您的反馈!

I have decided to finally nail down my team's deployment processes, soup-to-nuts. The last remaining pain point for us is managing database and runtime data migration/management. Here are two examples, though many exist:

  • If releasing a new "Upload" feature, automatically create upload directory and configure permisions. In later releases, verify existence/permissions - forever, automatically.
  • If a value in the database (let's say an Account Status of "Signup") is no longer valid, automatically migrate data in database to proper values, given some set of business rules.

I am interested in implementing a framework that allows developers to manage and deploy these changes with the same ease that we manage and deploy our code.

So the first question is: 1. What tools/frameworks are out there that provide this capacity?

In general, this seems to be an issue in any given language and platform. In my specific case, I am deploying a .NET MVC2 application which uses Fluent NHibernate for database abstraction. I already have in my deployment process a tool which triggers NHibernate's SchemaUpdate - which is awesome.

What I have built up to address this issue in my own way, is a tool that will scan target assemblies for classes which inherit from a certain abstract class (Deployment). That abstract class exposes hooks which you can override and implement your own arbitrary deployment code - in the context of your application's codebase. the Deployment class also provides for a versioning mechanism and the tool manages the current "deployment version" of a given running app. Then, a custom NAnt task glues this together with the NAnt deployment script, triggering the hooks at the appropriate times.

This seems to work well, and does meet my goals - but here's my beef, and leads to my second question: 2. Surely what I just wrote has to already exist. If so, can you point me to it? and 3. Has anyone started down this path and have insight into problems with this approach?

Lastly, if something like this exists, but not on the .NET platform, please still let me know - as I would be more interested in porting a known solution than starting from zero on my own solution.

Thanks everyone, I really appreciate your feedback!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

掩耳倾听 2024-10-27 03:55:10

每个主要版本都有一个脚本来创建满足您所需的确切要求的环境。

对于次要版本,有一个脚本可以分为多个版本并逐步改变环境。这样做有一些很大的好处

  1. 您可以通过阅读脚本并将其与发行说明和更改日志进行匹配来查看环境随时间的变化。
  2. 您可以通过运行最新的主要脚本和最新的次要脚本来创建全新的环境。
  3. 您可以通过指定停止于某个次要版本来创建先前版本的全新环境(可能用于测试目的)。

Each major release, have a script to create the environment with the exact requirements you need.

For minor releases, have a script that is split into the various releases and incrementally alters the environment. There are some big benefits to this

  1. You can look at the changes to the environment over time by reading the script and matching it with release notes and change logs.
  2. You can create a brand new environment by running the latest major and then latest minor scripts.
  3. You can create a brand new environment of a previous version (perhaps for testing purposes) by specifying it to stop at a certain minor release.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文