Original Post
I am working on simple XML database engine and I have few questions to more experienced programmers:
1. Is there point in storing each element in it's own file or it is better to store all entries of same type in one, potentially big file?
2. When storing every object in one file, this problem does not exist, but when operating on many small files, how to implement "where" queries? In other words, how to quickly find all matching files?
Let's say we have following object type - image info:
- name - string - main index
- path - string
- size - integer
- description - string
name, as main index, may be cached in some kind of index - identifier map, but what if we query database for every entry that has size < 4*1024*1024?
3. If using one big file for each type, is there way to get some parts without having entire file kept in memory?
1. Is there point in storing each element in it's own file or it is better to store all entries of same type in one, potentially big file?
2. When storing every object in one file, this problem does not exist, but when operating on many small files, how to implement "where" queries? In other words, how to quickly find all matching files?
Let's say we have following object type - image info:
- name - string - main index
- path - string
- size - integer
- description - string
name, as main index, may be cached in some kind of index - identifier map, but what if we query database for every entry that has size < 4*1024*1024?
3. If using one big file for each type, is there way to get some parts without having entire file kept in memory?