I know that the topic is a bit old, but in my application I try to use Entity Framework as an ORM for my custom tables. Roy, could you explain why using the same database server is not a good idea?
You can if you want, it really depends on what you are going to be storing and how it will be used to be honest, for anything largish that has frequent activity best practice would be to use another database if possible
Hi, it more preference than that you can't. I worded it like that a couple of months ago because it really is a bad practice in general. So why?
Separation of concerns, using the same database might seem convenient, maybe even referencing some umbraco tables. Umbraco will change, your code has to change along. Separating concerns will likely increase the lifespan of your application and reduce the difficulty in upgrading.
For security reasons; Umbraco has it's own tables and things it need. Data you might want to split this from your own data to make sure it stays secure. Especially when using a different ORM. Your database might require different roles and users for example.
Migrating. You don't want your tables to be collateral on an Umbraco upgrade. Not saying it happens right now. But it can, definitely if they decide to go to EF Core. Using code first from the sources of two products on one database not a good idea.
Performance. Splitting your database would allow you to scale your database with it's usage aside from the CMS. This is a more advanced subject and 90% of Umbraco sites won't meet the traffic for requirements like this.
Not every dot is as import to you as it might be to me. And we can probably add more bullets. But it is just a bad practise in general which usually has many reasons.
So moral of the story, don't bind your data to another application even if it is a as good designed CMS as Umbraco. Don't be subject to the butterfly effect.
To add --- you might also have other existing databases you need to tie into an Umbraco site. Mine has several and I use EF to connect to those databases and marry up data with Umbraco data (where needed) in the code.
Umbraco 8 Entity Framework
How does one go about incorporating the entity framework into Umbraco 8?
Umbraco does not use entity framework in version 8. (Nor in 9+ versions thus far).
You can set-up a entity framework database for your own things alongside Umbraco. Just follow the guides on Microsoft's documentation.
You should be able to use the same database server as Umbraco, but do not use the same database.
https://learn.microsoft.com/en-us/ef/ef6/get-started
I know that the topic is a bit old, but in my application I try to use Entity Framework as an ORM for my custom tables. Roy, could you explain why using the same database server is not a good idea?
He actually said,
but do not use the same database.
I was in a hurry so of course I worded the question wrong... silly me...
I meant to ask: why I should not use the same database?
Sorry for the confusion!
You can if you want, it really depends on what you are going to be storing and how it will be used to be honest, for anything largish that has frequent activity best practice would be to use another database if possible
Hi, it more preference than that you can't. I worded it like that a couple of months ago because it really is a bad practice in general. So why?
Not every dot is as import to you as it might be to me. And we can probably add more bullets. But it is just a bad practise in general which usually has many reasons.
So moral of the story, don't bind your data to another application even if it is a as good designed CMS as Umbraco. Don't be subject to the butterfly effect.
To add --- you might also have other existing databases you need to tie into an Umbraco site. Mine has several and I use EF to connect to those databases and marry up data with Umbraco data (where needed) in the code.
Thank you all for your input and clarification!
is working on a reply...