data-modeling

Entity Framework multitenant shared data architecture: single column, multiple foreign keys

帅比萌擦擦* 提交于 2019-12-18 15:49:57
问题 I have the following data structure: //property Notification abstract class BindableBase { } //base class for all tenant-scoped objects abstract class TenantModelBase : BindableBase { int TenantId; } abstract class Order : TenantModelBase { Customer Customer; //works: mapped using TenantId and CustomerId Product Product; //again, works with TenantId and ProductId string ProductId; string CustomerId; } class Customer: TenantModelBase { string CustomerId; } class Product : TenantModelBase {

How do I model (GitHub-like) permissions relationally?

自闭症网瘾萝莉.ら 提交于 2019-12-18 13:22:33
问题 tl;dr: how do i implement a permissions model like (e.g.) github's Updated to try to address some of @philipxy's comments: I am planning to implement a permissions model similar to github's: users users can be in groups users can be in organizations groups can be in organizations a user will be permitted any of C, R, U, and D operations on an asset, group, or organization as : an individual user who has been permitted those (any of C, R, U, D) operations a member of a group which has been

Aggregation in Cassandra across partitions

Deadly 提交于 2019-12-18 09:38:35
问题 I have a Data model like below, CREATE TABLE appstat.nodedata ( nodeip text, timestamp timestamp, flashmode text, physicalusage int, readbw int, readiops int, totalcapacity int, writebw int, writeiops int, writelatency int, PRIMARY KEY (nodeip, timestamp) ) WITH CLUSTERING ORDER BY (timestamp DESC) where, nodeip - primary key and timestamp - clustering key (Sorted by descinding oder to get the latest), Sample data in this table, SELECT * from nodedata WHERE nodeip = '172.30.56.60' LIMIT 2;

Star schema, normalized dimensions, denormalized hierarchy level keys

我只是一个虾纸丫 提交于 2019-12-17 23:43:41
问题 Given the following star schema tables. fact, two dimensions, two measures. # geog_abb time_date amount value #1: AL 2013-03-26 55.57 9113.3898 #2: CO 2011-06-28 19.25 9846.6468 #3: MI 2012-05-15 94.87 4762.5398 #4: SC 2013-01-22 29.84 649.7681 #5: ND 2014-12-03 37.05 6419.0224 geography dimension, single hierarchy, 3 levels in hierarchy. # geog_abb geog_name geog_division_name geog_region_name #1: AK Alaska Pacific West #2: AL Alabama East South Central South #3: AR Arkansas West South

Multiple yet mutually exclusive foreign keys - is this the way to go?

浪子不回头ぞ 提交于 2019-12-17 19:51:55
问题 I have three tables: Users, Companies and Websites. Users and companies have websites, and thus each user record has a foreign key into the Websites table. Also, each company record has a foreign key into the Websites table. Now I want to include foreign keys in the Websites table back into their respective "parent" records. How do I do that? Should I have two foreign keys in each website record, with one of them always NULL? Or is there another way to go? 回答1: If we look into the model here,

Database modeling for a weak entity

主宰稳场 提交于 2019-12-17 16:12:05
问题 I have 2 tables in my database orders and orderHistory . ----------------- ----------------------- | orders | | orderHistory | ----------------- ----------------------- | orderID (PK) | | historyLineID (PK) | | orderDate | | status | | price | | quantity | ----------------- ----------------------- Now an order can have multiple history lines . However, a history line can't exist on its own. I heard this is called a weak entity and therefore the PK from orders must be part of the PK of table

What is the best way to represent “Recurring Events” in database?

半世苍凉 提交于 2019-12-17 15:03:30
问题 I am trying to develop a scheduler- and calendar-dependent event application in C#, for which a crucial requirement is to represent recurring events in the database. What is the best way to represent recurring events in a database? More Details: While creating the event I am also sending invites to the certain users and the invitees should be allowed to login to the meeting only during the specified window(meeting duration) or may be decline the login when the invitee attempts to login say, 5

Handling incremental Data Modeling Changes in Functional Programming

安稳与你 提交于 2019-12-17 10:32:43
问题 Most of the problems I have to solve in my job as a developer have to do with data modeling. For example in a OOP Web Application world I often have to change the data properties that are in a object to meet new requirements. If I'm lucky I don't even need to programmatically add new "behavior" code (functions,methods). Instead I can declarative add validation and even UI options by annotating the property (Java). In Functional Programming it seems that adding new data properties requires

Handling incremental Data Modeling Changes in Functional Programming

大兔子大兔子 提交于 2019-12-17 10:32:14
问题 Most of the problems I have to solve in my job as a developer have to do with data modeling. For example in a OOP Web Application world I often have to change the data properties that are in a object to meet new requirements. If I'm lucky I don't even need to programmatically add new "behavior" code (functions,methods). Instead I can declarative add validation and even UI options by annotating the property (Java). In Functional Programming it seems that adding new data properties requires

Firestore: Query by item in array of document

血红的双手。 提交于 2019-12-17 03:08:14
问题 I have a document "user" which has a key called "photos". Here is an array of strings being saved, namely the IDs of the "photo" documents. I want to query "user" by this "photos" field: I want all users who have this ID in the "photos" property. Is this possible through firestore? 回答1: Added 'array-contains' query operator for use with .where() to find documents where an array field contains a specific element. https://firebase.google.com/support/release-notes/js 5.3.0 Update : also