database-design

database design for notification settings

末鹿安然 提交于 2020-05-10 06:25:49
问题 A user can turn on or off notification settings for his account, for notifications such as Changed Account Profile Information, Received New Message etc Notification can be sent via email or mobile phone (either push or sms), user can have 1 email only and many mobile phone devices. Is there any way you would improve the following database design or would you do it differently? let me know thanks USER_NOTIFICATION_SETTING Id UserId Notification_SettingCode NotificationTypeCode UserDeviceId --

Storing Images In Filesystem As Files Or In BLOB Database Field As Binaries [duplicate]

折月煮酒 提交于 2020-05-08 16:08:34
问题 This question already has answers here : Closed 10 years ago . Possible Duplicate: Storing Images in DB - Yea or Nay? Which approach is better? What are the advantages and disadvantages? Advantages of storing images in database, in my opinion, are: database integrity (it's easier to keep all database entries valid with foreign keys than to keep an eye on filesystem and make required changes there during each change in database) less work and easier maintenance (you only need to take care of

Storing Images In Filesystem As Files Or In BLOB Database Field As Binaries [duplicate]

China☆狼群 提交于 2020-05-08 16:06:09
问题 This question already has answers here : Closed 10 years ago . Possible Duplicate: Storing Images in DB - Yea or Nay? Which approach is better? What are the advantages and disadvantages? Advantages of storing images in database, in my opinion, are: database integrity (it's easier to keep all database entries valid with foreign keys than to keep an eye on filesystem and make required changes there during each change in database) less work and easier maintenance (you only need to take care of

Why asp.net Identity user id is string?

假装没事ソ 提交于 2020-04-29 06:51:46
问题 I want to use System.Guid type as an id for all of my tables in asp.net web api application. But I also use Asp.net Identity, which using a string -type id (to store guids as well). So I wonder why is it using string id instead of System.Guid by default? And what is better choice to use through all the application - Guid id or string -guid id? In case of using string - what is the most proper and reliable way to generate new id - in code or in database? 回答1: With ASP.NET Core, you have a very

MongoDB (Mongoose) data structure question

喜夏-厌秋 提交于 2020-04-16 09:55:55
问题 I'm curious about the best way to represent this kind of situation in Mongo. I have my own idea, but I'm curious on what the general consensus/best practice actually would be. Imagine I have two collections:- Employees --> _id --> FirstName --> Surname --> Email Comments --> _id --> PersonReference --> CommentDate --> Comment Now imagine that Employees can come and go and the 'Employees' collection is always up-to-date. However, in the event that an employee has ever made a comment, the full

What databases do the World Wide Web's biggest sites run on? [closed]

ぃ、小莉子 提交于 2020-04-05 07:03:23
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . This question is meant to serve as a list of databases and their configurations that the major web sites use and would be a great reference for anyone thinking of scaling their web site to the size of Twitter, Facebook or even Google. Please keep your answers to a minimum and be sure to cite any sources used.

How I can define this constraint?

百般思念 提交于 2020-03-23 14:33:18
问题 I am designing a database for a parking lot in Postgres. I need to define a constraint (or similar) to verify the Id_Lot in Ticket is empty in the table "Lot" . How I can do it? The relevant tables are: Ticket: "Id_Ticket" serial PRIMARY KEY, "Date_Entrance" date NOT NULL, "Time_Entrance" time without time zone NOT NULL, "License_plate" varchar(6) NOT NULL references "Vehicle"("L_Plate"), "Id_Lot" varchar(4) NOT NULL references "Lot"("Code") Lot: "Code" varchar(4) NOT NULL PRIMARY KEY, "Type"

How I can define this constraint?

℡╲_俬逩灬. 提交于 2020-03-23 14:32:53
问题 I am designing a database for a parking lot in Postgres. I need to define a constraint (or similar) to verify the Id_Lot in Ticket is empty in the table "Lot" . How I can do it? The relevant tables are: Ticket: "Id_Ticket" serial PRIMARY KEY, "Date_Entrance" date NOT NULL, "Time_Entrance" time without time zone NOT NULL, "License_plate" varchar(6) NOT NULL references "Vehicle"("L_Plate"), "Id_Lot" varchar(4) NOT NULL references "Lot"("Code") Lot: "Code" varchar(4) NOT NULL PRIMARY KEY, "Type"

modeling many to many unary relationship and 1:M unary relationship

我的梦境 提交于 2020-03-05 01:00:16
问题 Im getting back into database design and i realize that I have huge gaps in my knowledge. I have a table that contains categories. Each category can have many subcategories and each subcategory can belong to many super-categories. I want to create a folder with a category name which will contain all the subcategories folders. (visual object like windows folders) So i need to preform quick searches of the subcategories. I wonder what are the benefits of using 1:M or M:N relationship in this

modeling many to many unary relationship and 1:M unary relationship

青春壹個敷衍的年華 提交于 2020-03-05 00:57:53
问题 Im getting back into database design and i realize that I have huge gaps in my knowledge. I have a table that contains categories. Each category can have many subcategories and each subcategory can belong to many super-categories. I want to create a folder with a category name which will contain all the subcategories folders. (visual object like windows folders) So i need to preform quick searches of the subcategories. I wonder what are the benefits of using 1:M or M:N relationship in this