database

c# multithreading - Is there a need to lock when writing to DB?

Hi All, I've got a multithreaded C# 2.0 app where each thread writes some results into a SQL server 2000 database table. There is only a straight INSERT command and no other logic. My question is - do I need to put a lock around the methods that writes the results to the database? There is a lock at the moment but I suspect that it's s...

How to run a relational database on multiple servers

I'm using Postgres, but I'm curious about this just in general. People talk about running on multiple servers for better availability, but I actually haven't the slightest idea how I would run a relational DB on more than one server, and still have data integrity. ...

PHP/Mysql: read data field value from lookup tables (split array)

I have 1 Mysql database with 2 tables: DOCUMENTS ... - staffID ..... STAFF - ID - Name The DOCUMENTS table assigns each document to a single or multiple users from the STAFF table therefore the staffID in the DOCUMENTS table consists of a comma separated array of staff ID's for example (2, 14). I managed to split the array into ...

Should I compute statistics on the fly, or generate with a cron job?

Howdy, I have a simple enough web application. I want to measure for any day or month how many new free signups I have, how many paid signups, how many paid upgrades, how many cancellations, etc. That data will then be represented on my admin dashboard by sparklines. Generally, do you suggest: a) Writing a script that upon each call, ...

MySQL Query to retrieve full URL slug

First question! I have a MySQL table which stores all content on the various pages of a site. Let's say there's three fields, id(int), permalink(varchar) and parent(int)(. parent is the id of it's parent page. I need a query that will build a full URL of a page, I'm guessing using CONCAT. I have it working fine for two levels, but can'...

php and javascript design

question relates to PHP and Javascript for now every table has a form with input tags that each of them has id="field_from_table" GLOBAL_TABLE=name of that table GLOBAL_FIELDS=name of fields in that table GLOBAL_ID=ID value for table. every field also have a label for im. some of the fields are not text. I want to get/set those inp...

What is the preferred way of saving dynamic lists in database?

In our application user can create different lists (like sharepoint) for example a user can create a list of cars (name, model, brand) and a list of students (name, dob, address, nationality), e.t.c. Our application should be able to query on different columns of the list so we can't just serialize each row and save it in one row. Shou...

whats difference between NoSql DB and OO Db?

whats difference between NoSql DB and OO Db? ...

Visual Studio 2010 Schema Compare from Code

I'm trying to use the Sql100DatabaseSchemaProvider to generate a schema comparison and update script in code at runtime. It's not the same task really, but I'm using this: http://blogs.msdn.com/b/bahill/archive/2010/05/04/leveraging-the-visual-studio-2010-database-deployment-api.aspx as a working reference... So far I've got to the po...

Optimizing MySQL queries / database structure

I have in my MySQL database these two tables: CREATE TABLE IF NOT EXISTS `articles` ( `id` bigint(20) NOT NULL, `url` varchar(255) collate utf8_bin NOT NULL, `img` varchar(255) collate utf8_bin NOT NULL, `name` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL, `url_key` varchar(255) character set utf8 collate u...

When should I use an object database?

I have been using relational databases for some time now and recently came across a different type of database: object database. One of the products built around this idea had a description: A scalable, "post-relational" database with a multidimensional data and application server for distributed web applications. This makes me wonder,...

Efficient ways of tracking updates to the database row.

Given the following two tables, what are some of the most efficient ways to track updates to a given entity (Entity table) and its data (EntityData). Entity { EntityID: Num EntityData: Blob } EntityData { ID: Num EntityID: Num Prop: String Value: String Type: Num } ...

Lookup tables question

Possible Duplicate: database design question For performance and future data editing, is it better to store all lookup values in 1 table or each to its own table? I have items like Industry, Sub industry, Sector, Sector type, etc Each of these have between 5 to 50 values. Each can be related like Sector belongs to Sector type....

What database to use?

I'm new to databases, but I think I finally have a situation where flat files won't work. I'm writing a program to analyze the outcomes of multiplayer games, where each game could have any number of players grouped into any number of teams. I want to allow players can win, tie, or leave partway through the game (and win/lose based on te...

What options do I have for a Simple Datastore Webservice?

Hi folks, I have a simple web based app that's going to run on an iPad. What I need is a way to store user inputs: email and lat/lng from a Google Map. I don't really have access to a serverside setup at the moment. It needs to be fairly secure as I can't give out the users email obviously. I would like to be able to post from my web a...

What is the proper table and join structure for a many to many relationship between the same attributes of the same table?

Lets say I have a Users table with a UserID column and I need to model a scenario where a user can have multiple relationships with another user, e.g. phone calls. Any user can initiate 0...n phone calls with another user. Would it be a classic junction table like: UserCalls ----------------------- | CallerID | CalleeID | ------------...

How to use CakePHP's database.php file for custom scripts?

Hello, Can you help me how to use class defined in CakePHP's /config/database.php file, for my custom scripts? I need to use defined array for db connection. Tnx in adv! ...

Oracle newly created user privileges issue?

Does newly created user: create user John identified by secret; have some privileges? Or is there any oracle config for privileges of newly created user? I need information about this topic. ...

App without remote database

If I want to create .NET app that needs database functionalities, but I do not want to use remote database, what should I use instead? For example, 1) web app which needs to store data in some kind of database 2) desktop app which need to store data in some kind of database ...

MySQL mass UPDATE 40K rows with server resource friendly query

Hi, i have something like 40K rows and i must run update query like this: UPDATE table1 SET column1='very long value 1...', column2='normal lenght value 1a' WHERE pid ='123' column3='ccc'; column1 is TEXT column2 is Varchar(150) ...and i want to use mysql query what is more server resource friendly. I want to use something lik...