sogo/OGoContentStore
Wolfgang Sourdeau d9eda79696 Monotone-Parent: 47aef98a4894f30e9031a2a06ca088c4ac71d7f3
Monotone-Revision: 9a0e8d7545284ad8801b490d2c5baf6898323af9

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-01-26T22:25:23
Monotone-Branch: ca.inverse.sogo
2007-01-26 22:25:23 +00:00
..
OGoContentStore.xcode see ChangeLog 2006-06-15 19:34:10 +00:00
OGoContentStore.xcodeproj see ChangeLog 2006-06-15 19:34:10 +00:00
misc see ChangeLog 2006-06-15 19:34:10 +00:00
sql Monotone-Parent: 5a720314ac446bf86e127d6d6e938b844aab7441 2007-01-26 16:52:13 +00:00
COPYING see ChangeLog 2006-06-15 19:34:10 +00:00
COPYRIGHT see ChangeLog 2006-06-15 19:34:10 +00:00
ChangeLog.upstream - renamed old and obsolete ChangeLogs to Changelog.upstream; 2006-07-04 20:13:47 +00:00
GNUmakefile Monotone-Parent: 47aef98a4894f30e9031a2a06ca088c4ac71d7f3 2007-01-26 22:25:23 +00:00
GNUmakefile.postamble see ChangeLog 2006-06-15 19:34:10 +00:00
GNUmakefile.preamble Monotone-Parent: 10b56ee326ca77f71fbe5cb41d30b0640a6fe57a 2006-09-13 21:20:57 +00:00
OCSContactFieldExtractor.m Monotone-Parent: 8268efeb15753e2949b09378244938f0b6bb08a8 2006-09-29 18:31:20 +00:00
OCSiCalFieldExtractor.h see ChangeLog 2006-06-15 19:34:10 +00:00
OCSiCalFieldExtractor.m Monotone-Parent: 65e85a0c1825401dd092e3ed519e16162a7e4fe1 2006-10-26 16:33:38 +00:00
README see ChangeLog 2006-06-15 19:34:10 +00:00
Version see ChangeLog 2006-06-15 19:34:10 +00:00
appointment.ocs Monotone-Parent: 19e618a35e17deb331a98af60ddcc5529db862be 2006-10-25 23:59:40 +00:00
common.h see ChangeLog 2006-06-15 19:34:10 +00:00
contact.ocs see ChangeLog 2006-06-15 19:34:10 +00:00
iCalEntityObject+OCS.h Monotone-Parent: 494c37e329faf06b93265c155db7226d205150b0 2006-09-13 21:22:09 +00:00
iCalEntityObject+OCS.m see ChangeLog 2006-06-15 19:34:10 +00:00
iCalRepeatableEntityObject+OCS.h Monotone-Parent: 10b56ee326ca77f71fbe5cb41d30b0640a6fe57a 2006-09-13 21:20:57 +00:00
iCalRepeatableEntityObject+OCS.m Monotone-Parent: 8268efeb15753e2949b09378244938f0b6bb08a8 2006-09-29 18:31:20 +00:00
test_quick_extract.m see ChangeLog 2006-06-15 19:34:10 +00:00

README

Storage Backend
===============

The storage backend implements the "low level" folder abstraction, which is
basically an arbitary "BLOB" containing some document. The feature is that
we extract "quick access" / "searchable" attributes from the document content.

Further it contains the "folder management" API, as named folders can be stored
in different databases.
Note: we need a way to tell where "new" folders should be created
Note: to sync with LDAP we need to periodically delete or archive old folders

Folders have associated a type (like 'calendar') which defines the query
attributes and serialization format.

TODO
====
- hierarchies deeper than 4 (properly filter on path in OCS)

Open Questions
==============

System-meta-data in the blob-table or in the quick-table?
- master data belongs into the blob table
- could be regular 'NSxxx' keys to differentiate meta data from

