1 = Database Store = 2 3 The database data store offers a mechanism for storing calendar objects and free/busy 4 details in a database system, currently focusing on relational database systems, with 5 specific support for PostgreSQL. 6 7 Benefits of the database store include convenient and standardised interfaces for 8 querying and inspecting the data, together with various guarantees around the durability 9 of the stored data. However, more administrative knowledge is usually required to operate 10 database installations satisfactorily, and activities such as archiving require extra 11 planning and expertise. 12 13 The [[../FileStore|file store]] offers a more convenient method of managing calendar 14 data, albeit offering arguably less scalability and less convenience when data volumes 15 become significantly large. 16 17 == Configuration Settings == 18 19 The [[../Configuration|configuration]] files (`config.sh` and `config.py`) need to be 20 updated when choosing a database store. 21 22 {{{#!table 23 '''File''' || '''Setting''' || '''Value''' || '''Description''' 24 == 25 `config.sh` 26 ||<rowspan="2"> `STORE_TYPE` 27 ||<rowspan="2"> `postgresql` 28 ||<rowspan="2"> Selects a specific database store type; currently, only `postgresql` 29 .. is supported 30 == 31 `config.py` 32 == 33 <rowspan="2"> `config.py` 34 || `STORE_DIR` 35 || `dbname=imip_agent` 36 || Indicates a connection string for the store database 37 == 38 `JOURNAL_DIR` 39 || `dbname=imip_agent` 40 || Indicates a connection string for the journal database 41 }}} 42 43 == Journal Structure == 44 45 The journal information is retained in a collection of tables. Unlike the structure of 46 the [[../FileStore|file store]] in the [[../FilesystemUsage|filesystem]], each table 47 contains details for all quota groups, with each query indicating the group to select 48 the appropriate information. 49 50 {{{#!table 51 '''Table''' || '''Purpose''' 52 == 53 `freebusy_other` 54 || Period descriptions describing reservations for resources sharing a quota 55 .. (`store_user`) made by users or groups (`other`), structured similarly to the 56 .. `freebusy` table in the data store; this may be the same table as the one employed 57 .. by the data store to store received or deduced free/busy details 58 == 59 `quota_limits` 60 || A mapping from user identities or group identifiers to quota limits 61 == 62 `user_groups` 63 || A mapping from user identities to group identifiers indicating the sharing of a quota 64 .. across a number of users 65 }}} 66 67 == Store Structure == 68 69 The store information is retained in a collection of tables. Unlike the structure of 70 the [[../FileStore|file store]] in the [[../FilesystemUsage|filesystem]], each table 71 contains details for all users, with each query indicating the user to select 72 the appropriate information. 73 74 {{{#!table 75 '''Table''' || '''Purpose''' 76 == 77 `countered_objects` 78 || Retains counter-proposals corresponding to events held in the `objects` table 79 .. received by each user (`store_user`) from another user (`other`) 80 == 81 `countered_recurrences` 82 || Retains counter-proposals corresponding to events held in the `recurrences` table 83 .. received by each user (`store_user`) from another user (`other`) 84 == 85 `freebusy` 86 || Period descriptions indicating start and end datetimes (in UTC), unique identifier 87 .. (`object_uid`), transparency, recurrence identifier (`object_recurrenceid`), 88 .. summary and organiser, reflecting the schedule of each user (`store_user`) 89 == 90 `freebusy_offers` 91 || Period descriptions for scheduling offers made by counter-proposals sent by each 92 .. user (`store_user`) 93 == 94 `freebusy_other` 95 || Period descriptions received or deduced for a user (`store_user`) structured 96 .. similarly to the user's own `freebusy` records 97 == 98 `freebusy_providers` 99 || Details of [[../EventRecurrences|recurring events]] for which new free/busy records 100 .. must be [[../CronIntegration|periodically generated]] because these events recur 101 .. indefinitely, selectable for each user (`store_user`) 102 == 103 `freebusy_provider_datetimes` 104 || Date/time details associated with the `freebusy_providers` information 105 == 106 `objects` 107 || Records for each user (`store_data`) containing received event data (`object_text`) 108 == 109 `requests` 110 || A collections of records, each belonging to a specific user (`store_user`) 111 .. consisting of a unique identifier (`object_uid`), normalised recurrence identifier 112 .. (`object_recurrenceid`) if appropriate, and (optionally) a scheduling method, 113 .. indicating the availability of an incoming scheduling request for handling by a user 114 == 115 `recurrences` 116 || Records for each user (`store_data`) containing received recurrence event data 117 .. (`object_text`) 118 }}}