Ibrahim
Ibrahim

Reputation: 41

Using the same database by two different projects

In my new work, they have two ASP.net projects. Both projects are using the same MS SQL Database. Each project has a different developing team and end users. And each project has its own tables, and there are a common tables which both projects reads/writes data, and sometimes they use this common tables to send information to each other. i.e one system insert record, the other system update a flag in this record which means 'Yeah I can see it', and update some fields, then the first system catch the data ... etc.

My first question: Is this a good design, what are the disadvantages ?

In the other hand my opinion to split the database into two databases, one for each project, and make communications between them be through web services.

My second question: which approach is the best practice, and why ?

Upvotes: 1

Views: 2791

Answers (3)

atinder
atinder

Reputation: 2090

don't see major drawbacks to the approach. Personally i would prefer database table prefixing like

project1_sometbale
project2_sometable
common_sometbale

Upvotes: 0

Sagar Shirke
Sagar Shirke

Reputation: 686

I do not think there is any problem of having two different projects sharing a common database. Instead of splitting database into two separate databases , I would suggest have single database only and create a third separate WCF project. This WCF project will have only one purpose that is act as database layer , so all the database queries will be written in that service and asp.net projects will consume it.

Advantage of this approach is that all the queries will be centralized and there will not be any duplication of queries.Also in future if any new Module comes in the system like desktop application or Mobile application then there is no need to put large efforts in database queries. Same queries can be used in all places, so maintenance will be simpler.

Upvotes: 1

RelatedRhymes
RelatedRhymes

Reputation: 428

I don't think there is any problem with having a database common for two projects.I mean, even in a single project, there are so many users updating the same table at the same time.

Upvotes: 0

Related Questions