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