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 `freebusy_providers` 60 || Details of [[../EventRecurrences|recurring events]] for which new free/busy records 61 .. must be [[../CronIntegration|periodically generated]] because these events recur 62 .. indefinitely, selectable for each user (`store_user`) 63 == 64 `freebusy_provider_datetimes` 65 || Date/time details associated with the `freebusy_providers` information 66 == 67 `quota_delegates` 68 || Details of the identities (`store_user`) employing each quota (`quota`) to 69 .. consolidate their schedules, between which delegation may take place if their 70 .. schedules permit it 71 == 72 `quota_limits` 73 || A mapping from user identities or group identifiers to quota limits 74 == 75 `user_groups` 76 || A mapping from user identities to group identifiers indicating the sharing of a quota 77 .. across a number of users 78 }}} 79 80 == Store Structure == 81 82 The store information is retained in a collection of tables. Unlike the structure of 83 the [[../FileStore|file store]] in the [[../FilesystemUsage|filesystem]], each table 84 contains details for all users, with each query indicating the user to select 85 the appropriate information. 86 87 {{{#!table 88 '''Table''' || '''Purpose''' 89 == 90 `countered_objects` 91 || Retains counter-proposals corresponding to events held in the `objects` table 92 .. received by each user (`store_user`) from another user (`other`) 93 == 94 `countered_recurrences` 95 || Retains counter-proposals corresponding to events held in the `recurrences` table 96 .. received by each user (`store_user`) from another user (`other`) 97 == 98 `freebusy` 99 || Period descriptions indicating start and end datetimes (in UTC), unique identifier 100 .. (`object_uid`), transparency, recurrence identifier (`object_recurrenceid`), 101 .. summary and organiser, reflecting the schedule of each user (`store_user`) 102 == 103 `freebusy_offers` 104 || Period descriptions for scheduling offers made by counter-proposals sent by each 105 .. user (`store_user`) 106 == 107 `freebusy_other` 108 || Period descriptions received or deduced for a user (`store_user`) structured 109 .. similarly to the user's own `freebusy` records 110 == 111 `freebusy_providers` 112 || Details of [[../EventRecurrences|recurring events]] for which new free/busy records 113 .. must be [[../CronIntegration|periodically generated]] because these events recur 114 .. indefinitely, selectable for each user (`store_user`) 115 == 116 `freebusy_provider_datetimes` 117 || Date/time details associated with the `freebusy_providers` information 118 == 119 `objects` 120 || Records for each user (`store_data`) containing received event data (`object_text`) 121 == 122 `requests` 123 || A collections of records, each belonging to a specific user (`store_user`) 124 .. consisting of a unique identifier (`object_uid`), normalised recurrence identifier 125 .. (`object_recurrenceid`) if appropriate, and (optionally) a scheduling method, 126 .. indicating the availability of an incoming scheduling request for handling by a user 127 == 128 `recurrences` 129 || Records for each user (`store_data`) containing received recurrence event data 130 .. (`object_text`) 131 }}}