{"action":"created","comment":{"url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/comments/92143138","pull_request_review_id":12650527,"id":92143138,"diff_hunk":"@@ -0,0 +1,52 @@\n+---\n+title: How I removed two databases in one pull request\n+authors: tge\n+---\n+\n+My first project right after school was called KISS which means\n+\n+*[Keep it simple, stupid](https://en.wikipedia.org/wiki/KISS_principle)*\n+\n+\n+Three years and a few IT projects later, I thought that I got it right and applied the following rules:\n+\n+* keep your applications small and simple,\n+* remove most of its complexity,\n+* don't over-engineer,\n+* all code and user stories have to be maintained (<abbr title=\"You Ain't Gonna Need It\">YAGNI</abbr>)\n+\n+\n+Yet a few weeks ago, I learned that you can always remove useless things. You just don't know it yet.\n+\n+### Story time\n+\n+I wanted to create an API above the drugs data set ([freely provided by the French government as CSV files](https://www.data.gouv.fr/fr/datasets/base-de-donnees-publique-des-medicaments-base-officielle/)). I knew that I needed a script to parse and store the data and a web API to expose them. The code is on [github](https://github.com/sgmap/api-medicaments) and the application is [live](http://medicaments.api.gouv.fr).\n+When I start a web application, I have 2 main choices to make:\n+\n+* **Choose a platform**: I picked nodejs, for the only reason that I am proficient in it\n+* **Choose a database**: I took part to a similar project where I used readDB, commonly called mongoDB. It was painfully slow when upserting lots of data, so I chose couchbase instead, a key/value store with a document query language.\n+\n+After a while I needed \"full text\" search, so I added elasticsearch, simply because I knew how to use it. It requires a few (ugly) [scripts](https://github.com/sgmap/api-medicaments/blob/de576c3cebd78b3bc80ba3b272669b06718c6e51/bin/prepareDataBase.sh) to automate its synchronization with couchbase.","path":"_posts/2016-10-16-how-i-removed-two-databases-with-one-pull-request.md","position":29,"original_position":29,"commit_id":"3a95c81ea36ec2e3b820978641c939069485e230","original_commit_id":"3a95c81ea36ec2e3b820978641c939069485e230","user":{"login":"MattiSG","id":222463,"avatar_url":"https://avatars.githubusercontent.com/u/222463?v=3","gravatar_id":"","url":"https://api.github.com/users/MattiSG","html_url":"https://github.com/MattiSG","followers_url":"https://api.github.com/users/MattiSG/followers","following_url":"https://api.github.com/users/MattiSG/following{/other_user}","gists_url":"https://api.github.com/users/MattiSG/gists{/gist_id}","starred_url":"https://api.github.com/users/MattiSG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MattiSG/subscriptions","organizations_url":"https://api.github.com/users/MattiSG/orgs","repos_url":"https://api.github.com/users/MattiSG/repos","events_url":"https://api.github.com/users/MattiSG/events{/privacy}","received_events_url":"https://api.github.com/users/MattiSG/received_events","type":"User","site_admin":false},"body":"ElasticSearch, CouchBase.","created_at":"2016-12-13T10:51:26Z","updated_at":"2016-12-13T10:54:14Z","html_url":"https://github.com/sgmap/beta.gouv.fr/pull/413#discussion_r92143138","pull_request_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/413","_links":{"self":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/comments/92143138"},"html":{"href":"https://github.com/sgmap/beta.gouv.fr/pull/413#discussion_r92143138"},"pull_request":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/413"}}},"pull_request":{"url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/413","id":93765534,"html_url":"https://github.com/sgmap/beta.gouv.fr/pull/413","diff_url":"https://github.com/sgmap/beta.gouv.fr/pull/413.diff","patch_url":"https://github.com/sgmap/beta.gouv.fr/pull/413.patch","issue_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/413","number":413,"state":"open","locked":false,"title":"Illustrate benefits of simplicity and removing code","user":{"login":"ThibautGery","id":5861569,"avatar_url":"https://avatars.githubusercontent.com/u/5861569?v=3","gravatar_id":"","url":"https://api.github.com/users/ThibautGery","html_url":"https://github.com/ThibautGery","followers_url":"https://api.github.com/users/ThibautGery/followers","following_url":"https://api.github.com/users/ThibautGery/following{/other_user}","gists_url":"https://api.github.com/users/ThibautGery/gists{/gist_id}","starred_url":"https://api.github.com/users/ThibautGery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThibautGery/subscriptions","organizations_url":"https://api.github.com/users/ThibautGery/orgs","repos_url":"https://api.github.com/users/ThibautGery/repos","events_url":"https://api.github.com/users/ThibautGery/events{/privacy}","received_events_url":"https://api.github.com/users/ThibautGery/received_events","type":"User","site_admin":false},"body":"Ajout d'un post de blog que j'avais oublié dans mes cartons.\r\n\r\nPoints d'attention :\r\n* C'est en anglais\r\n* Il n'y pas d'image\r\n* c'est sur un produit de l'incubateur mais non référencé sur beta.gouv\r\n\r\nBonne journée les copains","created_at":"2016-11-15T13:31:39Z","updated_at":"2016-12-13T10:54:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbb562986b5559f92f4a3fe3da2fa319a5673504","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/413/commits","review_comments_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/413/comments","review_comment_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/413/comments","statuses_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/statuses/3a95c81ea36ec2e3b820978641c939069485e230","head":{"label":"ThibautGery:master","ref":"master","sha":"3a95c81ea36ec2e3b820978641c939069485e230","user":{"login":"ThibautGery","id":5861569,"avatar_url":"https://avatars.githubusercontent.com/u/5861569?v=3","gravatar_id":"","url":"https://api.github.com/users/ThibautGery","html_url":"https://github.com/ThibautGery","followers_url":"https://api.github.com/users/ThibautGery/followers","following_url":"https://api.github.com/users/ThibautGery/following{/other_user}","gists_url":"https://api.github.com/users/ThibautGery/gists{/gist_id}","starred_url":"https://api.github.com/users/ThibautGery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThibautGery/subscriptions","organizations_url":"https://api.github.com/users/ThibautGery/orgs","repos_url":"https://api.github.com/users/ThibautGery/repos","events_url":"https://api.github.com/users/ThibautGery/events{/privacy}","received_events_url":"https://api.github.com/users/ThibautGery/received_events","type":"User","site_admin":false},"repo":{"id":50431957,"name":"sgmap.github.io","full_name":"ThibautGery/sgmap.github.io","owner":{"login":"ThibautGery","id":5861569,"avatar_url":"https://avatars.githubusercontent.com/u/5861569?v=3","gravatar_id":"","url":"https://api.github.com/users/ThibautGery","html_url":"https://github.com/ThibautGery","followers_url":"https://api.github.com/users/ThibautGery/followers","following_url":"https://api.github.com/users/ThibautGery/following{/other_user}","gists_url":"https://api.github.com/users/ThibautGery/gists{/gist_id}","starred_url":"https://api.github.com/users/ThibautGery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThibautGery/subscriptions","organizations_url":"https://api.github.com/users/ThibautGery/orgs","repos_url":"https://api.github.com/users/ThibautGery/repos","events_url":"https://api.github.com/users/ThibautGery/events{/privacy}","received_events_url":"https://api.github.com/users/ThibautGery/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ThibautGery/sgmap.github.io","description":"Le site public de l'Incubateur de Services Numériques de l'État français.","fork":true,"url":"https://api.github.com/repos/ThibautGery/sgmap.github.io","forks_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/forks","keys_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/teams","hooks_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/hooks","issue_events_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/issues/events{/number}","events_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/events","assignees_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/assignees{/user}","branches_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/branches{/branch}","tags_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/tags","blobs_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/statuses/{sha}","languages_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/languages","stargazers_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/stargazers","contributors_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/contributors","subscribers_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/subscribers","subscription_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/subscription","commits_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/contents/{+path}","compare_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/merges","archive_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/downloads","issues_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/issues{/number}","pulls_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/pulls{/number}","milestones_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/milestones{/number}","notifications_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/labels{/name}","releases_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/releases{/id}","deployments_url":"https://api.github.com/repos/ThibautGery/sgmap.github.io/deployments","created_at":"2016-01-26T13:56:49Z","updated_at":"2016-11-15T13:06:55Z","pushed_at":"2016-11-15T13:33:41Z","git_url":"git://github.com/ThibautGery/sgmap.github.io.git","ssh_url":"git@github.com:ThibautGery/sgmap.github.io.git","clone_url":"https://github.com/ThibautGery/sgmap.github.io.git","svn_url":"https://github.com/ThibautGery/sgmap.github.io","homepage":"sgmap.github.io","size":22044,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sgmap:master","ref":"master","sha":"97fc738c91b839e8b897fd0df91411bf200c3eae","user":{"login":"sgmap","id":7874148,"avatar_url":"https://avatars.githubusercontent.com/u/7874148?v=3","gravatar_id":"","url":"https://api.github.com/users/sgmap","html_url":"https://github.com/sgmap","followers_url":"https://api.github.com/users/sgmap/followers","following_url":"https://api.github.com/users/sgmap/following{/other_user}","gists_url":"https://api.github.com/users/sgmap/gists{/gist_id}","starred_url":"https://api.github.com/users/sgmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgmap/subscriptions","organizations_url":"https://api.github.com/users/sgmap/orgs","repos_url":"https://api.github.com/users/sgmap/repos","events_url":"https://api.github.com/users/sgmap/events{/privacy}","received_events_url":"https://api.github.com/users/sgmap/received_events","type":"Organization","site_admin":false},"repo":{"id":48237006,"name":"beta.gouv.fr","full_name":"sgmap/beta.gouv.fr","owner":{"login":"sgmap","id":7874148,"avatar_url":"https://avatars.githubusercontent.com/u/7874148?v=3","gravatar_id":"","url":"https://api.github.com/users/sgmap","html_url":"https://github.com/sgmap","followers_url":"https://api.github.com/users/sgmap/followers","following_url":"https://api.github.com/users/sgmap/following{/other_user}","gists_url":"https://api.github.com/users/sgmap/gists{/gist_id}","starred_url":"https://api.github.com/users/sgmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgmap/subscriptions","organizations_url":"https://api.github.com/users/sgmap/orgs","repos_url":"https://api.github.com/users/sgmap/repos","events_url":"https://api.github.com/users/sgmap/events{/privacy}","received_events_url":"https://api.github.com/users/sgmap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sgmap/beta.gouv.fr","description":"Le site public de l'Incubateur de Services Numériques de l'État français.","fork":false,"url":"https://api.github.com/repos/sgmap/beta.gouv.fr","forks_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/forks","keys_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/teams","hooks_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/hooks","issue_events_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/events{/number}","events_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/events","assignees_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/assignees{/user}","branches_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/branches{/branch}","tags_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/tags","blobs_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/refs{/sha}","trees_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/statuses/{sha}","languages_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/languages","stargazers_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/stargazers","contributors_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/contributors","subscribers_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/subscribers","subscription_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/subscription","commits_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/commits{/sha}","git_commits_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/git/commits{/sha}","comments_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/comments{/number}","issue_comment_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/comments{/number}","contents_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/contents/{+path}","compare_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/merges","archive_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/downloads","issues_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues{/number}","pulls_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls{/number}","milestones_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/milestones{/number}","notifications_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/labels{/name}","releases_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/releases{/id}","deployments_url":"https://api.github.com/repos/sgmap/beta.gouv.fr/deployments","created_at":"2015-12-18T13:33:48Z","updated_at":"2016-12-02T14:52:41Z","pushed_at":"2016-12-12T18:02:50Z","git_url":"git://github.com/sgmap/beta.gouv.fr.git","ssh_url":"git@github.com:sgmap/beta.gouv.fr.git","clone_url":"https://github.com/sgmap/beta.gouv.fr.git","svn_url":"https://github.com/sgmap/beta.gouv.fr","homepage":"https://beta.gouv.fr","size":30016,"stargazers_count":20,"watchers_count":20,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":37,"mirror_url":null,"open_issues_count":16,"forks":37,"open_issues":16,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/413"},"html":{"href":"https://github.com/sgmap/beta.gouv.fr/pull/413"},"issue":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/413"},"comments":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/issues/413/comments"},"review_comments":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/413/comments"},"review_comment":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/pulls/413/commits"},"statuses":{"href":"https://api.github.com/repos/sgmap/beta.gouv.fr/statuses/3a95c81ea36ec2e3b820978641c939069485e230"}}}}
{"actor":{"display_login":"MattiSG"}}