Contents
Use a (single) database that is shared by multiple services. Each service freely accesses data owned by other services using local ACID transactions. The OrderService and CustomerService freely access each other’s tables.
Here, Squelch.Data contains all of my models and db contexts, Squelch.Core contains core business logic, and my two “applications” ( Squelch.Portal ad CdrImport ), and the various test cases, all reference these base class libraries. I would create a separate data access project. It is good practice to separate your data layer out anyhow.
When do you query data owned by multiple services?
Some business transactions need to query data that is owned by multiple services. For example, the View Available Credit use must query the Customer to find the creditLimit and Orders to calculate the total amount of the open orders. Some queries must join data that is owned by multiple services.
How to expose the EF DB context in a separate project?
Another question: should I expose the EF db context in the separate project so other projects can access it? something like: I think the cleanest thing to do is create a data access project (class library) that contains just your models and db context, and reference that from all of your other projects.
What are the disadvantages of sharing one database?
Sharing one database for amongst multiple applications has some serious disadvantages: The more applications use the same database, the more likely it is that you hit performance bottlenecks and that you can’t easily scale the load as desired. SQL Databases don’t really scale.
Which is better one database or one database?
If your database functions just as a data repository without application logic such as triggers or business package code, it would be better to have a single database and encapsulate business level functionality to services that use the database for all their actions.
When to consider multisite Drupal sharing same code base?
If the sites are for the same client and it is to simplify the scope of each site, consider it. If the sites are similar in functionality, use the same modules or use the same Drupal distribution, consider it. If you have limited resources / staffing, but lots of sites to manage and maintain, definitely consider it.