{"action":"created","comment":{"url":"https://api.github.com/repos/mirage-kayvee/report/pulls/comments/29946680","id":29946680,"diff_hunk":"@@ -152,16 +180,55 @@ \\subsection{Overview}\n After the parse phase, the data is handed off to the Hashtbl module which responds with data or writes data.\n The response is then written to the client in RESP compatible format.\n \n+\\subsection{LWT}\n+\n Mirage uses the Lwt, cooperative threading library, extensively and every request is wrapped in a lightweight cooperative thread. Leveraging Mirage and OCaml guarantees type safety in both our application as well as in the implementations of frameworks underlying the application such as the TCP/IP stack, enhancing the security of our implementation.\n \n \n+\\subsection{Redis implementation}\n+\n+As Redis is a full featured and working database implementation it goes through a lot of steps that Keyvee does not.\n+It starts by initializing a server state structure, which is where it stores configuration information such as the port it is running on, database files, replication, sort parameters and various other data.\n+Redis is well written and one interesting things it does is set up number of shared objects or common Redis objects that are required by many different aspects of the system, one of them being a pool of shared integers which helps Redis being very efficient with memory.\n+Redis then creates a event loop, using epoll on Linux and kqueue on BSD and falls back to select if those are not available.\n+This is what makes Redis so responsive and allows it to be single threaded but still serve thousands of clients simultaneously, and is comparable to what LWT and the LWT event engine does for KeyVee.\n+After setting up the event loop, Redis further initalizes databases (it has support for multiple databases), TCP listening socket, sets up a server cron function which is called every 100 milliseconds and handles misc administrative tasks and finally registers a connection handler with the event loop and opens an append-only file if configured to do so.","path":"report.tex","position":223,"original_position":223,"commit_id":"06bd43dac9a9d94d8a597e6cd74e4d3de1287c73","original_commit_id":"06bd43dac9a9d94d8a597e6cd74e4d3de1287c73","user":{"login":"natebrennand","id":2801090,"avatar_url":"https://avatars.githubusercontent.com/u/2801090?v=3","gravatar_id":"","url":"https://api.github.com/users/natebrennand","html_url":"https://github.com/natebrennand","followers_url":"https://api.github.com/users/natebrennand/followers","following_url":"https://api.github.com/users/natebrennand/following{/other_user}","gists_url":"https://api.github.com/users/natebrennand/gists{/gist_id}","starred_url":"https://api.github.com/users/natebrennand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natebrennand/subscriptions","organizations_url":"https://api.github.com/users/natebrennand/orgs","repos_url":"https://api.github.com/users/natebrennand/repos","events_url":"https://api.github.com/users/natebrennand/events{/privacy}","received_events_url":"https://api.github.com/users/natebrennand/received_events","type":"User","site_admin":false},"body":"We should not that the file is for logs.","created_at":"2015-05-08T15:01:51Z","updated_at":"2015-05-08T15:01:51Z","html_url":"https://github.com/mirage-kayvee/report/pull/15#discussion_r29946680","pull_request_url":"https://api.github.com/repos/mirage-kayvee/report/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/mirage-kayvee/report/pulls/comments/29946680"},"html":{"href":"https://github.com/mirage-kayvee/report/pull/15#discussion_r29946680"},"pull_request":{"href":"https://api.github.com/repos/mirage-kayvee/report/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/mirage-kayvee/report/pulls/15","id":34871356,"html_url":"https://github.com/mirage-kayvee/report/pull/15","diff_url":"https://github.com/mirage-kayvee/report/pull/15.diff","patch_url":"https://github.com/mirage-kayvee/report/pull/15.patch","issue_url":"https://api.github.com/repos/mirage-kayvee/report/issues/15","number":15,"state":"open","locked":false,"title":"Initial 11 13","user":{"login":"gudbergur","id":21463,"avatar_url":"https://avatars.githubusercontent.com/u/21463?v=3","gravatar_id":"","url":"https://api.github.com/users/gudbergur","html_url":"https://github.com/gudbergur","followers_url":"https://api.github.com/users/gudbergur/followers","following_url":"https://api.github.com/users/gudbergur/following{/other_user}","gists_url":"https://api.github.com/users/gudbergur/gists{/gist_id}","starred_url":"https://api.github.com/users/gudbergur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gudbergur/subscriptions","organizations_url":"https://api.github.com/users/gudbergur/orgs","repos_url":"https://api.github.com/users/gudbergur/repos","events_url":"https://api.github.com/users/gudbergur/events{/privacy}","received_events_url":"https://api.github.com/users/gudbergur/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-06T23:37:46Z","updated_at":"2015-05-08T15:01:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7b8eed36abd6b7c23092af6b09477b86a18d0c5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mirage-kayvee/report/pulls/15/commits","review_comments_url":"https://api.github.com/repos/mirage-kayvee/report/pulls/15/comments","review_comment_url":"https://api.github.com/repos/mirage-kayvee/report/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mirage-kayvee/report/issues/15/comments","statuses_url":"https://api.github.com/repos/mirage-kayvee/report/statuses/06bd43dac9a9d94d8a597e6cd74e4d3de1287c73","head":{"label":"mirage-kayvee:addw","ref":"addw","sha":"06bd43dac9a9d94d8a597e6cd74e4d3de1287c73","user":{"login":"mirage-kayvee","id":11824869,"avatar_url":"https://avatars.githubusercontent.com/u/11824869?v=3","gravatar_id":"","url":"https://api.github.com/users/mirage-kayvee","html_url":"https://github.com/mirage-kayvee","followers_url":"https://api.github.com/users/mirage-kayvee/followers","following_url":"https://api.github.com/users/mirage-kayvee/following{/other_user}","gists_url":"https://api.github.com/users/mirage-kayvee/gists{/gist_id}","starred_url":"https://api.github.com/users/mirage-kayvee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirage-kayvee/subscriptions","organizations_url":"https://api.github.com/users/mirage-kayvee/orgs","repos_url":"https://api.github.com/users/mirage-kayvee/repos","events_url":"https://api.github.com/users/mirage-kayvee/events{/privacy}","received_events_url":"https://api.github.com/users/mirage-kayvee/received_events","type":"Organization","site_admin":false},"repo":{"id":33507096,"name":"report","full_name":"mirage-kayvee/report","owner":{"login":"mirage-kayvee","id":11824869,"avatar_url":"https://avatars.githubusercontent.com/u/11824869?v=3","gravatar_id":"","url":"https://api.github.com/users/mirage-kayvee","html_url":"https://github.com/mirage-kayvee","followers_url":"https://api.github.com/users/mirage-kayvee/followers","following_url":"https://api.github.com/users/mirage-kayvee/following{/other_user}","gists_url":"https://api.github.com/users/mirage-kayvee/gists{/gist_id}","starred_url":"https://api.github.com/users/mirage-kayvee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirage-kayvee/subscriptions","organizations_url":"https://api.github.com/users/mirage-kayvee/orgs","repos_url":"https://api.github.com/users/mirage-kayvee/repos","events_url":"https://api.github.com/users/mirage-kayvee/events{/privacy}","received_events_url":"https://api.github.com/users/mirage-kayvee/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mirage-kayvee/report","description":"","fork":false,"url":"https://api.github.com/repos/mirage-kayvee/report","forks_url":"https://api.github.com/repos/mirage-kayvee/report/forks","keys_url":"https://api.github.com/repos/mirage-kayvee/report/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mirage-kayvee/report/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mirage-kayvee/report/teams","hooks_url":"https://api.github.com/repos/mirage-kayvee/report/hooks","issue_events_url":"https://api.github.com/repos/mirage-kayvee/report/issues/events{/number}","events_url":"https://api.github.com/repos/mirage-kayvee/report/events","assignees_url":"https://api.github.com/repos/mirage-kayvee/report/assignees{/user}","branches_url":"https://api.github.com/repos/mirage-kayvee/report/branches{/branch}","tags_url":"https://api.github.com/repos/mirage-kayvee/report/tags","blobs_url":"https://api.github.com/repos/mirage-kayvee/report/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mirage-kayvee/report/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mirage-kayvee/report/git/refs{/sha}","trees_url":"https://api.github.com/repos/mirage-kayvee/report/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mirage-kayvee/report/statuses/{sha}","languages_url":"https://api.github.com/repos/mirage-kayvee/report/languages","stargazers_url":"https://api.github.com/repos/mirage-kayvee/report/stargazers","contributors_url":"https://api.github.com/repos/mirage-kayvee/report/contributors","subscribers_url":"https://api.github.com/repos/mirage-kayvee/report/subscribers","subscription_url":"https://api.github.com/repos/mirage-kayvee/report/subscription","commits_url":"https://api.github.com/repos/mirage-kayvee/report/commits{/sha}","git_commits_url":"https://api.github.com/repos/mirage-kayvee/report/git/commits{/sha}","comments_url":"https://api.github.com/repos/mirage-kayvee/report/comments{/number}","issue_comment_url":"https://api.github.com/repos/mirage-kayvee/report/issues/comments{/number}","contents_url":"https://api.github.com/repos/mirage-kayvee/report/contents/{+path}","compare_url":"https://api.github.com/repos/mirage-kayvee/report/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mirage-kayvee/report/merges","archive_url":"https://api.github.com/repos/mirage-kayvee/report/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mirage-kayvee/report/downloads","issues_url":"https://api.github.com/repos/mirage-kayvee/report/issues{/number}","pulls_url":"https://api.github.com/repos/mirage-kayvee/report/pulls{/number}","milestones_url":"https://api.github.com/repos/mirage-kayvee/report/milestones{/number}","notifications_url":"https://api.github.com/repos/mirage-kayvee/report/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mirage-kayvee/report/labels{/name}","releases_url":"https://api.github.com/repos/mirage-kayvee/report/releases{/id}","created_at":"2015-04-06T21:35:17Z","updated_at":"2015-05-07T22:25:15Z","pushed_at":"2015-05-08T06:48:40Z","git_url":"git://github.com/mirage-kayvee/report.git","ssh_url":"git@github.com:mirage-kayvee/report.git","clone_url":"https://github.com/mirage-kayvee/report.git","svn_url":"https://github.com/mirage-kayvee/report","homepage":null,"size":452,"stargazers_count":0,"watchers_count":0,"language":"TeX","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"mirage-kayvee:master","ref":"master","sha":"4c62feadd182676d49c50900e456eb2161626e63","user":{"login":"mirage-kayvee","id":11824869,"avatar_url":"https://avatars.githubusercontent.com/u/11824869?v=3","gravatar_id":"","url":"https://api.github.com/users/mirage-kayvee","html_url":"https://github.com/mirage-kayvee","followers_url":"https://api.github.com/users/mirage-kayvee/followers","following_url":"https://api.github.com/users/mirage-kayvee/following{/other_user}","gists_url":"https://api.github.com/users/mirage-kayvee/gists{/gist_id}","starred_url":"https://api.github.com/users/mirage-kayvee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirage-kayvee/subscriptions","organizations_url":"https://api.github.com/users/mirage-kayvee/orgs","repos_url":"https://api.github.com/users/mirage-kayvee/repos","events_url":"https://api.github.com/users/mirage-kayvee/events{/privacy}","received_events_url":"https://api.github.com/users/mirage-kayvee/received_events","type":"Organization","site_admin":false},"repo":{"id":33507096,"name":"report","full_name":"mirage-kayvee/report","owner":{"login":"mirage-kayvee","id":11824869,"avatar_url":"https://avatars.githubusercontent.com/u/11824869?v=3","gravatar_id":"","url":"https://api.github.com/users/mirage-kayvee","html_url":"https://github.com/mirage-kayvee","followers_url":"https://api.github.com/users/mirage-kayvee/followers","following_url":"https://api.github.com/users/mirage-kayvee/following{/other_user}","gists_url":"https://api.github.com/users/mirage-kayvee/gists{/gist_id}","starred_url":"https://api.github.com/users/mirage-kayvee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirage-kayvee/subscriptions","organizations_url":"https://api.github.com/users/mirage-kayvee/orgs","repos_url":"https://api.github.com/users/mirage-kayvee/repos","events_url":"https://api.github.com/users/mirage-kayvee/events{/privacy}","received_events_url":"https://api.github.com/users/mirage-kayvee/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mirage-kayvee/report","description":"","fork":false,"url":"https://api.github.com/repos/mirage-kayvee/report","forks_url":"https://api.github.com/repos/mirage-kayvee/report/forks","keys_url":"https://api.github.com/repos/mirage-kayvee/report/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mirage-kayvee/report/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mirage-kayvee/report/teams","hooks_url":"https://api.github.com/repos/mirage-kayvee/report/hooks","issue_events_url":"https://api.github.com/repos/mirage-kayvee/report/issues/events{/number}","events_url":"https://api.github.com/repos/mirage-kayvee/report/events","assignees_url":"https://api.github.com/repos/mirage-kayvee/report/assignees{/user}","branches_url":"https://api.github.com/repos/mirage-kayvee/report/branches{/branch}","tags_url":"https://api.github.com/repos/mirage-kayvee/report/tags","blobs_url":"https://api.github.com/repos/mirage-kayvee/report/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mirage-kayvee/report/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mirage-kayvee/report/git/refs{/sha}","trees_url":"https://api.github.com/repos/mirage-kayvee/report/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mirage-kayvee/report/statuses/{sha}","languages_url":"https://api.github.com/repos/mirage-kayvee/report/languages","stargazers_url":"https://api.github.com/repos/mirage-kayvee/report/stargazers","contributors_url":"https://api.github.com/repos/mirage-kayvee/report/contributors","subscribers_url":"https://api.github.com/repos/mirage-kayvee/report/subscribers","subscription_url":"https://api.github.com/repos/mirage-kayvee/report/subscription","commits_url":"https://api.github.com/repos/mirage-kayvee/report/commits{/sha}","git_commits_url":"https://api.github.com/repos/mirage-kayvee/report/git/commits{/sha}","comments_url":"https://api.github.com/repos/mirage-kayvee/report/comments{/number}","issue_comment_url":"https://api.github.com/repos/mirage-kayvee/report/issues/comments{/number}","contents_url":"https://api.github.com/repos/mirage-kayvee/report/contents/{+path}","compare_url":"https://api.github.com/repos/mirage-kayvee/report/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mirage-kayvee/report/merges","archive_url":"https://api.github.com/repos/mirage-kayvee/report/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mirage-kayvee/report/downloads","issues_url":"https://api.github.com/repos/mirage-kayvee/report/issues{/number}","pulls_url":"https://api.github.com/repos/mirage-kayvee/report/pulls{/number}","milestones_url":"https://api.github.com/repos/mirage-kayvee/report/milestones{/number}","notifications_url":"https://api.github.com/repos/mirage-kayvee/report/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mirage-kayvee/report/labels{/name}","releases_url":"https://api.github.com/repos/mirage-kayvee/report/releases{/id}","created_at":"2015-04-06T21:35:17Z","updated_at":"2015-05-07T22:25:15Z","pushed_at":"2015-05-08T06:48:40Z","git_url":"git://github.com/mirage-kayvee/report.git","ssh_url":"git@github.com:mirage-kayvee/report.git","clone_url":"https://github.com/mirage-kayvee/report.git","svn_url":"https://github.com/mirage-kayvee/report","homepage":null,"size":452,"stargazers_count":0,"watchers_count":0,"language":"TeX","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mirage-kayvee/report/pulls/15"},"html":{"href":"https://github.com/mirage-kayvee/report/pull/15"},"issue":{"href":"https://api.github.com/repos/mirage-kayvee/report/issues/15"},"comments":{"href":"https://api.github.com/repos/mirage-kayvee/report/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/mirage-kayvee/report/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/mirage-kayvee/report/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mirage-kayvee/report/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/mirage-kayvee/report/statuses/06bd43dac9a9d94d8a597e6cd74e4d3de1287c73"}}}}