sql - Better database structure -


i'm developing app wp8 can store documents of dozen predefined types (e.g. passport, insurance...). so, have table columns this: int id, string name, int order

the problem other fields not same different document types.

for passport be: number int, photo bitmap

for insurance: number int, holder string

first way resolve problem: store data in xml column. second: store each type in dedicated table (i'm afraid linq query huge , slow data 10 different tables). third: store meta in tables (e.g. table field_types, field_to_docs, field_values).

i think fastest way be, of course, xml. think it? how storing bitmaps in xml, or i'll need create table specially storing bitmaps , sync them references xml?

i'd model main table document, , small table each document type peculiarities.

in document you'd have common fields plus type of document in small tables id main table , fields unique type of document.

when retrieving documents, you'd have join on foreign key should fast , simple.

other option i'd consider 1 table plenty of null-able fields , depending on document type reconstructing 1 or other , leaving other document-specific fields @ null. if using object-oriented language go first one. it's easier.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -