Can different parts of the the OFBiz application connect to different databases? e.g:
-Party Management => connect to database 1
-Catalog Management => connect to database 2
-Working in the same instance of Ofbiz application.
My plan is to create tenants in OFbiz and have different parts of OFBiz connect to the tenant, while others connect to the default/original OFBiz database.
The short is yes, you can, the long answer is probably you don't want to do that because of existing interapp dependencies at entity level.
First you have to understand how all it fits together:
Ofbiz entities are usually defined in entitymodel.xml and referenced in ofbiz-component.xml Most of the existing components have only this level of configuration. With such a configuration, the entities belong to the default group called "org.ofbiz". Then in entityengine.xml the group is assigned to a datasource:
<group-map group-name="org.ofbiz" datasource-name="localpostgres"/>
This is how a table is assigned to group, then the group is assigned to the database.
So to assign all the entities form a component to a new database what you have to do:
Create a new entity group definition in each component and assign the entities to that group:<entity-group group="org.ofbiz.tenant" entity="Tenant"/>
Reference the group definition from the ofbiz-component.xml
<entity-resource type="group" reader-name="main" loader="main" location="entitydef/entitygroup.xml"/>
In entityengine.xml assign the new group to a different datasource:
<group-map group-name="org.ofbiz.tenant" datasource-name="localpostgres"/>
For an example have a look at olap and tenant groups.
You can do the above steps and have your entities in a separate database, if you are creating a new component or if you want to do that for the components in specialpurpose folder. If you want to do this to existing component from framework or applications folder (like the content component you mentioned) you will notice that components have dependencies (entity relations) and moving some of the entities to a separate database will break that.
Related
Within my Django app I currently only have one DB, under settings it is default. What I want to do is port over all of the Auth tables created by Django to a separate database, Ill say SiteAuth for now.
I have copied all of the auth tables over to the SiteAuth db, but I am not sure how to integrate those changes within the site. I know I am going to have to add another db the databases section of settings, But I am not sure how to do the migrations, or how to specify which database I want to query.
How would I do the migrations? how would I specify which database I want to query? how would my models.py change?
Thanks for all the help!
you need to write a router. Check this:
https://docs.djangoproject.com/en/2.2/topics/db/multi-db/
I would recommend to keep the auth in the default db, and move the other stuff in the new one. On the other questions the docs are very descriptive, but to summarize you need to add stuff to the Meta class of your models.
We have databases like the below image.
In Application, Once a new company registers a new database created for the company. Consider there might be multiple schemas.
Schemas would be the same for all company.
I am new to NestJS. Currently, we are managing this scenario using function call we pass database name it will create a new connection with DB using mongoose and iterate all defined models in from the database and create an object which used by application-wide.
Now, We need a new level of development. we choose NestJs.
How can we deal with this kind of technique with nestjs?
What should be a design pattern for this kind of flow?
How we will deal with Email for the registered company?
I’m seeing some inconsistent behavior between two different subscriptions when trying to create an Indexer for an Azure Search service through the Azure Portal.
I was able to successfully build the indexers in our test/ppe subscription (Microsoft) using a Cosmos DB collection as a source and the data was matched 1:1 using Edm.ComplexType and Collection(Edm.ComplexType):
Complex Types showing up in dropdown
After I verified things were working as expected, I moved to our prod subscription (AME.GBL) to do the same; however, this ability to add/edit complex types seems to be missing:
Complex Types not showing up in dropdown
Is there a reason why this ability to add complex types is available in one of our subscriptions but not the other?
Is there a feature gate in place for this ability to add/edit Complex types for an index and if there is, would it be possibly to manually override it for a given subscription ID?
Thank you!
Bradley - You are correct that in this case the Complex Type detection feature via the portal 'Import Data' workflow is currently only available via the internal Microsoft portal experience. However, this feature will be deployed publicly world-wide very soon and we are targeting 5/1/2019 for global availability via the portal. If you need to create this index with Complex Types beforehand you can use the API to set the index schema with the complex types directly.
The sample and seed data shows creating a new client in Startup.
This is fine in case of creating a client.
Are there any existing methods or provision for Updating a client. Update involves tracking the existing records from the collection fields within the clients too.
How are entities mapped from IdentityServer4.Models to IdentityServer4.EntityFramework.Entities during an update considering the records are already available in database?
What do you mean when you say client?? If you mean Client for Identity server then you can edit/configure or add more clients or other resources in your config class. While startup, identity server will loads up all the clients by itself, all because of this code:
// Add identity server.
services.AddIdentityServer()
.AddTemporarySigningCredential()
.AddInMemoryIdentityResources(Config.GetInMemoryIdentityResources())
.AddInMemoryApiResources(Config.GetInMemoryApiResources())
.AddInMemoryClients(Config.GetInMemoryClients(Configuration))
.AddAspNetIdentity<ApplicationUser>()
.AddProfileService<SqlProfileService>();
Are there any existing methods or provision for Updating a client.
Update involves tracking the existing records from the collection
fields within the clients too
Yes, you can update client as you can update any other data. Check here how you can use EntityFramework core with identityserver4
How are entities mapped from IdentityServer4.Models to
IdentityServer4.EntityFramework.Entities during an update considering
the records are already available in database?
If you check the IdentityServer4 source you will find AutoMapper is used to convert entities (namespace IdentityServer4.EntityFramework.Mappers). And an extension named ToModel has been provided
I'm building four websites. They all should have the same login-datas (user can registrate on website 1 and also can use website 2 and 3 by using the same Login-Name).
My idea was to use the MS SQL Membershipprovider (good idea?).
Now I don't know where to place the SQL-Mebershipprovider (in an extra databse? or together with the websites? -> sound like getting chaos^^)
A other idea I've read was to create a webservice to the authentification?
But I think I'm getting problems with the data consitency, because I think there is no way to point from one database to an other (linking for example the usertable in database one to the texttable in databse 2).
I want to use MVC3 and a MS SQL-database.
Any experiences or ideas?
Thanks a lot!
You can use a separate membership database to do this and just point the providers of each site at this database.
If you wanted to use the role provider you would have to have the same roles in all four websites which may not be what you want. You could use a central database to just handle authentication and then create a local user record in each website that links back to your central user database (you will have to do this linking manually i.e. no relationship). This will then let you role your own role provider for each site.