{"action":"created","comment":{"url":"https://api.github.com/repos/se-edu/learningresources/pulls/comments/174668780","pull_request_review_id":104066279,"id":174668780,"diff_hunk":"@@ -33,9 +33,40 @@ There are a few common bottlenecks that can be avoided such as database querying\n \n There are many program profilers available that you can use to find the bottlenecks in your server. By finding out where the server spends most computational time in, you can potentially save huge amounts of time.\n \n-Performance bottlenecks ([resource](https://www.apicasystem.com/blog/5-common-performance-bottlenecks/))\n+1. More details on the common performance bottlenecks ([resource](https://www.apicasystem.com/blog/5-common-performance-bottlenecks))\n \n-Non-Relational Database ([resource](http://www.jamesserra.com/archive/2015/08/relational-databases-vs-non-relational-databases/)) ([resource](https://www.pluralsight.com/blog/software-development/relational-non-relational-databases))\n+1. Relational vs Non-Relational Database ([resource](http://www.jamesserra.com/archive/2015/08/relational-databases-vs-non-relational-databases)) ([resource](https://www.pluralsight.com/blog/software-development/relational-non-relational-databases))\n+\n+### Caching\n+With an increasing user base, your server has to deal with a larger number of requests along with the bottlenecks mentioned previously such as network congestion and database querying. As a result, the response becomes slower. This is where caching comes in order to meet this demand. A cache is a key-value store that resides between the application and the database which can either be in the browser or part of your server infrastructure itself. By retrieving data from the cache instead of the database, the response time reduces greatly.\n+\n+The next thing to consider is what to cache. The rule of thumb is to cache data that is frequently accessed and read more often than it is updated. With this, cache hits would be more often than cache misses and as a result, the time saved from faster accesses and reads outweighs the extra time taken to populate the cache.  \n+\n+1. Scalability using caches ([resource](http://www.lecloud.net/post/9246290032/scalability-for-dummies-part-3-cache))\n+\n+1. Scalability best practices ([resource](https://www.infoq.com/articles/ebay-scalability-best-practices))\n+\n+### Sharding \n+As your traffic increases your data increases as well and as a result, your database gets overloaded. One way to mitigate this is to scale your database by sharding. Sharding is a method of splitting and storing a single logical dataset in multiple databases. More specifically, it is the storing of data horizontally - storing rows of a same table in multiple database nodes instead of storing them in the usual vertical way - storing different tables & columns in a separate database.\n+\n+Sharding is essential when your dataset becomes too large to store in a single database. It reduces the number of rows in each table and as such improves search performance since the search is done on a smaller table. \n+\n+Querying the databases containing only the relevant partitions becomes possible as well. For instance, if a database contains a column for age, then you can partition the rows according to an age group and store them in different databases. Whenever there is a need to access the data of a particular age group, instead of querying the whole database, you just need to query the partition that contains that age group. This allows your database to scale along with your data and traffic growth.\n+\n+1. How Sharding Works ([resource](https://medium.com/@jeeyoungk/how-sharding-works-b4dec46b3f6))\n+\n+1. A StackOverflow post on Sharding ([resource](https://stackoverflow.com/questions/992988/what-is-sharding-and-why-is-it-important))\n+\n+### Go Asynchronous \n+Unlike synchronous operations, which runs sequentially and waits for the previous operation to complete before moving on to the next, asynchronous operations are non-blocking and operate independently of each other instead. As a result other operations do not have to wait for asynchronous operations to finish.\n+\n+If one component A calls another component B synchronously, they are tightly coupled. As a result, to scale A, you must also scale B. By using asynchronous operations, components are decoupled and can be scaled independently of one another.","path":"contents/scalability/scalable-development.md","position":45,"original_position":45,"commit_id":"b51b90aef556f51d7b55e1986e7f908491e519c4","original_commit_id":"b51b90aef556f51d7b55e1986e7f908491e519c4","user":{"login":"vivekscl","id":17037188,"avatar_url":"https://avatars0.githubusercontent.com/u/17037188?v=4","gravatar_id":"","url":"https://api.github.com/users/vivekscl","html_url":"https://github.com/vivekscl","followers_url":"https://api.github.com/users/vivekscl/followers","following_url":"https://api.github.com/users/vivekscl/following{/other_user}","gists_url":"https://api.github.com/users/vivekscl/gists{/gist_id}","starred_url":"https://api.github.com/users/vivekscl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivekscl/subscriptions","organizations_url":"https://api.github.com/users/vivekscl/orgs","repos_url":"https://api.github.com/users/vivekscl/repos","events_url":"https://api.github.com/users/vivekscl/events{/privacy}","received_events_url":"https://api.github.com/users/vivekscl/received_events","type":"User","site_admin":false},"body":"> What do you mean by 'scaling a component'?\r\n\r\nBy that, I meant if component A has to be modified to deal with higher traffic to component A only, then component B has to be modified as well since A is tightly coupled to B. If asynchronous programming is done, then they are decoupled and only A has to be modified to deal with the higher traffic instead of modifying a component that is not affected by the traffic growth.\r\n\r\nBut then again if this concept is more confusing than anything, I should remove it instead? ","created_at":"2018-03-15T03:29:51Z","updated_at":"2018-03-15T03:29:51Z","html_url":"https://github.com/se-edu/learningresources/pull/33#discussion_r174668780","pull_request_url":"https://api.github.com/repos/se-edu/learningresources/pulls/33","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/se-edu/learningresources/pulls/comments/174668780"},"html":{"href":"https://github.com/se-edu/learningresources/pull/33#discussion_r174668780"},"pull_request":{"href":"https://api.github.com/repos/se-edu/learningresources/pulls/33"}},"in_reply_to_id":173644833},"pull_request":{"url":"https://api.github.com/repos/se-edu/learningresources/pulls/33","id":171231891,"html_url":"https://github.com/se-edu/learningresources/pull/33","diff_url":"https://github.com/se-edu/learningresources/pull/33.diff","patch_url":"https://github.com/se-edu/learningresources/pull/33.patch","issue_url":"https://api.github.com/repos/se-edu/learningresources/issues/33","number":33,"state":"open","locked":false,"title":"Update Scalability by adding more ways to scale","user":{"login":"vivekscl","id":17037188,"avatar_url":"https://avatars0.githubusercontent.com/u/17037188?v=4","gravatar_id":"","url":"https://api.github.com/users/vivekscl","html_url":"https://github.com/vivekscl","followers_url":"https://api.github.com/users/vivekscl/followers","following_url":"https://api.github.com/users/vivekscl/following{/other_user}","gists_url":"https://api.github.com/users/vivekscl/gists{/gist_id}","starred_url":"https://api.github.com/users/vivekscl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivekscl/subscriptions","organizations_url":"https://api.github.com/users/vivekscl/orgs","repos_url":"https://api.github.com/users/vivekscl/repos","events_url":"https://api.github.com/users/vivekscl/events{/privacy}","received_events_url":"https://api.github.com/users/vivekscl/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-25T14:10:41Z","updated_at":"2018-03-15T03:29:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"129ad5888d1a0750035ed5d1403a07857613e8f1","assignee":{"login":"Crphang","id":4986717,"avatar_url":"https://avatars3.githubusercontent.com/u/4986717?v=4","gravatar_id":"","url":"https://api.github.com/users/Crphang","html_url":"https://github.com/Crphang","followers_url":"https://api.github.com/users/Crphang/followers","following_url":"https://api.github.com/users/Crphang/following{/other_user}","gists_url":"https://api.github.com/users/Crphang/gists{/gist_id}","starred_url":"https://api.github.com/users/Crphang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Crphang/subscriptions","organizations_url":"https://api.github.com/users/Crphang/orgs","repos_url":"https://api.github.com/users/Crphang/repos","events_url":"https://api.github.com/users/Crphang/events{/privacy}","received_events_url":"https://api.github.com/users/Crphang/received_events","type":"User","site_admin":false},"assignees":[{"login":"Crphang","id":4986717,"avatar_url":"https://avatars3.githubusercontent.com/u/4986717?v=4","gravatar_id":"","url":"https://api.github.com/users/Crphang","html_url":"https://github.com/Crphang","followers_url":"https://api.github.com/users/Crphang/followers","following_url":"https://api.github.com/users/Crphang/following{/other_user}","gists_url":"https://api.github.com/users/Crphang/gists{/gist_id}","starred_url":"https://api.github.com/users/Crphang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Crphang/subscriptions","organizations_url":"https://api.github.com/users/Crphang/orgs","repos_url":"https://api.github.com/users/Crphang/repos","events_url":"https://api.github.com/users/Crphang/events{/privacy}","received_events_url":"https://api.github.com/users/Crphang/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":539049889,"url":"https://api.github.com/repos/se-edu/learningresources/labels/s.ToReview","name":"s.ToReview","color":"0052cc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/se-edu/learningresources/pulls/33/commits","review_comments_url":"https://api.github.com/repos/se-edu/learningresources/pulls/33/comments","review_comment_url":"https://api.github.com/repos/se-edu/learningresources/pulls/comments{/number}","comments_url":"https://api.github.com/repos/se-edu/learningresources/issues/33/comments","statuses_url":"https://api.github.com/repos/se-edu/learningresources/statuses/b51b90aef556f51d7b55e1986e7f908491e519c4","head":{"label":"vivekscl:add-ways-to-scale","ref":"add-ways-to-scale","sha":"b51b90aef556f51d7b55e1986e7f908491e519c4","user":{"login":"vivekscl","id":17037188,"avatar_url":"https://avatars0.githubusercontent.com/u/17037188?v=4","gravatar_id":"","url":"https://api.github.com/users/vivekscl","html_url":"https://github.com/vivekscl","followers_url":"https://api.github.com/users/vivekscl/followers","following_url":"https://api.github.com/users/vivekscl/following{/other_user}","gists_url":"https://api.github.com/users/vivekscl/gists{/gist_id}","starred_url":"https://api.github.com/users/vivekscl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivekscl/subscriptions","organizations_url":"https://api.github.com/users/vivekscl/orgs","repos_url":"https://api.github.com/users/vivekscl/repos","events_url":"https://api.github.com/users/vivekscl/events{/privacy}","received_events_url":"https://api.github.com/users/vivekscl/received_events","type":"User","site_admin":false},"repo":{"id":122286683,"name":"learningresources","full_name":"vivekscl/learningresources","owner":{"login":"vivekscl","id":17037188,"avatar_url":"https://avatars0.githubusercontent.com/u/17037188?v=4","gravatar_id":"","url":"https://api.github.com/users/vivekscl","html_url":"https://github.com/vivekscl","followers_url":"https://api.github.com/users/vivekscl/followers","following_url":"https://api.github.com/users/vivekscl/following{/other_user}","gists_url":"https://api.github.com/users/vivekscl/gists{/gist_id}","starred_url":"https://api.github.com/users/vivekscl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivekscl/subscriptions","organizations_url":"https://api.github.com/users/vivekscl/orgs","repos_url":"https://api.github.com/users/vivekscl/repos","events_url":"https://api.github.com/users/vivekscl/events{/privacy}","received_events_url":"https://api.github.com/users/vivekscl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vivekscl/learningresources","description":"A collection of learning resources for Software Engineering students","fork":true,"url":"https://api.github.com/repos/vivekscl/learningresources","forks_url":"https://api.github.com/repos/vivekscl/learningresources/forks","keys_url":"https://api.github.com/repos/vivekscl/learningresources/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vivekscl/learningresources/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vivekscl/learningresources/teams","hooks_url":"https://api.github.com/repos/vivekscl/learningresources/hooks","issue_events_url":"https://api.github.com/repos/vivekscl/learningresources/issues/events{/number}","events_url":"https://api.github.com/repos/vivekscl/learningresources/events","assignees_url":"https://api.github.com/repos/vivekscl/learningresources/assignees{/user}","branches_url":"https://api.github.com/repos/vivekscl/learningresources/branches{/branch}","tags_url":"https://api.github.com/repos/vivekscl/learningresources/tags","blobs_url":"https://api.github.com/repos/vivekscl/learningresources/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vivekscl/learningresources/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vivekscl/learningresources/git/refs{/sha}","trees_url":"https://api.github.com/repos/vivekscl/learningresources/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vivekscl/learningresources/statuses/{sha}","languages_url":"https://api.github.com/repos/vivekscl/learningresources/languages","stargazers_url":"https://api.github.com/repos/vivekscl/learningresources/stargazers","contributors_url":"https://api.github.com/repos/vivekscl/learningresources/contributors","subscribers_url":"https://api.github.com/repos/vivekscl/learningresources/subscribers","subscription_url":"https://api.github.com/repos/vivekscl/learningresources/subscription","commits_url":"https://api.github.com/repos/vivekscl/learningresources/commits{/sha}","git_commits_url":"https://api.github.com/repos/vivekscl/learningresources/git/commits{/sha}","comments_url":"https://api.github.com/repos/vivekscl/learningresources/comments{/number}","issue_comment_url":"https://api.github.com/repos/vivekscl/learningresources/issues/comments{/number}","contents_url":"https://api.github.com/repos/vivekscl/learningresources/contents/{+path}","compare_url":"https://api.github.com/repos/vivekscl/learningresources/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vivekscl/learningresources/merges","archive_url":"https://api.github.com/repos/vivekscl/learningresources/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vivekscl/learningresources/downloads","issues_url":"https://api.github.com/repos/vivekscl/learningresources/issues{/number}","pulls_url":"https://api.github.com/repos/vivekscl/learningresources/pulls{/number}","milestones_url":"https://api.github.com/repos/vivekscl/learningresources/milestones{/number}","notifications_url":"https://api.github.com/repos/vivekscl/learningresources/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vivekscl/learningresources/labels{/name}","releases_url":"https://api.github.com/repos/vivekscl/learningresources/releases{/id}","deployments_url":"https://api.github.com/repos/vivekscl/learningresources/deployments","created_at":"2018-02-21T03:11:39Z","updated_at":"2017-05-25T06:49:06Z","pushed_at":"2018-03-07T04:25:05Z","git_url":"git://github.com/vivekscl/learningresources.git","ssh_url":"git@github.com:vivekscl/learningresources.git","clone_url":"https://github.com/vivekscl/learningresources.git","svn_url":"https://github.com/vivekscl/learningresources","homepage":null,"size":181,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"se-edu:master","ref":"master","sha":"aca5a2c547f2932cd49b2d50ad468beb65e0cb9a","user":{"login":"se-edu","id":20763652,"avatar_url":"https://avatars2.githubusercontent.com/u/20763652?v=4","gravatar_id":"","url":"https://api.github.com/users/se-edu","html_url":"https://github.com/se-edu","followers_url":"https://api.github.com/users/se-edu/followers","following_url":"https://api.github.com/users/se-edu/following{/other_user}","gists_url":"https://api.github.com/users/se-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/se-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/se-edu/subscriptions","organizations_url":"https://api.github.com/users/se-edu/orgs","repos_url":"https://api.github.com/users/se-edu/repos","events_url":"https://api.github.com/users/se-edu/events{/privacy}","received_events_url":"https://api.github.com/users/se-edu/received_events","type":"Organization","site_admin":false},"repo":{"id":80505681,"name":"learningresources","full_name":"se-edu/learningresources","owner":{"login":"se-edu","id":20763652,"avatar_url":"https://avatars2.githubusercontent.com/u/20763652?v=4","gravatar_id":"","url":"https://api.github.com/users/se-edu","html_url":"https://github.com/se-edu","followers_url":"https://api.github.com/users/se-edu/followers","following_url":"https://api.github.com/users/se-edu/following{/other_user}","gists_url":"https://api.github.com/users/se-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/se-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/se-edu/subscriptions","organizations_url":"https://api.github.com/users/se-edu/orgs","repos_url":"https://api.github.com/users/se-edu/repos","events_url":"https://api.github.com/users/se-edu/events{/privacy}","received_events_url":"https://api.github.com/users/se-edu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/se-edu/learningresources","description":"A collection of learning resources for Software Engineering students","fork":false,"url":"https://api.github.com/repos/se-edu/learningresources","forks_url":"https://api.github.com/repos/se-edu/learningresources/forks","keys_url":"https://api.github.com/repos/se-edu/learningresources/keys{/key_id}","collaborators_url":"https://api.github.com/repos/se-edu/learningresources/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/se-edu/learningresources/teams","hooks_url":"https://api.github.com/repos/se-edu/learningresources/hooks","issue_events_url":"https://api.github.com/repos/se-edu/learningresources/issues/events{/number}","events_url":"https://api.github.com/repos/se-edu/learningresources/events","assignees_url":"https://api.github.com/repos/se-edu/learningresources/assignees{/user}","branches_url":"https://api.github.com/repos/se-edu/learningresources/branches{/branch}","tags_url":"https://api.github.com/repos/se-edu/learningresources/tags","blobs_url":"https://api.github.com/repos/se-edu/learningresources/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/se-edu/learningresources/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/se-edu/learningresources/git/refs{/sha}","trees_url":"https://api.github.com/repos/se-edu/learningresources/git/trees{/sha}","statuses_url":"https://api.github.com/repos/se-edu/learningresources/statuses/{sha}","languages_url":"https://api.github.com/repos/se-edu/learningresources/languages","stargazers_url":"https://api.github.com/repos/se-edu/learningresources/stargazers","contributors_url":"https://api.github.com/repos/se-edu/learningresources/contributors","subscribers_url":"https://api.github.com/repos/se-edu/learningresources/subscribers","subscription_url":"https://api.github.com/repos/se-edu/learningresources/subscription","commits_url":"https://api.github.com/repos/se-edu/learningresources/commits{/sha}","git_commits_url":"https://api.github.com/repos/se-edu/learningresources/git/commits{/sha}","comments_url":"https://api.github.com/repos/se-edu/learningresources/comments{/number}","issue_comment_url":"https://api.github.com/repos/se-edu/learningresources/issues/comments{/number}","contents_url":"https://api.github.com/repos/se-edu/learningresources/contents/{+path}","compare_url":"https://api.github.com/repos/se-edu/learningresources/compare/{base}...{head}","merges_url":"https://api.github.com/repos/se-edu/learningresources/merges","archive_url":"https://api.github.com/repos/se-edu/learningresources/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/se-edu/learningresources/downloads","issues_url":"https://api.github.com/repos/se-edu/learningresources/issues{/number}","pulls_url":"https://api.github.com/repos/se-edu/learningresources/pulls{/number}","milestones_url":"https://api.github.com/repos/se-edu/learningresources/milestones{/number}","notifications_url":"https://api.github.com/repos/se-edu/learningresources/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/se-edu/learningresources/labels{/name}","releases_url":"https://api.github.com/repos/se-edu/learningresources/releases{/id}","deployments_url":"https://api.github.com/repos/se-edu/learningresources/deployments","created_at":"2017-01-31T09:10:16Z","updated_at":"2018-03-14T14:12:25Z","pushed_at":"2018-03-15T02:43:43Z","git_url":"git://github.com/se-edu/learningresources.git","ssh_url":"git@github.com:se-edu/learningresources.git","clone_url":"https://github.com/se-edu/learningresources.git","svn_url":"https://github.com/se-edu/learningresources","homepage":null,"size":1133,"stargazers_count":11,"watchers_count":11,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":42,"mirror_url":null,"archived":false,"open_issues_count":15,"license":null,"forks":42,"open_issues":15,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/se-edu/learningresources/pulls/33"},"html":{"href":"https://github.com/se-edu/learningresources/pull/33"},"issue":{"href":"https://api.github.com/repos/se-edu/learningresources/issues/33"},"comments":{"href":"https://api.github.com/repos/se-edu/learningresources/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/se-edu/learningresources/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/se-edu/learningresources/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/se-edu/learningresources/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/se-edu/learningresources/statuses/b51b90aef556f51d7b55e1986e7f908491e519c4"}},"author_association":"NONE"}}
{"actor":{"display_login":"vivekscl"}}