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

0
votes
3answers
110 views

A-B-C relation vs A-B, B-C, A-C relations

I't s a Database related Entity Relationship (ER) doubt: Better to have a single table storing A,B,C as a unique identifier or a Relationship. O better to split it up to three tables having then A,B - ...
1
vote
2answers
60 views

Design question - storing data twice

I have a polyglot database solution that includes the following components: a management interface that consists of a web application and a document based database (either rethinkdb or mongo) a ...
1
vote
2answers
39 views

Suitable data store for storing comments in a social media site

I have been developing a blogging site, where people can post an article or blog and others can comments on them. The site is coded in Angular.js, ASP.NET and SQL is being used a data store. For each ...
0
votes
2answers
37 views

Database Architecture - Comprehensive history of likes/shares/etc for all accounts?

The Setup This is a membership-based site. Each account is capable of: Making posts (unlimited, no restriction on frequency) Liking, sharing and commenting (on) the other posts The goal is to ...
0
votes
2answers
38 views

Designing Table To Store Hierarchy

I have a table Company and User like below... Company Table: CompanyID CompanyName etc... User Table: UserID Email UserType CompanyID etc... First I must tell you that, ...
1
vote
1answer
51 views

Does it make sense to have a custom textual data format?

We have a database backing an iOS and Android app whose primary data is a simple text field. We have a build tool which builds the database - taking a raw txt file which is a custom data format, which ...
0
votes
0answers
17 views

Ideal Graph Database model for number-heavy data…

I am trying to create a data storage for a large aggregate of very heterogeneous data. Because of the heterogeneous sources and lack of normalisation across sources, the flexibility of a Graph ...
1
vote
0answers
26 views

Should I implement an intermediate Profile table now, or wait until if/when I need it?

Traditionally the schema is very simple: User <- Post I have written the code for a Profile model to be an intermediate: User <- ProfileUser -> Profile <- Post When registering for the ...
2
votes
4answers
325 views

Data first or code first?

I have seen many questions on whether to design data first or code first when designing a new application. I wonder if some have the same conclusions/ideas as me. I come from painting/digital design/...
-1
votes
0answers
33 views

Designing DAOs for entities with common set of fields

Problem goes like this: I have 5 to 7 entities, these entities have a set of common fields and there are fields which are entity specific i.e they belong to a particular entity. Now I want a single ...
1
vote
2answers
108 views

Use (numeric) IDs over names as unique key?

