]> err.no Git - scalable-opengroupware.org/blob - OGoContentStore/README
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@22 d1b88da0-ebda-0310-925b-ed51d8...
[scalable-opengroupware.org] / OGoContentStore / README
1 # $Id$
2
3 Storage Backend
4 ===============
5
6 The storage backend implements the "low level" folder abstraction, which is
7 basically an arbitary "BLOB" containing some document. The feature is that
8 we extract "quick access" / "searchable" attributes from the document content.
9
10 Further it contains the "folder management" API, as named folders can be stored
11 in different databases.
12 Note: we need a way to tell where "new" folders should be created
13 Note: to sync with LDAP we need to periodically delete or archive old folders
14
15 Folders have associated a type (like 'calendar') which defines the query
16 attributes and serialization format.
17
18 Open Questions
19 ==============
20
21 System-meta-data in the blob-table or in the quick-table?
22 - master data belongs into the blob table
23 - could be regular 'NSxxx' keys to differentiate meta data from
24
25 Class Hierarchy
26 ===============
27
28   [NSObject]
29     OCSContext                  - tracking context
30     OCSFolder                   - represents a single folder
31     OCSFolderManager            - manages folders
32     OCSFolderType               - the mapping info for a specific folder-type
33     OCSFieldInfo                - mapping info for one 'quick field'
34     OCSChannelManager           - maintains EOAdaptorChannel objects
35
36   TBD:
37   - field 'extractor'
38   - field 'value' (eg array values for participants?)
39   - BLOB archiver/unarchiver
40
41 BLOB Formats
42 ============
43
44 - TBD
45 - iCal, XML
46 - problem with iCal is that a complete and valid iCal file is different from
47   just the vevent. so we basically need to parse those files in any case.
48 - XML: the iCal SaxDriver reports XML events, so we can easily store that as 
49   XML
50 - we need to parse the BLOB for different clients anyway (iCal != iCal ...)
51 - XML: we could use some XML query extension to PG in the future?
52
53 Support Tools
54 =============
55
56 - tools we need:
57   - one to recreate a quick table based on the blob table
58
59 Notes
60 =====
61
62 - need to use http:// URLs for connect info, until generic URLs in 
63   libFoundation are fixed (the parses breaks on the login/password parts)
64
65 QA
66 ==
67
68 Q: Why do we use two tables, we could store the quick columns in the blob?
69 ==
70 They could be in the same table. I considered using separate tables since the 
71 quick table is likely to be recreated now and then if BLOB indexing 
72 requirements change.
73 Actually one could even use different _quick tables which share a common BLOB 
74 table.
75 (a quick table is nothing more than a database index and like with DB indexes 
76  multiple ones for different requirements can make sense).
77
78 Further it might improve caching behaviour for row based caches (the quick 
79 table is going to be queried much more often) - not sure whether this is 
80 relevant with PostgreSQL, probably not?
81
82 Q: Can we use a VARCHAR primary key?
83 ==
84 I asked in the postgres IRC channel and apparently the performance penalty of
85 string primary keys isn't big.
86 We could also use an 'internal' int sequence in addition (might be useful for
87 supporting ZideLook)
88 Motivation: the 'iCalendar' ID is a string and usually looks like a GUID.
89
90 Q: Why using VARCHAR instead of TEXT in the BLOB?
91 ==
92 To quote PostgreSQL documentation:
93 "There are no performance differences between these three types, apart from 
94  the increased storage size when using the blank-padded type."
95 So varchar(xx) is just a large TEXT. Since we intend to store mostly small
96 snippets of data (tiny XML fragments), I considered VARCHAR the more 
97 appropriate type.