寻找应用程序数据库重定位策略 [英] Looking for application database relocation strategies

查看:79
本文介绍了寻找应用程序数据库重定位策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景:

我们有多个数据库服务器,每个服务器上都有多个数据库。

我有50多个应用程序(桌面和Web)使用一个或多个这些数据库来自一个或多个服务器。

应用程序访问数据库的方式有多种(类型化数据集,硬编码连接字符串等)。

现在,SvrDb1服务器到达生命周期结束,因此创建了一个SvrDb5服务器。

SvrDb1上的一些数据库将移至SvrDb5,但有些可能会移动到另一个现有的数据库服务器。我们无法关闭SvrDb1,直到所有数据库都被移出它,因此保持相同的服务器名称。

我目前正面临修改每个程序中的连接字符串作为相关数据库被移动,并且可能多次移动使用多个数据库的程序。

我只是想知道其他人是如何避免这种情况的。



我的尝试:



我目前的想法是:

在DNS中为SvrDb5创建一个名为AliasDb的别名

创建一个数据库& SvrDb5 / AliasDb上的表,用于保存每个数据库的当前位置(或连接字符串,或??)的记录。

例如,记录可能包含:数据库:Customers,Location:SvrDb1

然后,在每个应用程序中,我修改它以查看AliasDb上的数据库表,获取程序所需的数据库的当前位置,相应地修改连接字符串运行时间。

将来,当SvrDb5达到使用寿命时,我将位置数据库移动到新服务器并将AliasDb DNS记录更改为指向新服务器。

当应用程序数据库移动到新服务器时,我只更改位置数据库表中该数据库的记录以反映新服务器,并且使用该应用程序数据库的所有程序将立即开始使用连接字符串中的新服务器。



另外,我认为这个资源位置数据库可以保存其他信息,比如某些服务的地址程序用于当我们的网络服务器达到使用寿命时,我可以一次移动一个服务,并为新位置进行一次更改。



任何使用得更好的人/他们想分享更简单的策略?

Scenario:
We have multiple database servers with multiple databases on each.
I have 50+ applications (desktop and web) that use one or more of those databases from one or more servers.
There are various ways that the applications access the databases (typed dataset, hard coded connection string, etc.).
So now, SvrDb1 server is reaching end of life, so a SvrDb5 server is created.
Some of the databases on SvrDb1 will move to SvrDb5, but some might move to a different existing database server. We can't shut down SvrDb1 until all of the databases are moved off of it, so keeping the same server name is out.
I'm currently faced with modifying connection strings in each program as the related database is moved, and possibly multiple times for a program that uses multiple databases.
I'm just wondering how others have avoided this situation.

What I have tried:

My current thought is to:
Create an alias in DNS for SvrDb5 called AliasDb
Create a database & table on SvrDb5/AliasDb to hold a record for the current location (or connection string, or ??) for each of the databases.
For example a record might contain: Database:Customers, Location:SvrDb1
Then, in each application, I modify it to look to the database table on AliasDb, get the current location for the database(s) required by the program, modify the connection string(s) accordingly at run time.
In the future, when SvrDb5 reaches end of life, I move the Location database to the new server and change the AliasDb DNS record to point to the new server.
When an application database moves to the new server, I only change the record for that database in the location database table to reflect the new server, and all programs that use that application database will immediately start using the new server in their connection strings.

Also, I'm thinking this "Resource Location" database could hold other information, like the address of some of the services the programs use for when our web servers reach end of life, I can move each service one at a time, and make one change for the new location.

Anyone using much better/simpler strategies they'd like to share?

推荐答案

我所做的是在DNS中创建一个别名。别名指向数据库服务器IP。



应用程序中的连接字符串指向别名数据库服务器名称,而不是实际的服务器名称或其IP。 />


现在,当需要切换数据库服务器时,您只需修改别名以指向新服务器。无需在任何地方更改连接字符串。
What I've done is create an alias in DNS. The alias points to the database server IP.

The connection strings in the app point to the alias database server name, not the actual server name or its IP.

Now, when it comes time to switch database servers, you just modify the alias to point to the new server. No need to change connection strings anywhere.


这篇关于寻找应用程序数据库重定位策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