Class Hierarchy
===============

  [NSObject]
    OCSContext                  - tracking context
    OCSFolder                   - represents a single folder
    OCSFolderManager            - manages folders
    OCSFolderType               - the mapping info for a specific folder-type
    OCSFieldInfo                - mapping info for one 'quick field'
    OCSChannelManager           - maintains EOAdaptorChannel objects

  TBD:
  - field 'extractor'
  - field 'value' (eg array values for participants?)
  - BLOB archiver/unarchiver

Defaults
========

  OCSFolderInfoURL - the DB URL where the folder-info table is located
    eg: http://OGo:OGo@localhost/test/folder_info

  OCSFolderManagerDebugEnabled      - enable folder-manager debug logs
  OCSFolderManagerSQLDebugEnabled   - enable folder-manager SQL gen debug logs

  OCSChannelManagerDebugEnabled     - enable channel debug pooling logs
  OCSChannelManagerPoolDebugEnabled - debug pool handle allocation
  
  OCSChannelExpireAge       - if that age in seconds is exceeded, a channel 
                              will be removed from the pool
  OCSChannelCollectionTimer - time in seconds. each n-seconds the pool will be
			      checked for channels too old
  
  [PGDebugEnabled] - enable PostgreSQL adaptor debugging

URLs
====

  "Database URLs"
  
  We use the schema:
    postgresql://[user]:[password]@[host]:[port]/[dbname]/[tablename]

BLOB Formats
============

- TBD
- iCal, XML
- problem with iCal is that a complete and valid iCal file is different from
  just the vevent. so we basically need to parse those files in any case.
- XML: the iCal SaxDriver reports XML events, so we can easily store that as 
  XML
- we need to parse the BLOB for different clients anyway (iCal != iCal ...)
- XML: we could use some XML query extension to PG in the future?

Update: we now have OCSiCalFieldExtractor
  - it parses the BLOB as an iCalendar file and extracts a set of fixed
    keys:
    - title        - plain copy of "summary"
    - uid          - plain copy
    - startdate    - date as utime
    - enddate      - date as utime
    - participants - CNs of attendees separated by comma ", "
    - location
    - partmails
    - sequence
    - TBD: iscyclic
    - TBD: isallday
    - TBD: cycles  - I guess the client should fetch the BLOB to resolve
  - the field extractor is accessed by OCSFolder using the folderinfo:
    extractor = [self->folderInfo quickExtractor];
    quickRow  = [extractor extractQuickFieldsFromContent:_content];

Support Tools
=============

- tools we need:
  - one to recreate a quick table based on the blob table

Notes
=====

- need to use http:// URLs for connect info, until generic URLs in 
  libFoundation are fixed (the parses breaks on the login/password parts)

QA
==

Q: Why do we use two tables, we could store the quick columns in the blob?
==
They could be in the same table. I considered using separate tables since the 
quick table is likely to be recreated now and then if BLOB indexing 
requirements change.
Actually one could even use different _quick tables which share a common BLOB 
table.
(a quick table is nothing more than a database index and like with DB indexes 
 multiple ones for different requirements can make sense).

Further it might improve caching behaviour for row based caches (the quick 
table is going to be queried much more often) - not sure whether this is 
relevant with PostgreSQL, probably not?

Q: Can we use a VARCHAR primary key?
==
I asked in the postgres IRC channel and apparently the performance penalty of
string primary keys isn't big.
We could also use an 'internal' int sequence in addition (might be useful for
supporting ZideLook)
Motivation: the 'iCalendar' ID is a string and usually looks like a GUID.

Q: Why using VARCHAR instead of TEXT in the BLOB?
==
To quote PostgreSQL documentation:
"There are no performance differences between these three types, apart from 
 the increased storage size when using the blank-padded type."
So varchar(xx) is just a large TEXT. Since we intend to store mostly small
snippets of data (tiny XML fragments), I considered VARCHAR the more 
appropriate type.