For questions about structuring the data within a database. How to lay out tables, whether to use a relational DB or not, etc.

learn more… | top users | synonyms

-1
votes
0answers
14 views

Using Neo4j in ASP.NET application when collaborating with SQL Server?

I'm going to develop an online video platform with the feature of social network using ASP.NET. In the requirements, users can not only upload, watch and download videos, but also make friend with ...
0
votes
0answers
28 views

Saving tabular, spreadsheet-like data in a relational database?

I'm hoping this question isn't too broad or too prone to opinionated answers, since I could really use some pointers. I'm trying to come up with a way to persist tabular, spreadsheet-like1, data in a ...
4
votes
2answers
77 views

Database design, processor vs inconsistency

I was wondering, if I have a table that stores, lets say, a user's transactions, then when I need to fetch the user's current balance I would have to go and use SUM() like SELECT SUM(value) FROM ...
2
votes
2answers
35 views

How should I structure a DB schema to include multiple market segmentation data?

A client has recently expressed a wish to assign their market segmentation labels to their customers, so that they can sort by market segmentation in their dashboards ("show me all the VIP customers ...
-3
votes
0answers
68 views

Javafx show a views with different numbers of columns and rows, with the same class and method [closed]

I can use Javafx with or CSS or both, no problem. I work in Eclipse. But I want show in an AnchorPane or something else a SQL view, what is not fix. I could have 20 or 30 colums, with different names. ...
1
vote
1answer
47 views

How to associate similar data with different tables in a database?

My application has users and ads. A user has a unique email. An ad belongs to a user (so, the ads table has a user_id FK, that is simple). Every ad can also have multiple emails and phone numbers ...
1
vote
1answer
36 views

How to model the database tables for calculating on peak and off peak usage data

I am using MS Sql Server and my system contains power usage data in one table as timestamp and values for KW(two columns). This data is collected at 1 hour interval. At the end of the month I need to ...
8
votes
3answers
292 views

How to share a code base among 10+ projects and minimize pain?

I have a number of applications that share the same data in the same database. To try and minimize redundancy of code the Data Access Layer is a shared project. This prevents each project from needing ...
5
votes
6answers
174 views

Should I add a “boolean meaning” to another column?

Is it a good/bad practice to add a "boolean meaning" to other fields? For instance, let's say I'm modeling events, that might be recurring or not. I can have: A boolean column that holds if the ...
2
votes
1answer
53 views

Getting posts from users that are being followed: two different implementations

I have two different implementations for retrieving posts from the users someone is following and I want to know which one you would recommend using. First I'l show you the tables, and then the two ...
0
votes
1answer
45 views

Entity Framework Code First, C# class separation and EAV

I'm in the process of redesigning a portion of my ASP.NET MVC application. I'm currently using Entity Framework 6.1 code first approach. I've been reading as of late that (Correct me if I'm wrong, I ...
1
vote
3answers
71 views

Are crow feet notation and uml notation same?

Does crow feet lies under the sub category of the UML notation or it is a whole other approaches. As far i have seen only difference between two of them is that crow feet uses crow symbol ...
0
votes
5answers
127 views

Database design - When should a table column actually be a table?

Compare Database #1 and Database #2 below DATABASE #1 POSTS--------------------------------- |___Id________Category_Id______Body__| | 1 "For Sale" "...." | | 2 ...
3
votes
2answers
116 views

Proper design for models

I have a class called ReplaceRule this is used by 2 classes DocumentRuleViewModel and SectionRuleViewModel as a List<ReplaceRule> in both Question 1: In my database implementation I have 2 ...
1
vote
3answers
45 views

Archiving data by semester

The problem is similar to this question, but not a duplicate. What I'm looking for is a better solution than my current one. I'm building a web application for a department in my university, and due ...
1
vote
1answer
58 views

My web app uses a number of photo hosting APIs. What would be an effective database design to store their limitations?

For the sake of an example, let's say I'm using Picasa, Flickr and 500px APIs, and that each of the services has limitations on these simplified parameters: overall account space individual file ...
0
votes
1answer
41 views

Full data history, current values can be rebuilt ignoring provisional or invalidated changes

I would like to create a website for a local school and then offer it to others. The school's main headache at the moment is capturing student marks and comments at the end of each school term. The ...
5
votes
3answers
381 views

Is it ok to have a class that only has boolean properties?

Scenario We have a class Vehicle, this class contains some properties to define the object such as a CarBrand, TransmissionType, Color, etc.. A car (vehicle) also has options, these days a lot of ...
1
vote
0answers
33 views

Creating a new table referencing older one vs just creating a column

I'me developing an iOS chat application and working on the db design for the contacts feature. There are 2 kinds of contacts- Unsaved Contacts - Contacts with who you've conversed with, but not ...
1
vote
0answers
24 views

Offsetting high usage in a multi-tenant database environment?

I'm writing a research essay over distributed cloud-based systems, and one of the topics that I'm trying to touch on is potential solutions to high database utilization in a single-database ...
3
votes
3answers
142 views

When dealing with tens of billions of rows in a web app table, would a NoSQL database be noticeably faster than a relational one? [closed]

I'm currently designing a conceptual web app, where users can submit posts, comments, and "like"/"dislike" both of those. However, I am not sure of how to store the (dis)likes, because of how many ...
0
votes
0answers
19 views

Is having a singleton collection in Mongo (i.e. equivalent of an SQL table with one row) an anti-pattern?

I've been looking for ways to implement this, and haven't found it anywhere, so wonder if I'm doing something silly. Essentially I have a set of information which is relevant to the entire ...
0
votes
0answers
26 views

Should I use weak entity instead of regular to describe my kind of components?

First time trying to make a E/R model of my database. Trying to understand weak entities and regular entities. Should I make the CPU, RAM, Mainboard, etc. entities weak instead of regular?
5
votes
3answers
61 views

What are the theory behind implementing two mirrored HashMaps that can accept write operations? Do I need a broker to mediate conflicting writes?

So imagine two HashMaps that need to be mirrored across two different machines, A and B. Whenever I make a modification to machine A, machine B sees it and vice-versa. Problem is: These two hash maps ...
4
votes
2answers
60 views

Is it a good idea not to embed certain one-to-one relationships in a Mongo database?

I'm designing a NoSQL database schema - MongoDB in particular - and I'm wondering if it's a good idea not to embed certain one-to-one relationships. For one example, I have an accounts collection, ...
1
vote
1answer
58 views

How many vertices/nodes are too many in a graph and stop being beneficial?

Background I'm working on a project that requires me to keep track of transactions as well as the flow of items in a game. In order to do that, I'm storing those transaction in a graph db ...
5
votes
3answers
168 views

Use of booleans in a database

I'm using Visual Studio 2013, .Net 4.5 and SQL Management Studio 2012. I have a table that tracks offices in my database. On the application side there are a some display rules regarding the layout ...
0
votes
0answers
32 views

Which is the best way to manage multI-account multi-user web application ?

I Am junior web developer, currently I developing school application with PHP and MYSQL, after finishing the app I would like to distribute more schools by allowing them to register in the app and use ...
3
votes
5answers
195 views

Is it a bad practice to have a “record status” column in a database table?

I have to clarify first that the status column is not intended to reflect the status of a real-world item represented by the record (row) in the table. Rather, it is intended to show the status of the ...
1
vote
1answer
58 views

How to uncouple and reuse persistence logic, user interface logic and business logic amongs embedded software projects

I have been working in embedded devices business more than 5 years as a software engineer. Most of the times our hardware manufacturers provide a Software Development Kit for their reference boards. ...
2
votes
2answers
38 views

SQL - Design concepts - Relationships - Referential Integrity - Cascading

THE SCENARIO I learned about basic database design concepts such as basic CRUD operations, referential integrity, relationships, etc., years ago. I've messed around with databases and used this ...
1
vote
2answers
58 views

Database error prevention

Im designing a database structure and I would like that it's design could prevent erroneous connections. I'll make a simple example, that I think it will be easy to understand, bellow are the tables: ...
2
votes
1answer
103 views

How to handle db authentication in multi tenant application with separate databases?

In a multi tenant application with separated databases for each tenant, what would be the best way to authenticate connection to each of these separate databases. My goal is to: Main security ...
0
votes
1answer
38 views

Recursive partitioning example

I am trying to understand an example in Chapter 12 (Query Processing) of Database System Concepts, Sixth Edition. A relation does not need recursive partitioning if M > nh +1, or equivalently M ...
2
votes
1answer
120 views

Should I store cryptographic hashes as a blob or as a string?

I'm new to MongoDB and am wondering how to decide to store some cryptographic hashes. Should I store the binary data itself, as a blob, or should I store its string representation as a string? My ...
2
votes
1answer
41 views

How to store 1:n self reference (dependencies) in relational database

What is a clean way to store items that reference multiple other items of the same type in a relational database? Say I have a list of jar files and their dependencies: package1 depends on ...
6
votes
3answers
107 views

Storing hours a merchant is open in postgres

In postgres, I need to store the hours a merchant is open each week. Essentially, the information you'd see posted on a sign in the merchant's door: Mondays: Closed Tuesday-Friday: 9am-1pm, 2pm-6pm ...
0
votes
0answers
29 views

Unifying database interface for multiple authentication methods

I'm working on a project with Mongo as the db. Currently, we only allow users to sign up with email and we look them up in the db by email address. But now we're moving to allow users to sign up ...
2
votes
0answers
122 views

How should I store usernames and passwords for user login using php/cassandra?

I am new to NOSQL and Cassandra. I am not sure if I should store usernames and password in Cassandra. If I should, what is the best way to do that? I am getting lots of conflicting ideas from ...
1
vote
2answers
54 views

DB Design for non static front-end

I have a question about best practices to design a database which have to hold the following data: There is a page with a questionnaire which has default questions like Firstname, Lastname, Street... ...
0
votes
0answers
25 views

Best way to create “attributes” for Neo4j node?

I have this node labeled "Person" and these various items from what would be a class, in a conventional DB. For example: Teacher, Lumber, Magician, Artist and Painter. They should all fit in the same ...
1
vote
1answer
41 views

User account model with two or three possible profile

My application will have at least two types of users: clients and companies, these are the types of profiles. Because each type of profile requires different additional information, it will be ...
1
vote
2answers
54 views

Difficult design with multiple associations between two entities

I'm trying to design the data schema and the restful api for a specific case. In my system I have several users and several books. Every book can have several users as authors and at the same time ...
2
votes
3answers
145 views

How can I store incomplete records but enforce data correctness?

I'm in the planning/design stages of a new project, and I'm having trouble coming up with a good way to handle one of the requirements: Users must be able to create a new record and save it as ...
2
votes
2answers
109 views

Database Design - lots of small tables or fewer, bigger tables?

So I'm designing a database for a project which is going to enable beauty businesses to create a profile, clients to create a profile and for the client's to be able to book appointments and for the ...
5
votes
2answers
75 views

Junction table related to another junction table

I'm defining a DB structure, and I have a strong feeling I'm not doing it right. I have hotels that can be configured to offer some optional services (airport pickup, massage), that can in turn be ...
-1
votes
1answer
63 views

Is there a generally accepted definition of “Secondary Index” independent of DB product? [closed]

Is the definition for "Secondary Index" anything more specific than just "Any index that is not the primary index"? EDIT: Here is some research I have done: Search Google. I evaluated the first 20 ...
42
votes
8answers
6k views

Is the use of NoSQL Databases impractical for large datasets where you need to search by content?

I've been learning about NoSQL Databases for a week now. I really understand the advantages of NoSQL Databases and the many use cases they are great for. But often people write their articles as if ...
9
votes
8answers
815 views

Designs and practices to guard against erroneous null entries from database

One part of my program fetches data from many tables and columns in my database for processing. Some of the columns might be null, but in the current processing context that is an error. This should ...
-2
votes
1answer
74 views

Should I be using XML to store configuration values in a database?

There are a couple of answers on SE comparing single-row table vs. name-value-pair table used for config settings, but I haven't seen anyone arguing for using XML (or JSON) as a name-value pair ...