我应该在哪里维护ConnectionString?如果我有MasterDB和ClientDB [英] Where should i maintain ConnectionString ? If i have MasterDB and ClientDB

查看:88
本文介绍了我应该在哪里维护ConnectionString?如果我有MasterDB和ClientDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



对于我的客户,在5个不同的位置设有5个不同的分支机构(零售店).因此,我想到要维护五个不同的SQL数据库(C1,C2 ... C5)和一个主数据库(M)".此主数据库用于维护用户帐户"和登录详细信息".因为只有ADMIN才能为用户创建用户ID和密码,所以将其存储在主数据库中.


现在的问题是,我可以使用一个引用我的主数据库"的连接字符串"创建一个ASP.NET应用程序.哪个检查有效用户并登录.但是登录后,我将与不同数据库"ClientDB"(分支数据库,C1或C2或... C5)建立不同的连接.
现在,我应该在哪里维护这些ClientDB的连接字符串?

在SESSION中? (或)在主数据库本身中? (或)还有其他方法可以实现高安全性吗?



请帮帮我...



For my client, having 5 different branches(Retail Shop) in 5 different locations. Hence i thought of maintain "Five different SQL databases(C1,C2...C5) and One Master database(M)". This Master Database is for Maintaining "user Accounts" and "Login Details". Because only ADMIN can create userID and Password for Users, Which is stored here in Master DB.


My Problem is now, i can create an ASP.NET application with one "Connection String" which refer my "Master DB". Which check for Valid User and Logging in. But after Logging in, i would have different connection with different database which is "ClientDB"(branch database, C1 or C2 or...C5).
Now, Where should i maintain these ClientDB''s connection String ???

In SESSION ?? (or) In master DB itself ? (or) Is there any other way to do it with high security ??



Please help me out...

推荐答案

然后使用5个连接字符串.根据位置选择相关的连接字符串.
Use 5 connection string then. Based on the locations select the related connection string.


分支应该在连接失败的情况下具有它们需要的所有内容.

因此,您的连接字符串将全部位于分支机构的本地.

您应该在分支机构和主服务器之间复制/同步"数据.
Branches should have everything they need in place in case of connection failures.

So your connections strings will all be local to the branch.

You should "replicate/sync" your data between branches and the master.


我将编写一个知道所有数据库在哪里的Web服务,并且该Web服务将使用一个合适的数据库.提出要求.实际上,我可能会将所有数据库都放在一台服务器上,到那时,连接strinbg唯一改变的就是数据库实例,用户ID和密码.
I would write a web service that knows where all of the databases are, and this web service would use the one appropriate to the request being made. In fact, I''d probably put all of the databases onto a single server, and at that point, the only thing that changes in the connection strinbg would be the database instance, the user id, and the password.


这篇关于我应该在哪里维护ConnectionString?如果我有MasterDB和ClientDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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