{"action":"created","issue":{"url":"https://api.github.com/repos/amaster507/ifbmt/issues/29","repository_url":"https://api.github.com/repos/amaster507/ifbmt","labels_url":"https://api.github.com/repos/amaster507/ifbmt/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/amaster507/ifbmt/issues/29/comments","events_url":"https://api.github.com/repos/amaster507/ifbmt/issues/29/events","html_url":"https://github.com/amaster507/ifbmt/issues/29","id":256447483,"number":29,"title":"Technical: Database Design","user":{"login":"amaster507","id":2472115,"avatar_url":"https://avatars1.githubusercontent.com/u/2472115?v=4","gravatar_id":"","url":"https://api.github.com/users/amaster507","html_url":"https://github.com/amaster507","followers_url":"https://api.github.com/users/amaster507/followers","following_url":"https://api.github.com/users/amaster507/following{/other_user}","gists_url":"https://api.github.com/users/amaster507/gists{/gist_id}","starred_url":"https://api.github.com/users/amaster507/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaster507/subscriptions","organizations_url":"https://api.github.com/users/amaster507/orgs","repos_url":"https://api.github.com/users/amaster507/repos","events_url":"https://api.github.com/users/amaster507/events{/privacy}","received_events_url":"https://api.github.com/users/amaster507/received_events","type":"User","site_admin":false},"labels":[{"id":682689474,"url":"https://api.github.com/repos/amaster507/ifbmt/labels/calendar","name":"calendar","color":"0e8a16","default":false},{"id":687311143,"url":"https://api.github.com/repos/amaster507/ifbmt/labels/contacts","name":"contacts","color":"bfdadc","default":false},{"id":687879497,"url":"https://api.github.com/repos/amaster507/ifbmt/labels/database","name":"database","color":"006b75","default":false},{"id":687880763,"url":"https://api.github.com/repos/amaster507/ifbmt/labels/technical","name":"technical","color":"0052cc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/amaster507/ifbmt/milestones/1","html_url":"https://github.com/amaster507/ifbmt/milestone/1","labels_url":"https://api.github.com/repos/amaster507/ifbmt/milestones/1/labels","id":2737587,"number":1,"title":"Brain Storming","description":"This is the first step of the project to allow input from users how they would expect the app to work. These ideas and processes should include feature request and workflows.","creator":{"login":"amaster507","id":2472115,"avatar_url":"https://avatars1.githubusercontent.com/u/2472115?v=4","gravatar_id":"","url":"https://api.github.com/users/amaster507","html_url":"https://github.com/amaster507","followers_url":"https://api.github.com/users/amaster507/followers","following_url":"https://api.github.com/users/amaster507/following{/other_user}","gists_url":"https://api.github.com/users/amaster507/gists{/gist_id}","starred_url":"https://api.github.com/users/amaster507/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaster507/subscriptions","organizations_url":"https://api.github.com/users/amaster507/orgs","repos_url":"https://api.github.com/users/amaster507/repos","events_url":"https://api.github.com/users/amaster507/events{/privacy}","received_events_url":"https://api.github.com/users/amaster507/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":21,"state":"closed","created_at":"2017-09-01T03:56:34Z","updated_at":"2017-12-06T20:45:37Z","due_on":"2017-09-30T07:00:00Z","closed_at":"2017-09-27T14:16:47Z"},"comments":13,"created_at":"2017-09-09T15:52:44Z","updated_at":"2017-12-07T17:56:24Z","closed_at":"2017-09-27T14:59:47Z","author_association":"OWNER","body":"_This is more of a technical programming question than most of the others up to this point._\r\n\r\nIn #11 it was decided to support recurring events. This support for recurrence should follow standard protocol defined in [RFC5545 3.8.5](https://tools.ietf.org/html/rfc5545#section-3.8.5). What needs to be discussed here is the best method to store and retrieve recurrance information in regards to ifbmt and its database. This needs to be normalized to be quick for the user and not create excessive work for the server slowing down other users.\r\n\r\nThere are two parts to recurring events, these being _1)_ The saved data and _2)_ The logic. The logic is the application's code taking the data and actually plotting the recurrence events.\r\n\r\nNow here is the problem: \"**How to save the data?**\" How the data is saved will determine the need for complexity of the logic. There are two main thoughts of how recurring data should be saved:\r\n1. **EVERY OCCURANCE**: Save every occurrence as a separate row in the database\r\n\r\n    **_Pros_**: Easy to query and display on a calendar. Easy to modify or cancel a specific occurrence of an event.\r\n    **_Cons_**: Large storage space is required. There has to be some form of limitation on never ending events (usually [2038](https://en.wikipedia.org/wiki/Year_2038_problem)). _Creation_ of new events is **really expensive** on the server and updating the event in bulk is very limited. Exporting the recurring event to ICS format does not follow standard protocol.\r\n\r\n2. **RULES**: Save each event a single time and then save the rules for recurrence and exceptions to the rule.\r\n\r\n    **_Pros_**: Easy to add exception rules to cancel or modify single or future occurrences. Creating a reoccurring event does not put any over bearing load on the server.\r\n    **_Cons_**: Hard to query and display busy and available dates. _Displaying_ events is **really expensive** load on the server. A calendar with many recurring events would take a very long time to load.\r\n\r\n**My Idea:** Mix both thoughts into a unique integration. \r\n- Store events as single events in the database and store the reoccurring rules.\r\n- Store single exceptions to the rules by referencing the occurrence date and time.\r\n- Allow rules to start and possibly end which allows never ending as well as rules to stop and start again with modification. For instance a event was on every Thursday and then was changed to Every Tuesday.\r\n- Store Calculated occurrences in a small table with a datetime of creation, and update the main event table to signify to what extent dates are calculated.\r\n- Build logic to check if recurring event is calculated to requested date range and if not calculate recurrence on demand and save to occurrences table.\r\n\r\n**_Pros_**: Easy to update occurrence rules and delete all future occurrences that were needed and recreate occurences as needed. Calendar loads after first request for the date range will be speedily available. Expense on the server is balanced out between event creation and initial event display. Exported events follow iCalendar protocol.\r\n**_Cons_**: More logic is needed.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/amaster507/ifbmt/issues/comments/350045391","html_url":"https://github.com/amaster507/ifbmt/issues/29#issuecomment-350045391","issue_url":"https://api.github.com/repos/amaster507/ifbmt/issues/29","id":350045391,"user":{"login":"amaster507","id":2472115,"avatar_url":"https://avatars1.githubusercontent.com/u/2472115?v=4","gravatar_id":"","url":"https://api.github.com/users/amaster507","html_url":"https://github.com/amaster507","followers_url":"https://api.github.com/users/amaster507/followers","following_url":"https://api.github.com/users/amaster507/following{/other_user}","gists_url":"https://api.github.com/users/amaster507/gists{/gist_id}","starred_url":"https://api.github.com/users/amaster507/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaster507/subscriptions","organizations_url":"https://api.github.com/users/amaster507/orgs","repos_url":"https://api.github.com/users/amaster507/repos","events_url":"https://api.github.com/users/amaster507/events{/privacy}","received_events_url":"https://api.github.com/users/amaster507/received_events","type":"User","site_admin":false},"created_at":"2017-12-07T17:56:24Z","updated_at":"2017-12-07T17:56:24Z","author_association":"OWNER","body":"This has been slightly outdated with changes needed during development, but this remains the same as the core data structure. I will return and update this after more of service is completed."}}
{"actor":{"display_login":"amaster507"}}