Monday, 26 August 2013

Better database structure

Better database structure

I'm developing app for WP8 that can store documents of dozen predefined
types (e.g. passport, insurance...). So, I have table with columns like
this: int id, string name, int order
The problem is that other fields are not same for different document types.
For passport it will be: number int, photo Bitmap
For insurance: number int, holder string
First way to resolve that problem: store all that data in XML column.
Second: store each type in dedicated table (I'm afraid that Linq query
will be really huge and slow to get data from 10 different tables). Third:
store all meta in another tables (e.g. table field_types, field_to_docs,
field_values).
I think fastest way will be, of course, XML. What do you think about it?
How about storing Bitmaps in XML, or I'll need to create another table
specially for storing Bitmaps and than sync them will references from XML?

No comments:

Post a Comment