database-design

strategy to filter data according to user access level

we currently have a very simple security schema... we have resources, that roughly maps to tables, we have access to that resources (add, modify, delete, query) and we have groups. each permission consists of a resource, with a specified access and a group and each user can belong to many groups... so, permission is a many-to-many be...

Database structure of multi-lingual site

I need database structure for storing versions of site's content in different languages. Right now I'm doing it like this: [Item] Id SomeColumn [ItemStrings] ItemId LanguageId Title Description ... [Languages] Id Culture Although, it is a pretty neat way to do translation, it requires a lot of monkey coding when ...

Practical limits of SQL-Server database.

I am setting up a database that I anticipate will be quite large, used for calculations and data storage. It will be one table with maybe 10 fields, containing one primary key and two foreign keys to itself. I anticipate there will be about a billion records added daily. Each record should be quite small, and I will primarily be doing i...

Multiple DB Platforms For A Single App

is it generally acceptable to store relational data in an rdbms like mysql, and place, lets say, arbitrary relationship data in a separate graph database system like neo4j? what about primary keys referenced in one db to another? or, another example: using mongodb for log data when mysql is the primary database platform for the applicati...

unique constraint check based on a parameter in the parent table

Table User has (userId, scoreType, ...) @Table(name = "User", uniqueConstraints = @UniqueConstraint(columnNames = userId)) -- scoreType could be either points or percentage Table UserScore (id, userId, points, percentage) I would like to provide the flexibility to store either points or percentage based on user.scoreType. So if ...

How would a "NOSQL" database be designed for consumer apps (e.g. social bookmarking)

I've been reading up on a lot of posts about non-relational databases, the whole NOSQL movement, and there's a lot of fresh new activity around it. It seems like a very interesting approach to building highly scalable web applications but unfortunately (but also a good thing at this nascent stage) there isn't quite a clear leader/standar...

Database Design: Internationalization of user-generated content (comments, posts...)

Hi there, Let's say I run a website giving the oportunity to users to put content online (some comments for ex...) and that I run this website under several languages / countries (locale). In addition, I don't need the comments to be accessible from a locale to another. I'd like to know what the best database design between the followi...

Are bad data issues that common?

I've worked for clients that had a large number of distinct, small to mid-sized projects, each interacting with each other via properly defined interfaces to share data, but not reading and writing to the same database. Each had their own separate database, their own cache, their own file servers/system that they had dedicated access to,...

Using [0,1] versus ["Y","N"] versus ["T","F"] in a logical/boolean database field?

Just out of curiosity and lack of a definite answer... I was just looking at some data that is sent from a 3rd party to us, and their "Gender" field is a [0,1] denoting either a Female (0) or a Male (1). Is there any better reason to use [0,1] over ["F","M"]? Does it depend on the scenario and the intuitiveness between a field and its...

Table with unknown number of columns

We're in the process of designing a tiny database that will contain data regarding our software's usage. So in our programs/websites we will call a little service that logs some data regarding the session and the action performed. This way we can see what parts of our programs are heavily used, what the most common usage scenarios are et...

Building app to Classify / Describe Products - Overwhelmed somewhere between planning & execution

Greetings! I recently started working for a company that carries a line of 20,000 Surgical Instruments. Our data on all items is currently spotty and chaotic at best. I intend to fix this. I have been tasked with redesigning the web site. As part of the project, I'm building an app to classify and describe all products. We don't do any...

Should I split the data between multiple databases or keep them in a single one?

Hi, I'm creating a multi-user/company web application in php & mysql. I'm interested to know what the best practice is with regards to structuring my database(s). There will be hundreds of companies and thousands of users of this web app so this needs to be robust. Each company won't be able to see other companies data, just their ow...

How should I design this table?

Hi, Because I have a poor memory, I want to write a simple application to store table column information, especially the meaning of table columns. Now I have a problem with my table design. I plan to make the table have the following columns: id, table_name, column_name, data_type, is_pk, meaning But this design can’t express the for...

Reading only new rows from a log-like table in a database

We have the sitation that several servers are inserting chunks of rows into a table in a relational database, and one server reads the new data once in a while from the table. (The table is conceptually some kind of logfile - data is only inserted but never modified, and the reading server shows a tail of the log.) Is there a way to have...

Django - Designing Model Relationships - Admin interface and Inline

heya, I think my understanding of Django's FK and admin is a bit faulty, so I'd value any input on how to model the below case. Firstly, we have generic Address objects. Then, we have User's, who each have a UserProfile. Through this, Users belong to departments, as well as having addresses. Departments themselves can also have multip...

How to organize a PHP blog

So, currently I'm organizing my blog based on filename: To create a post I enter the name of the file. As opposed to storing the post in the database, I store them in PHP files. So each time I create a post, A new row in the table is created with the filename and a unique ID. To reference the post (e.g. for comments) I get the name of th...

Table structure: some "columns" to be saved as a single text-type field with json structure, alternative: separate table but concerned with performance

Here the deal: I've got a table Billing, which is basically a receipt (for different types of transaction). The app has a feature that you can create new charges (well, all charges except for tax and other constants). Since there would be a dynamic number of charges, we decided to store the charges for a billing on a single text field wi...

MS Access: index optimisation

Let's say we have a [Valuations] table containing several values per date and per fund: -FundId -ValDate -Value1 -Value2... The Primary key is obviously FundId+ValDate. I have also indexed the ValDate field since I often query for values on a specific date. My question is: should I also create a specific index for the FundId, or i...

Database Job Scheduling

I have a procedure written in PLJava that sends out updates over JMS in my postgres database. What I would like to do is have that function called on an interval (every 15 seconds) internally in the database (preferably not from an outside process). Is this possible? Any ideas? ...

Need to assign multiple attributes to records - should I opt for one table or multiple tables?

I am using an MVC pattern to represent a table with many records of music albums. To each music album there are attributes (genre, artist, ratings, etc). Each attribute can have multiple values (so the genre of one album can be both "pop" and "latin", for example). I want to represent those attribute values using table(s). So there are ...