database

What's a good way to handle entities within an aggregate that persist to multiple databases

Hello everyone! I'm dealing with a design problem that I'm sure has a simple answer and/or has been solved before. I've been reading, thinking, and searching for solutions for quite a while, but nothing seems to really make sense. The gist of the issue is that I'm dealing with a series of legacy systems and databases and I'm trying to t...

Full Android Database Helper class for existing SQLite database?

Hello, I'm trying to deploy an application with an existing SQLite database. I've been reading though the examples that are posted but they are always missing some part of the class. I feel like I'm trying to bake muffins but no one told me to use baking powder. Can someone post a full database helper class for depoying an SQLite data...

Storing 200 million variable length strings causes fragmentation/table bloat

I am attempting to store over 200 million key value pairs. The value for over 50% of the keys will change over the course of the week, and about 5% of the rows will be permanently removed. Using traditional SQL solutions, this has proven to cause a large amount of fragmentation, causing table bloat (4x the original table size), and som...

Entity Framework: Multiple Inheritance

Ok obviously I am fighting .net here ... and the answer is probably that i am barking up the wrong tree and should just get on with just using the kind of database design i would of 5 years ago. What I want is to have an abstract object Client and have 2 inherited objects Supplier and Customer. The relationship between client and both ...

Page Cycles - Right way to input data to database

I have a page that has a few textboxes and a dropdownlist. When a logged in user opens this page the boxes are filled with data that he has inputed before, he can change the data and update it by pushing a update button. There is also that dropdownlist which has a dynamically populated data for him to choose from. What is the best way t...

sqlalchemy session not recognizing changes in mysql database (done by other processes)

Application consists of: main process (python+sqlalchemy) that periodically check db (sleeps most of the time) child processes that write to db web app that write to db Problem is that the main process session doesn't seem to register changes in the db done outside that session. How do ensure it does? (as of now I am closing and...

mysql query where IN statement

Hi there. I want to do the following: SELECT count(id) FROM table WHERE value BETWEEN 3 AND 40; But it should do the following: SELECT count(id) FROM table WHERE value IN(3, 4, 5, 6, 7, 8, 9, 10, 11, ..., 40); It should even print out zero count(id) for value between 3 and 40, but not value = x. I want to check if a value is in a s...

[MySQL] Column alias not recognized in WHERE-statement

Hi all, I have a strange 'problem' with one of my created queries. Given the next query: SELECT ID, DistanceFromUtrecht, ( SELECT (MAX(DateUntil) - (ReleaseDays * 60 * 60 * 24)) FROM PricePeriod WHERE PricePeriod.FK_Accommodation = Accommodation.ID ) AS LatestBookableTimestamp FROM Accommodation WHERE LatestBooka...

Do you need Solr/Lucene for MongoDB, CouchDB and Cassandra?

If you have RDBMS you probably have to use Solr to index your relational tables to fully nested documents. Im new to non-sql databases like Mongodb, CouchDB and Cassandra, but it seems to me that the data you save is already in that document structure like the documents saved in Solr/Lucene. Does this mean that you don't have to use So...

Django - Compare Model Code to Database

I maintain a Django project with a database that has several model constraints that have fallen out of sync with the actual database. So, for example, some model fields have null=False set, but the database permits NULLs for the corresponding database column. I'm curious if there is a utility, either in Django or a third-party Python sc...

Parent-child relationship: multiple tables vs. self-join

I'm working on a database for stat keeping for a sports club where I help administrate some events. I think I've got the parts for keeping track of the competitor names, classifications, categories, etc. figured out using a main table, several lookup tables and a couple bridge tables to cover the many-to-many relationships involved. I ...

ASP.net SQL server universal date problem.

I need to solve the following problem for one of my clients. They have an installer which installs a SQL server database + IIS website. The SQL database user can have any kind of date format (DD/MM/YYYY, MM/DD/YYYY,...) depending on the locale of the sql server. The IIS website can have any kind of date format (can be different from sql...

How to get values of Dropdownlist MVC 2 for insert in DB

Hi everyone, I am beginning in this issue MVC 2 I hope you can help me. I created a basic model public class RegisterModel { public string Name { get; set; } public int idCountry { get; set; } public string Country { get; set; } } And I have in the controller the following public ActionResult Register() ViewData["c...

Where should I break up my user records to keep track of revisions

I am putting together a staff database and I need to be able to revise the staff member information, but also keep track of all the revisions. How should I structure the database so that I can have multiple revisions of the same user data but be able to query against the most recent revision? I am looking at information that changes ra...

Google's username policies vs Facebook, Twitter and others...

I have a question I've been trying to understand for awhile now. Google has terrible username policies for accounts and services. You are unable to change your username, recover a deleted account or link usernames to various accounts. It's not possible to do anything. These issues have comes up numerous times with accounts that I manage ...

Doing a join over 2 tables in different databases using Hibernate

Hi everybody, I have two tables in two separate oracle databases (not schemas) that I need to join in Hibernate. Currently, I have two hibernate sessions going out to the separate databases. Before anybody says look at Hibernate Shards, I have spent a better part of a day looking at that sub-project and have found that: it is for hor...

[REST] is it bad form to have the colon in db and in the URL?

I am designing my namespace such that the id i am storing in the DB is id -> "e:t:222" where "e" represents the Event class, "t" represents the type i am also expecting to use this id in my urls url -> /events/t:222 Is there anything wrong with doing this? ...

What should I encode my passwords to?

I'm starting a new ASP.Net application from scratch. What should I use to encode passwords and what should my column be? Just a simple varchar(512)? Thanks for any advice. ...

How to find range of a number where the ranges come dyamically from another table?

If I had two tables: PersonID | Count ----------------- 1 | 45 2 | 5 3 | 120 4 | 87 5 | 60 6 | 200 7 | 31 SizeName | LowerLimit ----------------- Small | 0 Medium | 50 Large | 100 I'm trying to figure out how to do a query to get a result similar to: PersonID | SizeName ------...

Database Design and how Foreign keys work?

If two tables have foreign keys to the same primary key of another table, does that mean that two indexes are created for those foreign keys or do they use the same index (the primary key index?) ...