I have a set of data (assume they are objects) with unique immutable names, like this: class Datum { final string name // other fields } Considering that: I don't need to support rename. (...
1
vote
2answers
65 views

General approach to an interface that will resolve a dependency to a database library

Background I often write software for systems that are responsible for testing manufactured products. For every product that gets tested, we have to generate a report for the test-results. The way ...
0
votes
2answers
61 views

Using a class for a collection element, with methods to access other collections

I'm hoping for a sanity check in my design thinking. I'm working with a small team on a website based on a MongoDB database. There are several collections in the DB -- for example, one representing ...
2
votes
3answers
94 views

Database design for a role based access system?

I'm considering different designs for a generic role library gem. The first is based off the Rolify gem but with a has_many through: relationship instead of HABTM. HABTM tables are "headless" in ...
6
votes
1answer
222 views

How should I design an ordered list resource in a restful service?

I've run into this same problem over and over again and I haven't found a solution that I really felt was optimal. Say in an app, you have an ordered list and you let the user change that order by ...
1
vote
1answer
91 views

How can I model IS-A relationship on a ledger, when having different classes of products?

This is a question on how to model database entities and relationships when it comes to storing persistent data and dealing with differently-handled types of products. Use Case Company sells various ...
1
vote
1answer
58 views

Given an entity that can have a parent, or can stand on its own, what is the best way to represent it in a relational database

Lets assume we have to model the following entities: Application : Application submitted by users Application Study: the study to determine if the Application should be accepted Consultation : A ...
0
votes
0answers
26 views

Is mixed collation in a database a problem?

I have a database where some tables are Collation utf8_general_ci and some tables are Collation utf8_bin. Is this an issue that will cause unexpected behavior, or is it just a matter of performance?
1
vote
3answers
119 views

Is there a design pattern which describes separated join-only views and format-only views

When I'm building views in SQL, I tend to do one of the following: Views that contain logic and criteria for selecting and joining records. I.e. "what records am I interested in and how do they fit ...
1
vote
0answers
84 views

How to design a NoSQL database solution for my application

Greetings to all. I am creating an online directory for my company using NodeJS. Our account supports hundreds of applications of the client, and each application has certain parameters such as ...
1
vote
2answers
58 views

How to structure and connect my “price” table to existing relational database table structure?

I have several tables: product, category, addon in various relational relationships. I structured it this way because: I have many products that belong to their own specific category. For each ...
3
votes
4answers
110 views

When keeping product price change history, what are the pros&cons of keeping track of price change events only?

When tracking something like pricing history, in my relational database, what is a recommended way to store pricing changes? For example I can: keep price change events only (aka a single date ...
2
votes
1answer
32 views

Data architecture for digital marketplaces

I am building a digital marketplace app. I would like to know what the best practice design patterns are for the backend (No SQL) object store. The primary characteristics of the app are as follows: ...
10
votes
2answers
2k views

Who designs databases in web development? [closed]

In the context of web development, who designs databases? Despite a whole host of information associating back-end web dev with server-side processing, data modeling, and the like, the database design ...
6
votes
3answers
167 views

What to name surrogate key when logical name is already taken by the business key

What name can you give the surrogate key column in a database table when the convention suggested name collides with that of an existing user field business key? For example, if I am creating a ...
1
vote
1answer
110 views

Database design for a daily maintenance tool

I'm thinking about the right database design for this requirement. It's a manual maintenance check. A company can have a maintenance contract comprising HW checks, Sys checks, both or none. The part ...
1
vote
2answers
100 views

Performance: One table vs multiple tables (generated programatically) for the same logical entity?

I want to ask for any suggestions for an architecture I can implement for a Java app I need to create (initial thoughts below). It is supposed to be a local Swing application for tracking financial ...
1
vote
1answer
133 views

Is indexing foreign keys a good practice?

Looking at DB tables created by a different developer I have noticed that whenever a table had a forein_key_id field/column, it was always an INDEX/KEY. I am not sure if it was manually created, or ...
1
vote
4answers
130 views

Allowing null to a foreign key

I have two existing tables called VehiclePlants and VehicleModels. Right now, the VehicleModels are linked to a possible multiple of VehiclePlants The customer wants this changed to be just a one-to-...
1
vote
1answer
56 views

designing user subscription along with existing organisation subscription

We have an existing implementation where all users belong to an organisation will depend on the organisation subscription, so if the subscription has ended all users belong to this organisation will ...
1
vote
1answer
71 views

(Dis-)Advantages of storing objects in relational database?

In an off-hand comment on this question about storing PHP objects in a MySQL database I mentioned that it is probably not a good idea to do so. My reasoning is that MySQL is explicitly a relational ...
1
vote
1answer
70 views

Designing a database for a voting application

I'm working on a smallish voting webapp. Similar to strawpoll but only authenticated users are allowed to make polls, while everyone is allowed to vote. User: id email/password_hash/name/...some ...
1
vote
3answers
211 views

How to design ER diagram to allow for retrieving of product option pricing data?

I'm looking for a way to organize database tables when it comes to handling product option pricing retrieval and also storing pricing history for my use case. What I have I have a custom-made ...
0
votes
1answer
23 views

Clan with members and admins Database Design

I want to create some clans in my game... And they can have some admins with some privileges... Am I need to create 2 tables one of them for clan info and one of them for clan members ?
1
vote
1answer
91 views

CMS database schema design advice

I am designing a CMS, and would like to start with a simple database schema, with the requirements Two main types of entity,Post and Category For Post, it need to support multilingual and versioning ...
0
votes
1answer
56 views

RESTful way to define an API that requires two keys to return a resource

In my application, I have resource A that is super class and A1, A2 that inherits A and other properties that are specific to them. A cannot exist by itself, it must be either A1 or A2. This is a ...
0
votes
1answer
67 views

Single Database Vs Multiple Database on SQL Server

we have web application which stores information in backend SQL 2014. currently the way is set up that central database stores all key information for the customers and then we have seperate database ...
2
votes
1answer
40 views

How to stage multiple queries

I am developing a reporting framework that requires multi-step calculations for numerous customers. An added complication is that customers have specific though similar methods of calculations. For ...
1
vote
1answer
80 views

How to show if a database is ACID or BASE?

I was wondering if there are general guides or standards which can be followed when trying to show if your own database implementation is ACID or BASE compliant? For example are there any specific ...
4
votes
1answer
82 views

Is it good form to use an alphanumeric unique ID?

There is a company that I am pulling data from which has a unique ID for each record. However, the ID is alphanumeric (even contains a special character too). When I asked about this I was told that ...
3
votes
1answer
52 views

Modeling a database for a heater domotic app

Imagine a domotic webapp, to command a heater. You could setup N plans, for a plan I mean a similar table: +----+---------+--------------------+ | id | name | target_temperature | +----+---------+...
0
votes
1answer
66 views

Storing in MySQL relationships between different type of objects

I have an app that needs to attach objects of different types between them. For example: I have to add Lead type object to a Contact type object , a Contact to an Event and so on. Such relationship ...
1
vote
0answers
29 views

Expiring counters in Cassandra

So I know that TTL is not available for counters because of design reasons and I've read https://issues.apache.org/jira/browse/CASSANDRA-2103 as well as some other SO questions regarding this but ...
2
votes
1answer
71 views

Might this be a good candidate for a graph database? [closed]

We need to create an application that must diff relationships between entities. As an example, let's say we're creating an application to model instances of a disease amongst pets, and we ...
2
votes
1answer
106 views

How do you handle duplicate key if the “record status” column is set as deleted

First of all, I'm sorry if the title is a bit confusing. I was reading this question (Is it a bad practice to have a "record status" column in a database table?), and like the idea of using ...
1
vote
2answers
90 views

How can I maintain a database record of an entity that belongs to several categories of another entity, per year, per season, etc

I am building a kind of School Management System. I want to be managing the database records of things like assessment, term/season, academic years. every info must belong to a particular academic ...
0
votes
4answers
151 views

Is there an appropriate name for a “middle” table that only stores foreign keys of other tables?

Right now I am designing a new database for our family business. I have a few tables like in the image above, where the table only contains two foreign keys in order to represent an association ...
1
vote
0answers
48 views

MongoDB design schema

Objective Get a good schema capable of making searches easy depending on the hierarchy. Background I am coding a database for a webervice that will return information about items for a game called ...
0
votes
1answer
68 views

database architecture for ecommerce app

I’m creating an app that allows users to post, sell, and purchase items. Every item has a count integer attribute that is set by the initial user and which is reduced by n with each purchase. When ...
3
votes
2answers
119 views

Building an abstraction database

The Scenario I have a Classic ASP project with a SQL Server backend that I need to port to ASP.NET MVC. The legacy site makes liberal use of schema definition analysis in the application itself. ...