Note that there are some explanatory texts on larger screens.

plurals
  1. POModel for a Scheduling System
    primarykey
    data
    text
    <p>We have built a scheduling system to control our client's appointments. This system is similar to the one used by Prometric to schedule an exam. The main concerns are: guarantee that there is no overscheduling, support at least one hundred thousand appointments per month and allow to increase/decrease the testing center capacity easily.</p> <p>We devised the following design based on Capacity Vectors. We assumed that each appointment requires at least five minutes. A vector is composed by 288 slots (24 hours * 12 slots per hour), each one represented by one byte. The vector allows the system to represent up to 255 appointments every five minutes. The information used is composed by two vectors: one to store the testing center capacity <strong>(NOMINAL CAPACITY)</strong> and another to store the used capacity <strong>(USED CAPACITY)</strong>. To recover the current capacity <strong>(CURRENT CAPACITY)</strong>, the system takes the testing NOMINAL CAPACITY and subtracts the USED CAPACITY.</p> <p>The database has the following structure:</p> <h3>NOMINAL CAPACITY</h3> <p>The nominal capacity represents the capacity for work days (Mon-Fri).</p> <pre><code>| TEST_CENTER_ID | NOMINAL_CAPACITY | 1 | 0000001212121212....0000 | 2 | 0000005555555555....0000 ... | N | 0000000000010101....0000 </code></pre> <h3>USED CAPACITY</h3> <p>This table stores the used capacity for each day / testing center.</p> <pre><code>| TEST_CENTER_ID | DATE | USED_CAPACITY | 1 | 01/01/2010 | 0000001010101010...0000 | 1 | 01/02/2010 | 0000000202020202...0000 | 1 | 01/03/2010 | 0000001010101010...0000 ... | 2 | 01/01/2010 | 0000001010101010...0000 ... | N | 01/01/2010 | 0000000000000000...0000 </code></pre> <p>After the client chose the testing center and a date, the system presents the available slots doing the following calculation. For example: </p> <pre><code>TEST_CENTER_ID 1 DATE 01/01/2010 NOMINAL_CAPACITY 0000001212121212...0000 USED_CAPACITY 0000001010101010...0000 AVAILABLE_CAPAC 0000000202020202...0000 </code></pre> <p>If the client decides to schedule an appointment, the system locks the chosen day (a row in # USED CAPACITY table) and increases the corresponding byte. </p> <p>The system is working well now, but we foresee contention problems if the number of appointments increases too much.</p> <p>Does anyone has a better/another model for this problem or suggestions to improve it?</p> <p>We have thought in avoiding the contention by sub-diving the representation of a vector in hour and changing to an optimistic lock strategy. For example:</p> <pre><code>| TEST_CENTER_ID | DATE | USED_CAPACITY_0 | USED_CAPACITY_1 | ... | USED_CAPACITY_23 | 1 | 01/01/2010 | 000000101010 | 1010... | ... | ...0000 </code></pre> <p>This way will don't need to lock a row and reduce collision events.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload