database

Best practices for storing postal addresses in a database (RDBMS)?

Are there any good references for best practices for storing postal addresses in an RDBMS? It seems there are lots of tradeoffs that can be made and lots of pros and cons to each to be evaluated -- surely this has been done time and time again? Maybe someone has at least written done some lessons learned somewhere? Examples of the tra...

Three customer addresses in one table or in separate tables?

In my application I have a Customer class and an Address class. The Customer class has three instances of the Address class: customerAddress, deliveryAddress, invoiceAddress. Whats the best way to reflect this structure in a database? The straightforward way would be a customer table and a separate address table. A more denormalized ...

Using XML as (read only) human readable datasource for survey questions

Hi everyone, Scientific or market research questionnaires mainly consist of questions in the following form: INTRO: Indicate how much you agree with the following statements... OPTIONS: very much - rather - so-so - rather not - not at all ITEM 1: I love Coca-Cola ... ITEM n: ... Let's call the whole thing a SCALE. One scale consis...

Importing a SQLite3 dump back into the database

I feel like this is a stupid question because it seems like common sense . . . but no google search I can put together seems to be able to give me the answer! I know how to get data OUT of a sqlite3 database using the .dump command. But now that I have this ASCII file titled export.sqlite3.sql . . . I can't seem to get it back INTO the...

Starting out doing server side things - what languages and techniques to choose?

I've been doing html, css and javascript for quite a long time, mostly for my very own enjoyment. I would say I know fairly much, I've created many simple games and apps and experiments with javascript. However there is only so much that is possible to do in the browser, for any more "complete" websites I am constantly confronted with my...

.NET/Mono Database Access—Easy column access?

I am not sure if I am missing something grotesquely obvious or what, but I can't seem to figure out how to efficiently access tables in a relational database. I am using PostgreSQL for the database server (and Npgsql for its access) and C# with Mono 2.0. Say I have the table created by the following CREATE TABLE and INSERT statements. ...

is it safe to keep database connections open for long time

I have a .net client application which is connected to a remote database. Is it safe to keep a single connection open for the lifetime of the client (hours)? Does the answer hold if I have multiple (10 or 100) clients running? Thanks ...

Sql Transactions: Best Way to Implement in ASP.Net

I have an application that has many different types of objects that each persist themselves back to the db. This has worked fine so far without transactions and I'm not looking to go hog wild adding them. But there is an occasional need to start a transaction before a whole collection of the objects start updating to ensure that the data...

performance of web app with high number of inserts

What is the best IO strategy for a high traffic web app that logs user behaviour on a website and where ALL of the traffic will result in an IO write? Would it be to write to a file and overnight do batch inserts to the database? Or to simply do an INSERT (or INSERT DELAYED) per request? I understand that to consider this problem properl...

Cross-database queries with different DB names in different environments?

How would you handle cross database queries in different environments. For example, db1-development and db2-development, db1-production and db2-production. If I want to do a cross-database query in development from db2 to db1 I could use the fully qualified name, [db1-development].[schema].[table]. But how do I maintain the queries a...

Setting innodb_log_file_size crashes MySQL

So, I'd like to be able to set the max log file size to 64M, but after doing so with innodb_log_file_size=64M MySQL starts OK, but nothing seems to work properly. EDIT: and by properly I mean not at all. Setting other InnoDB variables aren't causing any problems. How should I go about troubleshooting this one? ...

Audit trails and implementing SOX/HIPAA/etc, best practices for sensitive data

I consider myself to be relatively proficient in terms of application design, but I've never had to work with sensitive data. I've been wondering about what the best practices were for audit trails and how exactly one should implement them. I don't have to do it right now, but it'd be nice to be able to confidently talk with a medical co...

Best approach to limit database traffic on large query?

I have a database that i'm dealing with which is updated every few hours remotely (not on any specific time span) and i have no control over the administration of it. I have web clients connecting to it to view information contained within it. These clients (coded using PHP and Javascript) might be checking the database very often (impat...

MySQL code fails to display category name (WordPress database)

Why does this code fail to display the category name "Apples" using the current WordPress taxonomy system? The Category names are stored in the $wpdb->terms table (wp_terms). <?php $ra_category_id = 3; $ra_category = $wpdb->get_results("SELECT name FROM $wpdb->terms WHERE term_id = '3'"); $ra_category_name = $ra_category->name; ?...

how to post data to a site database in an iphone application?

I want to create an iphone application that is able to post the data to a website database which is using MySQL. Can anyone give some hints? ...

How to match Tagged items based on "similarity"

I have a real question. I have a database with the schema as follows: item id description other junk tag id name item2tag item_id tag_id count Basically, each item is tagged as up to 10 things, with varying counts. There are 50,000 items and 50,000 tags, and about 500,000 entries in items2tag. I'd like to find, given one...

Can the iPhone only use an SQLite database?

Can the iPhone use other databases besides SQLite, like MySQL? ...

I need high performance data redundancy over IP

I have a database that I need to provide redundancy for. It is Codebase, but using a typical SQL database uses too much CPU, and having the DB offsite causes too much latency in my process. I need a viable solution for providing data redundancy with an offsite location for my time criticla process. ...

Creating web forms from a database schema

I'm wondering if there are any applications, preferably freeware, that can take a database configuration, and, with as little hassle as possible, create web forms for inserting data easily. I'm finding it hard to express exactly what it is I'm after. Maybe I can talk a bit about what I need. I have a configuration database that, at le...

Synchronisable CRM System

Hi, I need to develop a CRM system which will allow users to have a local copy of the DB which can then be synched with the main server system. The idea is that a sales team can travel to non-internet enabled areas and still operate with relatively up to date information and then synch up when they get back to the office. Ive never don...