Non-compliance with referential integrity is a risky thing if you are absolutely and completely not sure that ANYONE, BUT YOUR application will never forget the data in this table (and that your application is, of course, checked to ensure that it maintains integrity)
In a practical scenario, I believe that this approach is risky, because as soon as the system works in real time, there is always a chance that other applications will appear, especially tools and patches for data migration / some direct data manipulation in some urgent scenarios - who ultimately manipulate the data and in the absence of restriction, they will not be able to identify the relationship and could potentially put the wrong data.
Also, I don’t know if you need this input, but looking at your circuit, I will probably consider a small change
[Stores] StoreID (PK) StoreName [Items] ItemID (PK) ItemName Description StoreID (FK) [Sizes] SizeID (PK) SizeName [ItemSizes] ItemID (PK) SizeID (PK) Price [Users] UserID (PK) UserName
Note. I have divided the table [ItemSizes] into [Sizes] and [ItemSizes] .
Thus, you can love both the element and the size (as you are doing now), or even an element of a certain size.
[FavouriteSizes] UserID (PK) (FK) SizeID (PK) (FK) IsActive [FavouriteItemSizes] UserID (PK) (FK) ItemID (PK) (FK) SizeID (PK) (FK) IsActive [ItemRatings] UserID (PK) (FK) ItemID (PK) (FK) Rating IsActive
To summarize, adding IsActive fields even to your Favorites and Rating tables - in addition to your main tables - using WHERE IsActive checks and makes favorites / ratings soft - are deleted when an item / item size / size is deleted, and then the presence additional logic when displaying your favorites / ratings, to indicate the absence of previously added ratings / favorites for the user, it seems to me the best option.
I'm not sure how IsActive validation works with the EF-havent used by EF, but in general I would say that verifying that validation is always present in all requests is easy, ensuring that a specific point is validated - as part of the process review. Usually this becomes the second nature of the team and an extra effort to ensure that the verification is negligible.