database

Multiple application using one database?

Hi Think Design: I have many applications that share the same user database! Other tables are shared as well such as user activity logs, purchases etc 1) Anyways my question is if I was to make all applications just use 1 database for everything! Would I have any problems with scalability? Or any other problem doing this? Is it better ...

Problems with serialize() and unserialize() - inserting and selecting data PHP MySQL

Hello I am attempting to grab a date supplied via POST, then generate a list of dates over a 12 week period from the supplied start date. These dates would then go into the DB and a 12 week schedule would be output, which the user can interact with (add/edit/delete). I am successfully taking the start date, generating the 12 week date...

Small architecture question

I have a ListActivity which lists a bunch of "things." If you click on one of these "things," you're taken to another ListActivity which lists a bunch of "stuff" for that "thing." Say I want to give the user the ability to edit the name of some of the "stuff"; or even delete some of the "stuff." At what point should I actually perform...

What database does Facebook use?

Does it use any of the standard ones like Oracle, DB2, SQL Server, or have something of their own? Considering the type of data (text + images + videos) that they have to manage, it would be interesting to know how they deal with it. Is this information publicly available? Any links would also be helpful. ...

Database seems to disappear after my application downloads it. Ideas?

One of my applications downloads a database from a server. When I install the application onto my phone, it downloads the file correctly and loads the information, no exceptions thrown or anything. However, when I upload the apk into the Android Market Place and download it onto the phone, the application downloads the database and then...

Why I have to redefine data stucture twice? should I?

Choosing carefuly datatypes, finally a complex Class is created, then using a HashMap, those first Class objects get mapped with a key. and now I can create thousands and access them, add, delete, etc.. Now if I want to store them in a DB.. So I start from scratch? have to create the table?, again take care about datatypes? to make fit...

Increment and insert Integer values on Android SQLite Database

Hello, Im trying to insert values on Android SQLite Database. The question is, Iḿ trying to insert a word, the table has 3 columns, ID, WORD, COUNT. When I insert a word in the database, some method will verify if this word exists on the database. If yes, it will increment the value of COUNT for this word. Example. I have a word "Quest...

How to implement where clause on Android Query method?

I'm trying to query a word, for this Im using the db.query method. But I want use a where clause, I've done like this on my code, but, the emulator returns an error. public String select(String wrd) { String list = new String(); Cursor cursor = this.db.query(TABLE_NAME, new String[] {"word"}, "word like " + wrd + "", null, null...

Prevent syncdb from updating database in Django?

I'd like to respect the database as a "read-only" and never write to it. Is there a way to easily prevent syncdb from even bothering to check to update the database? With Django 1.2 and the ability to have multiple databases, it'd like to be able to query a database for information. I'd never need to actually write to that database. ...

How do you handle complex data structures (OOP) in a mySQL DB?

I'll try to illustrate what I mean with an example. Say you are running a site that has users and allows posts. You have a list of users and each user has: a name a password choice of theme POSTS: - title of post - time/date of posting - post ID - array of tags for the post User ID/name/pass/theme is easy. Each variable can be a c...

Using COLLATE in Android SQLite - Locales is ignored in LIKE statement

When creating my SQLite database in Android I set the database locale - db.setLocale(new Locale("cz_CZ")). This is a Czech locale. A SELECT statement works and takes the locale into account, for example: SELECT * from table WHERE name='sctzy' COLLATE LOCALIZED Will find the entry 'ščťžý'. But using LIKE will fail: SELECT * from ta...

Table design flows for User tracking in website

So I am creating the spec for the user tracking module for a social website. Just wanted feedback on the best approach to do this. Currently I have something like this: First the Activity table gets populated with ActivityID and UserID (Activity is same as footprint). Then the ActivityDetails is filled with the Activity details which ...

Keeping page changes history. A bit like SO does for revisions.

I have a CMS system that stores data across tables like this: Entries Table +----+-------+------+--------+--------+ | id | title | text | index1 | index2 | +----+-------+------+--------+--------+ Entries META Table +----+----------+-------+-------+ | id | entry_id | value | param | +----+----------+-------+-------+ Files Table +----+-...

Changing local clock affects remote SQL Server database functionality

Hi all, I'm having an issue with some SQL Server 2008 queries and I think I got it down to differences between the server and the local application. Here's a basic description of my scenario: I'm using a local application that performs insert statements on a remote database. Everything works fine until I change the clock on the local m...

How to get difference between 2 columns

I have a query that is producing something like this: StartTimestamp | EndTimestamp ================================ 100 | 450 -------------------------------- 150 | 500 I'd like the result to also include the difference between EndTimestamp and StartTimestamp: StartTimestamp | EndTimestamp | Difference ...

Subsequent queries depends on result of initial query: how to?

Say I have 3 queries. Query 1 returns a piece of information that Query 2 and Query 3 needs. Is there a way for Query 2 and Query 3 to access this piece of information from the result of Query 1? Right now, I have Query 1 executing twice: once in Query 2 and once in Query 3. This doesn't seem efficient to me. Is there a better way in M...

Database Design: Is there a great program to prototype in and then 'export'?

I have been playing around with Visual Studio 2010 over the past few days working with their SQL Template. I have to say...BOOOOOOOO...not working. Now I have had more fun with xsd's in Visual Studio's C#. I expected database design to be that easy or better but no such luck. Are there any applications out there that you would recommend...

SERIAL-like INT column

I have an app where depending on the type of transaction being added or updated, the ticket number may or may not increment. I can't use a SERIAL datatype for ticket number because it would increment regardless of the transaction type, so I defined ticket number as an INT. So in a multi-user environment if user A is adding or updating a ...

Storing an array in the database in ruby on rails

I have somewhat of a unique situation, if I had a form with a checkbox for every state (as in US states, so 50 states say), I don't really want to add 50 columns to my db, how can I store them in an array in a single column? I feel like I've seen this done but I'm having a hard time putting my finger on the implementation. ...

How to convert the following MySQL schema into CouchDB?

I am not sure how I can design the following problem in CouchDB. I have a logger web app that keeps track of how many items are in a warehouse. To simplify the problem we just need to know the total number items currently in warehouse and how long is each item stays in warehouse before it ships. Lets say the warehouse only have shoes bu...