如何使用一个SQL数据库设置多个版本的MVC saas应用程序 [英] How to setup multiple versions of MVC saas application with one SQL database

查看:95
本文介绍了如何使用一个SQL数据库设置多个版本的MVC saas应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b

我正在使用带有SQL数据库的Asp.net(MVC)构建一个多租户模式saas应用程序。



每周我都想为用户发布新版本,因此我的应用程序网址将类似于

v1.mydomain.com,v2.mydomain.com,v3.mydomain.com等。



用户可以根据需要使用任何版本。

如果较新的版本有bug,他可以转到以前的版本

如果用户可以使用V1,那么他将使用Version1(v1.mydomain.com)



但我们所有版本只有一个数据库,问题是** SQL服务器表更改和程序更改**



例如:

在V1中,客户表我们有15列。

在V2中,我们添加了5列

在V3中,我们添加了3列



我们使用存储过程来执行所有数据库操作。

在V1中,



代码我们传递的15个参数=> db也有15个参数

在V2中,


代码我们传递了15个参数=>我们需要将相关的存储过程改为15个参数。



这里V1应用程序只通过11个parms,现在V1应用程序出错。



我没有'我能找到我想要的东西。



我们如何将单个数据库用于多个应用程序版本,有没有办法做到这一点。 />


我的尝试:



Hi
I am building a multi-tendent mode saas application using Asp.net(MVC) with SQL database.

Every week i want to release new version for users, so my application url will look like
v1.mydomain.com, v2.mydomain.com, v3.mydomain.com and etc.

User can use any versions, based on their need.
if newer version has bugs, he can go to previous versions
if user is ok with V1, then he will use Version1 (v1.mydomain.com)

But we have only one database for all versions, the problem is **SQL server table changes and procedure changes**

For example :
In V1, customers table we have 15 columns.
In V2, we have added 5 columns
In V3, we have added 3 columns

we are using stored procedure to execute all of our database operations.
In V1,

from code we are passing 15 parameters => db also have 15 parameters
In V2,

from code we are passing 15 parameters => we need to alter the related stored proceudre as 15 parameters.

Here V1 application will pass only 11 parms, now V1 app gets error.

I haven't been able to find what I'm looking for.

How can we use the single database for multiple application versions, is there any way to do this.

What I have tried:

what is the best way for this?

推荐答案

为每个版本使用不同的数据访问层(DAL)。



同样的电话;相同的存储过程(SP)。



v1和v2 DAL为他们不支持的那些参数的ORM /物理层提供SP参数默认值。



DAL是作为单独的DLL提供的;具有匹配的接口和数据传输对象(至少在名称中)。



(或者更改当前的数据访问方法以允许默认参数;意思是,调用者代码不会改变,只是被调用的方法签名)。
Use a different "data access layer" (DAL) for each version.

Same calls; same stored procedures (SP).

The v1 and v2 DAL's provide SP parameter defaults to the ORM / physical layer for those parms they don't support.

The DALs are provided as separate DLL's; with matching interfaces and data transfer objects (at least in "name").

(Or change your current "data access" methods to allow for "default parameters"; meaning, the caller code doesn't change, just the called method signatures).


这篇关于如何使用一个SQL数据库设置多个版本的MVC saas应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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