1.1 --- a/docs/wiki/DatabaseStore Fri Mar 11 18:34:56 2016 +0100
1.2 +++ b/docs/wiki/DatabaseStore Fri Mar 11 19:08:12 2016 +0100
1.3 @@ -13,3 +13,110 @@
1.4 The [[../FileStore|file store]] offers a more convenient method of managing calendar
1.5 data, albeit offering arguably less scalability and less convenience when data volumes
1.6 become significantly large.
1.7 +
1.8 +== Configuration Settings ==
1.9 +
1.10 +The [[../Configuration|configuration]] files (`config.sh` and `config.py`) need to be
1.11 +updated when choosing a database store.
1.12 +
1.13 +{{{#!table
1.14 +'''File''' || '''Setting''' || '''Value''' || '''Description'''
1.15 +==
1.16 +`config.sh`
1.17 +||<rowspan="2"> `STORE_TYPE`
1.18 +||<rowspan="2"> `postgresql`
1.19 +||<rowspan="2"> Selects a specific database store type; currently, only `postgresql`
1.20 + .. is supported
1.21 +==
1.22 +`config.py`
1.23 +==
1.24 +<rowspan="2"> `config.py`
1.25 +|| `STORE_DIR`
1.26 +|| `dbname=imip_agent`
1.27 +|| Indicates a connection string for the store database
1.28 +==
1.29 +`JOURNAL_DIR`
1.30 +|| `dbname=imip_agent`
1.31 +|| Indicates a connection string for the journal database
1.32 +}}}
1.33 +
1.34 +== Journal Structure ==
1.35 +
1.36 +The journal information is retained in a collection of tables. Unlike the structure of
1.37 +the [[../FileStore|file store]] in the [[../FilesystemUsage|filesystem]], each table
1.38 +contains details for all quota groups, with each query indicating the group to select
1.39 +the appropriate information.
1.40 +
1.41 +{{{#!table
1.42 +'''Table''' || '''Purpose'''
1.43 +==
1.44 +`quota_freebusy`
1.45 +|| Period descriptions describing reservations for resources sharing a quota (`quota`)
1.46 +.. made by users or groups (`user_group`), structured similarly to the `freebusy` table
1.47 +.. in the data store
1.48 +==
1.49 +`quota_limits`
1.50 +|| A mapping from user identities or group identifiers to quota limits
1.51 +==
1.52 +`user_freebusy`
1.53 +|| Period descriptions for reservations made in the context of a quota (`quota`) by a
1.54 +.. specific user (`store_user`), structured similarly to the `freebusy` table in the
1.55 +.. data store
1.56 +==
1.57 +`user_groups`
1.58 +|| A mapping from user identities to group identifiers indicating the sharing of a quota
1.59 +.. across a number of users
1.60 +}}}
1.61 +
1.62 +== Store Structure ==
1.63 +
1.64 +The store information is retained in a collection of tables. Unlike the structure of
1.65 +the [[../FileStore|file store]] in the [[../FilesystemUsage|filesystem]], each table
1.66 +contains details for all users, with each query indicating the user to select
1.67 +the appropriate information.
1.68 +
1.69 +{{{#!table
1.70 +'''Table''' || '''Purpose'''
1.71 +==
1.72 +`countered_objects`
1.73 +|| Retains counter-proposals corresponding to events held in the `objects` table
1.74 +.. received by each user (`store_user`) from another user (`other`)
1.75 +==
1.76 +`countered_recurrences`
1.77 +|| Retains counter-proposals corresponding to events held in the `recurrences` table
1.78 +.. received by each user (`store_user`) from another user (`other`)
1.79 +==
1.80 +`freebusy`
1.81 +|| Period descriptions indicating start and end datetimes (in UTC), unique identifier
1.82 +.. (`object_uid`), transparency, recurrence identifier (`object_recurrenceid`),
1.83 +.. summary and organiser, reflecting the schedule of each user (`store_user`)
1.84 +==
1.85 +`freebusy_offers`
1.86 +|| Period descriptions for scheduling offers made by counter-proposals sent by each
1.87 +.. user (`store_user`)
1.88 +==
1.89 +`freebusy_other`
1.90 +|| Period descriptions received or deduced for a user (`store_user`) structured
1.91 +.. similarly to the user's own `freebusy` records
1.92 +==
1.93 +`freebusy_providers`
1.94 +|| Details of [[../EventRecurrences|recurring events]] for which new free/busy records
1.95 +.. must be [[../CronIntegration|periodically generated]] because these events recur
1.96 +.. indefinitely, selectable for each user (`store_user`)
1.97 +==
1.98 +`freebusy_provider_datetimes`
1.99 +|| Date/time details associated with the `freebusy_providers` information
1.100 +==
1.101 +`objects`
1.102 +|| Records for each user (`store_data`) containing received event data (`object_text`)
1.103 +==
1.104 +`requests`
1.105 +|| A collections of records, each belonging to a specific user (`store_user`)
1.106 +.. consisting of a unique identifier (`object_uid`), normalised recurrence identifier
1.107 +.. (`object_recurrenceid`) if appropriate, and (optionally) a scheduling method,
1.108 +.. indicating the availability of an incoming scheduling request for handling by a user
1.109 +==
1.110 +`recurrences`
1.111 +|| Records for each user (`store_data`) containing received recurrence event data
1.112 +.. (`object_text`)
1.113 +}}}