rdbms

How to store data with dynamic number of attributes in a database

穿精又带淫゛_ 提交于 2019-11-28 16:34:42
I have a number of different objects with a varying number of attributes. Until now I have saved the data in XML files which easily allow for an ever changing number of attributes. But I am trying to move it to a database. What would be your preferred way to store this data? A few strategies I have identified so far: Having one single field named "attributes" in the object's table and store the data serialized or json'ed in there. Storing the data in two tables (objects, attributes) and using a third to save the relations, making it a true n:m relation. Very clean solution, but possibly very

When to replace RDBMS/ORM with NoSQL [closed]

懵懂的女人 提交于 2019-11-28 16:24:37
What kind of projects benefit from using a NoSQL database instead of rdbms wrapped by an ORM? Examples: Stackoverflow similiar sites? Social communities? forums? Niels van der Rest Your question is very general. NoSQL describes a collection of database techniques that are very different from each other. Roughly, there are: Key-value stores (Redis, Riak) Triplestores (AllegroGraph) Column-family stores (Bigtable, Cassandra) Document-oriented stores (CouchDB, MongoDB) Graph databases (Neo4j) A project can benefit from the use of a document database during the development phase of the project,

How to design a movie database?

六眼飞鱼酱① 提交于 2019-11-28 16:03:40
问题 I'm trying to get my head round this mind boggling stuff they call Database Design without much success, so I'll try to illustrate my problem with an example. I am using MySQL and here is my question: Say I want to create a database to hold my DVD collection. I have the following information that I want to include: Film Title Actors Running Time Genre Description Year Director I would like to create relationships between these to make it more efficient but don't know how. Here is what I'm

When to use CouchDB vs RDBMS [closed]

对着背影说爱祢 提交于 2019-11-28 14:24:31
问题 I am looking at CouchDB, which has a number of appealing features over relational databases including: intuitive REST/HTTP interface easy replication data stored as documents, rather than normalised tables I appreciate that this is not a mature product so should be adopted with caution, but am wondering whether it is actually a viable replacement for an RDBMS (in spite of the intro page saying otherwise - http://couchdb.apache.org/docs/intro.html). Under what circumstances would CouchDB be a

Hidden Features of PostgreSQL [closed]

梦想的初衷 提交于 2019-11-28 13:09:12
问题 I'm surprised this hasn't been posted yet. Any interesting tricks that you know about in Postgres? Obscure config options and scaling/perf tricks are particularly welcome. I'm sure we can beat the 9 comments on the corresponding MySQL thread :) 回答1: Since postgres is a lot more sane than MySQL, there are not that many "tricks" to report on ;-) The manual has some nice performance tips. A few other performance related things to keep in mind: Make sure autovacuum is turned on Make sure you've

Derived concepts - database design considerations

江枫思渺然 提交于 2019-11-28 12:43:57
问题 I have a main concept - Mail message and two derived concepts : template-generated emails free-form emails I am thinking of creating three tables to hold the data and I need your opinions on this matter (if it's bad, if it's good, how can it be improved and so on) : MailMessages Id [int] identity (autoincrement) PK ToAddress [varchar(300)] IsTemplateBased [bit] TemplateId [int] nullable FK MailBodyId [int] nullable FK (TemplateId must be null and MailBodyId must be non-null or vice-versa)

Oracle AS keyword and subqueries

守給你的承諾、 提交于 2019-11-28 08:47:46
问题 Just found out that Oracle does not like it when you use the AS keyword to alias a subquery: SELECT * FROM (SELECT * FROM products) AS p I need to keep my SQL queries as portable as possible. Will the removal of the AS keyword in the above query affect any other RDBMS? 回答1: The pattern for the SQL 99 ANSI is that the table can have an alias WITHOUT the AS keyword so, you can take out AS and it should work on every RDBMS. See it on fiddle: MySQL Oracle PostgreSql SQLLite SQLServer In ISO/IEC

Does MySQL/InnoDB implement true serializable isolation?

女生的网名这么多〃 提交于 2019-11-28 08:20:13
It is not entirely clear from MySQL documentation whether the InnoDB engine implements true serializable isolation 1 or snapshot isolation , which is often confusingly called "serializable" too. Which one is it? If MySQL InnoDB doesn't, are there any completely free, production-quality RDBMS which do? 1 where "true serializable isolation" means the absence of not only read anomalies as per the SQL standard, but also the write skew anomaly, explained in further detail here . regilero UPDATE: See comments, this seems to be fixed in MySQL 5.5 , with these examples we still have a table lock and

Is there an official name for the many-to-many relationship table in a database schema?

岁酱吖の 提交于 2019-11-28 08:12:40
Most of the projects I've worked on have required many-to-many relationships in the database schema. For example, you might have the concept of Users and Groups, and the database might contain a table User, a table Group, and a table UserGroup to relate the two. I'm interested in the conceptual name of the UserGroup table in that example. I've grown accustomed to calling them "swing tables" because that's how I learned it, but I haven't heard other people use that term in a while. Instead, I've heard all of the following (including some new ones, thanks to all of you!): Association table

Why would I ever choose to store and manipulate XML in a relational database?

吃可爱长大的小学妹 提交于 2019-11-28 04:46:54
Modern RDBMS's have support for XML column types and functionality for dealing with XML in stored procedures. Historically I would always have mapped hierarchical data (whether of OO objects or XML) to relational tables. Given the widespread database support for XML should I change my ways? If you don't see the need then don't change! Sometimes you have to persist data that does not have a known structure, or its structure is very volatile. In those cases, instead of creating a table, just save the XML into your existing table I have a good real-life example. One of my clients receives an XML