From 4ed84da16ec5f463a4938e9f708e5be2c0b37fba Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Wed, 5 Feb 2020 14:21:35 +0700 Subject: [PATCH 01/32] Add Indonesian README --- README-id.md | 1834 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1834 insertions(+) create mode 100644 README-id.md diff --git a/README-id.md b/README-id.md new file mode 100644 index 00000000..450adc1f --- /dev/null +++ b/README-id.md @@ -0,0 +1,1834 @@ +*[English](README.md) ∙ [Indonesian](README-id.md) ∙ [日本語](README-ja.md) ∙ [简体中文](README-zh-Hans.md) ∙ [繁體中文](README-zh-TW.md) | [العَرَبِيَّة‎](https://github.com/donnemartin/system-design-primer/issues/170) ∙ [বাংলা](https://github.com/donnemartin/system-design-primer/issues/220) ∙ [Português do Brasil](https://github.com/donnemartin/system-design-primer/issues/40) ∙ [Deutsch](https://github.com/donnemartin/system-design-primer/issues/186) ∙ [ελληνικά](https://github.com/donnemartin/system-design-primer/issues/130) ∙ [עברית](https://github.com/donnemartin/system-design-primer/issues/272) ∙ [Italiano](https://github.com/donnemartin/system-design-primer/issues/104) ∙ [韓國語](https://github.com/donnemartin/system-design-primer/issues/102) ∙ [فارسی](https://github.com/donnemartin/system-design-primer/issues/110) ∙ [Polski](https://github.com/donnemartin/system-design-primer/issues/68) ∙ [русский язык](https://github.com/donnemartin/system-design-primer/issues/87) ∙ [Español](https://github.com/donnemartin/system-design-primer/issues/136) ∙ [ภาษาไทย](https://github.com/donnemartin/system-design-primer/issues/187) ∙ [Türkçe](https://github.com/donnemartin/system-design-primer/issues/39) ∙ [tiếng Việt](https://github.com/donnemartin/system-design-primer/issues/127) ∙ [Français](https://github.com/donnemartin/system-design-primer/issues/250) | [Add Translation](https://github.com/donnemartin/system-design-primer/issues/28)* + +# Dasar Rancangan Sistem + +

+ +
+

+ +## Motivasi + +> Belajar bagaimana merancang sistem skala besar. +> +> Persiapan wawancara rancangan sistem. + +### Learn how to design large-scale systems + +Learning how to design scalable systems will help you become a better engineer. + +System design is a broad topic. There is a **vast amount of resources scattered throughout the web** on system design principles. + +This repo is an **organized collection** of resources to help you learn how to build systems at scale. + +### Learn from the open source community + +This is a continually updated, open source project. + +[Contributions](#contributing) are welcome! + +### Prep for the system design interview + +In addition to coding interviews, system design is a **required component** of the **technical interview process** at many tech companies. + +**Practice common system design interview questions** and **compare** your results with **sample solutions**: discussions, code, and diagrams. + +Additional topics for interview prep: + +* [Study guide](#study-guide) +* [How to approach a system design interview question](#how-to-approach-a-system-design-interview-question) +* [System design interview questions, **with solutions**](#system-design-interview-questions-with-solutions) +* [Object-oriented design interview questions, **with solutions**](#object-oriented-design-interview-questions-with-solutions) +* [Additional system design interview questions](#additional-system-design-interview-questions) + +## Anki flashcards + +

+ +
+

+ +The provided [Anki flashcard decks](https://apps.ankiweb.net/) use spaced repetition to help you retain key system design concepts. + +* [System design deck](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/System%20Design.apkg) +* [System design exercises deck](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/System%20Design%20Exercises.apkg) +* [Object oriented design exercises deck](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/OO%20Design.apkg) + +Great for use while on-the-go. + +### Coding Resource: Interactive Coding Challenges + +Looking for resources to help you prep for the [**Coding Interview**](https://github.com/donnemartin/interactive-coding-challenges)? + +

+ +
+

+ +Check out the sister repo [**Interactive Coding Challenges**](https://github.com/donnemartin/interactive-coding-challenges), which contains an additional Anki deck: + +* [Coding deck](https://github.com/donnemartin/interactive-coding-challenges/tree/master/anki_cards/Coding.apkg) + +## Contributing + +> Learn from the community. + +Feel free to submit pull requests to help: + +* Fix errors +* Improve sections +* Add new sections +* [Translate](https://github.com/donnemartin/system-design-primer/issues/28) + +Content that needs some polishing is placed [under development](#under-development). + +Review the [Contributing Guidelines](CONTRIBUTING.md). + +## Index of system design topics + +> Summaries of various system design topics, including pros and cons. **Everything is a trade-off**. +> +> Each section contains links to more in-depth resources. + +

+ +
+

+ +* [System design topics: start here](#system-design-topics-start-here) + * [Step 1: Review the scalability video lecture](#step-1-review-the-scalability-video-lecture) + * [Step 2: Review the scalability article](#step-2-review-the-scalability-article) + * [Next steps](#next-steps) +* [Performance vs scalability](#performance-vs-scalability) +* [Latency vs throughput](#latency-vs-throughput) +* [Availability vs consistency](#availability-vs-consistency) + * [CAP theorem](#cap-theorem) + * [CP - consistency and partition tolerance](#cp---consistency-and-partition-tolerance) + * [AP - availability and partition tolerance](#ap---availability-and-partition-tolerance) +* [Consistency patterns](#consistency-patterns) + * [Weak consistency](#weak-consistency) + * [Eventual consistency](#eventual-consistency) + * [Strong consistency](#strong-consistency) +* [Availability patterns](#availability-patterns) + * [Fail-over](#fail-over) + * [Replication](#replication) + * [Availability in numbers](#availability-in-numbers) +* [Domain name system](#domain-name-system) +* [Content delivery network](#content-delivery-network) + * [Push CDNs](#push-cdns) + * [Pull CDNs](#pull-cdns) +* [Load balancer](#load-balancer) + * [Active-passive](#active-passive) + * [Active-active](#active-active) + * [Layer 4 load balancing](#layer-4-load-balancing) + * [Layer 7 load balancing](#layer-7-load-balancing) + * [Horizontal scaling](#horizontal-scaling) +* [Reverse proxy (web server)](#reverse-proxy-web-server) + * [Load balancer vs reverse proxy](#load-balancer-vs-reverse-proxy) +* [Application layer](#application-layer) + * [Microservices](#microservices) + * [Service discovery](#service-discovery) +* [Database](#database) + * [Relational database management system (RDBMS)](#relational-database-management-system-rdbms) + * [Master-slave replication](#master-slave-replication) + * [Master-master replication](#master-master-replication) + * [Federation](#federation) + * [Sharding](#sharding) + * [Denormalization](#denormalization) + * [SQL tuning](#sql-tuning) + * [NoSQL](#nosql) + * [Key-value store](#key-value-store) + * [Document store](#document-store) + * [Wide column store](#wide-column-store) + * [Graph Database](#graph-database) + * [SQL or NoSQL](#sql-or-nosql) +* [Cache](#cache) + * [Client caching](#client-caching) + * [CDN caching](#cdn-caching) + * [Web server caching](#web-server-caching) + * [Database caching](#database-caching) + * [Application caching](#application-caching) + * [Caching at the database query level](#caching-at-the-database-query-level) + * [Caching at the object level](#caching-at-the-object-level) + * [When to update the cache](#when-to-update-the-cache) + * [Cache-aside](#cache-aside) + * [Write-through](#write-through) + * [Write-behind (write-back)](#write-behind-write-back) + * [Refresh-ahead](#refresh-ahead) +* [Asynchronism](#asynchronism) + * [Message queues](#message-queues) + * [Task queues](#task-queues) + * [Back pressure](#back-pressure) +* [Communication](#communication) + * [Transmission control protocol (TCP)](#transmission-control-protocol-tcp) + * [User datagram protocol (UDP)](#user-datagram-protocol-udp) + * [Remote procedure call (RPC)](#remote-procedure-call-rpc) + * [Representational state transfer (REST)](#representational-state-transfer-rest) +* [Security](#security) +* [Appendix](#appendix) + * [Powers of two table](#powers-of-two-table) + * [Latency numbers every programmer should know](#latency-numbers-every-programmer-should-know) + * [Additional system design interview questions](#additional-system-design-interview-questions) + * [Real world architectures](#real-world-architectures) + * [Company architectures](#company-architectures) + * [Company engineering blogs](#company-engineering-blogs) +* [Under development](#under-development) +* [Credits](#credits) +* [Contact info](#contact-info) +* [License](#license) + +## Study guide + +> Suggested topics to review based on your interview timeline (short, medium, long). + +![Imgur](http://i.imgur.com/OfVllex.png) + +**Q: For interviews, do I need to know everything here?** + +**A: No, you don't need to know everything here to prepare for the interview**. + +What you are asked in an interview depends on variables such as: + +* How much experience you have +* What your technical background is +* What positions you are interviewing for +* Which companies you are interviewing with +* Luck + +More experienced candidates are generally expected to know more about system design. Architects or team leads might be expected to know more than individual contributors. Top tech companies are likely to have one or more design interview rounds. + +Start broad and go deeper in a few areas. It helps to know a little about various key system design topics. Adjust the following guide based on your timeline, experience, what positions you are interviewing for, and which companies you are interviewing with. + +* **Short timeline** - Aim for **breadth** with system design topics. Practice by solving **some** interview questions. +* **Medium timeline** - Aim for **breadth** and **some depth** with system design topics. Practice by solving **many** interview questions. +* **Long timeline** - Aim for **breadth** and **more depth** with system design topics. Practice by solving **most** interview questions. + +| | Short | Medium | Long | +|---|---|---|---| +| Read through the [System design topics](#index-of-system-design-topics) to get a broad understanding of how systems work | :+1: | :+1: | :+1: | +| Read through a few articles in the [Company engineering blogs](#company-engineering-blogs) for the companies you are interviewing with | :+1: | :+1: | :+1: | +| Read through a few [Real world architectures](#real-world-architectures) | :+1: | :+1: | :+1: | +| Review [How to approach a system design interview question](#how-to-approach-a-system-design-interview-question) | :+1: | :+1: | :+1: | +| Work through [System design interview questions with solutions](#system-design-interview-questions-with-solutions) | Some | Many | Most | +| Work through [Object-oriented design interview questions with solutions](#object-oriented-design-interview-questions-with-solutions) | Some | Many | Most | +| Review [Additional system design interview questions](#additional-system-design-interview-questions) | Some | Many | Most | + +## How to approach a system design interview question + +> How to tackle a system design interview question. + +The system design interview is an **open-ended conversation**. You are expected to lead it. + +You can use the following steps to guide the discussion. To help solidify this process, work through the [System design interview questions with solutions](#system-design-interview-questions-with-solutions) section using the following steps. + +### Step 1: Outline use cases, constraints, and assumptions + +Gather requirements and scope the problem. Ask questions to clarify use cases and constraints. Discuss assumptions. + +* Who is going to use it? +* How are they going to use it? +* How many users are there? +* What does the system do? +* What are the inputs and outputs of the system? +* How much data do we expect to handle? +* How many requests per second do we expect? +* What is the expected read to write ratio? + +### Step 2: Create a high level design + +Outline a high level design with all important components. + +* Sketch the main components and connections +* Justify your ideas + +### Step 3: Design core components + +Dive into details for each core component. For example, if you were asked to [design a url shortening service](solutions/system_design/pastebin/README.md), discuss: + +* Generating and storing a hash of the full url + * [MD5](solutions/system_design/pastebin/README.md) and [Base62](solutions/system_design/pastebin/README.md) + * Hash collisions + * SQL or NoSQL + * Database schema +* Translating a hashed url to the full url + * Database lookup +* API and object-oriented design + +### Step 4: Scale the design + +Identify and address bottlenecks, given the constraints. For example, do you need the following to address scalability issues? + +* Load balancer +* Horizontal scaling +* Caching +* Database sharding + +Discuss potential solutions and trade-offs. Everything is a trade-off. Address bottlenecks using [principles of scalable system design](#index-of-system-design-topics). + +### Back-of-the-envelope calculations + +You might be asked to do some estimates by hand. Refer to the [Appendix](#appendix) for the following resources: + +* [Use back of the envelope calculations](http://highscalability.com/blog/2011/1/26/google-pro-tip-use-back-of-the-envelope-calculations-to-choo.html) +* [Powers of two table](#powers-of-two-table) +* [Latency numbers every programmer should know](#latency-numbers-every-programmer-should-know) + +### Source(s) and further reading + +Check out the following links to get a better idea of what to expect: + +* [How to ace a systems design interview](https://www.palantir.com/2011/10/how-to-rock-a-systems-design-interview/) +* [The system design interview](http://www.hiredintech.com/system-design) +* [Intro to Architecture and Systems Design Interviews](https://www.youtube.com/watch?v=ZgdS0EUmn70) + +## System design interview questions with solutions + +> Common system design interview questions with sample discussions, code, and diagrams. +> +> Solutions linked to content in the `solutions/` folder. + +| Question | | +|---|---| +| Design Pastebin.com (or Bit.ly) | [Solution](solutions/system_design/pastebin/README.md) | +| Design the Twitter timeline and search (or Facebook feed and search) | [Solution](solutions/system_design/twitter/README.md) | +| Design a web crawler | [Solution](solutions/system_design/web_crawler/README.md) | +| Design Mint.com | [Solution](solutions/system_design/mint/README.md) | +| Design the data structures for a social network | [Solution](solutions/system_design/social_graph/README.md) | +| Design a key-value store for a search engine | [Solution](solutions/system_design/query_cache/README.md) | +| Design Amazon's sales ranking by category feature | [Solution](solutions/system_design/sales_rank/README.md) | +| Design a system that scales to millions of users on AWS | [Solution](solutions/system_design/scaling_aws/README.md) | +| Add a system design question | [Contribute](#contributing) | + +### Design Pastebin.com (or Bit.ly) + +[View exercise and solution](solutions/system_design/pastebin/README.md) + +![Imgur](http://i.imgur.com/4edXG0T.png) + +### Design the Twitter timeline and search (or Facebook feed and search) + +[View exercise and solution](solutions/system_design/twitter/README.md) + +![Imgur](http://i.imgur.com/jrUBAF7.png) + +### Design a web crawler + +[View exercise and solution](solutions/system_design/web_crawler/README.md) + +![Imgur](http://i.imgur.com/bWxPtQA.png) + +### Design Mint.com + +[View exercise and solution](solutions/system_design/mint/README.md) + +![Imgur](http://i.imgur.com/V5q57vU.png) + +### Design the data structures for a social network + +[View exercise and solution](solutions/system_design/social_graph/README.md) + +![Imgur](http://i.imgur.com/cdCv5g7.png) + +### Design a key-value store for a search engine + +[View exercise and solution](solutions/system_design/query_cache/README.md) + +![Imgur](http://i.imgur.com/4j99mhe.png) + +### Design Amazon's sales ranking by category feature + +[View exercise and solution](solutions/system_design/sales_rank/README.md) + +![Imgur](http://i.imgur.com/MzExP06.png) + +### Design a system that scales to millions of users on AWS + +[View exercise and solution](solutions/system_design/scaling_aws/README.md) + +![Imgur](http://i.imgur.com/jj3A5N8.png) + +## Object-oriented design interview questions with solutions + +> Common object-oriented design interview questions with sample discussions, code, and diagrams. +> +> Solutions linked to content in the `solutions/` folder. + +>**Note: This section is under development** + +| Question | | +|---|---| +| Design a hash map | [Solution](solutions/object_oriented_design/hash_table/hash_map.ipynb) | +| Design a least recently used cache | [Solution](solutions/object_oriented_design/lru_cache/lru_cache.ipynb) | +| Design a call center | [Solution](solutions/object_oriented_design/call_center/call_center.ipynb) | +| Design a deck of cards | [Solution](solutions/object_oriented_design/deck_of_cards/deck_of_cards.ipynb) | +| Design a parking lot | [Solution](solutions/object_oriented_design/parking_lot/parking_lot.ipynb) | +| Design a chat server | [Solution](solutions/object_oriented_design/online_chat/online_chat.ipynb) | +| Design a circular array | [Contribute](#contributing) | +| Add an object-oriented design question | [Contribute](#contributing) | + +## System design topics: start here + +New to system design? + +First, you'll need a basic understanding of common principles, learning about what they are, how they are used, and their pros and cons. + +### Step 1: Review the scalability video lecture + +[Scalability Lecture at Harvard](https://www.youtube.com/watch?v=-W9F__D3oY4) + +* Topics covered: + * Vertical scaling + * Horizontal scaling + * Caching + * Load balancing + * Database replication + * Database partitioning + +### Step 2: Review the scalability article + +[Scalability](http://www.lecloud.net/tagged/scalability/chrono) + +* Topics covered: + * [Clones](http://www.lecloud.net/post/7295452622/scalability-for-dummies-part-1-clones) + * [Databases](http://www.lecloud.net/post/7994751381/scalability-for-dummies-part-2-database) + * [Caches](http://www.lecloud.net/post/9246290032/scalability-for-dummies-part-3-cache) + * [Asynchronism](http://www.lecloud.net/post/9699762917/scalability-for-dummies-part-4-asynchronism) + +### Next steps + +Next, we'll look at high-level trade-offs: + +* **Performance** vs **scalability** +* **Latency** vs **throughput** +* **Availability** vs **consistency** + +Keep in mind that **everything is a trade-off**. + +Then we'll dive into more specific topics such as DNS, CDNs, and load balancers. + +## Performance vs scalability + +A service is **scalable** if it results in increased **performance** in a manner proportional to resources added. Generally, increasing performance means serving more units of work, but it can also be to handle larger units of work, such as when datasets grow.1 + +Another way to look at performance vs scalability: + +* If you have a **performance** problem, your system is slow for a single user. +* If you have a **scalability** problem, your system is fast for a single user but slow under heavy load. + +### Source(s) and further reading + +* [A word on scalability](http://www.allthingsdistributed.com/2006/03/a_word_on_scalability.html) +* [Scalability, availability, stability, patterns](http://www.slideshare.net/jboner/scalability-availability-stability-patterns/) + +## Latency vs throughput + +**Latency** is the time to perform some action or to produce some result. + +**Throughput** is the number of such actions or results per unit of time. + +Generally, you should aim for **maximal throughput** with **acceptable latency**. + +### Source(s) and further reading + +* [Understanding latency vs throughput](https://community.cadence.com/cadence_blogs_8/b/sd/archive/2010/09/13/understanding-latency-vs-throughput) + +## Availability vs consistency + +### CAP theorem + +

+ +
+ Source: CAP theorem revisited +

+ +In a distributed computer system, you can only support two of the following guarantees: + +* **Consistency** - Every read receives the most recent write or an error +* **Availability** - Every request receives a response, without guarantee that it contains the most recent version of the information +* **Partition Tolerance** - The system continues to operate despite arbitrary partitioning due to network failures + +*Networks aren't reliable, so you'll need to support partition tolerance. You'll need to make a software tradeoff between consistency and availability.* + +#### CP - consistency and partition tolerance + +Waiting for a response from the partitioned node might result in a timeout error. CP is a good choice if your business needs require atomic reads and writes. + +#### AP - availability and partition tolerance + +Responses return the most recent version of the data available on a node, which might not be the latest. Writes might take some time to propagate when the partition is resolved. + +AP is a good choice if the business needs allow for [eventual consistency](#eventual-consistency) or when the system needs to continue working despite external errors. + +### Source(s) and further reading + +* [CAP theorem revisited](http://robertgreiner.com/2014/08/cap-theorem-revisited/) +* [A plain english introduction to CAP theorem](http://ksat.me/a-plain-english-introduction-to-cap-theorem) +* [CAP FAQ](https://github.com/henryr/cap-faq) + +## Consistency patterns + +With multiple copies of the same data, we are faced with options on how to synchronize them so clients have a consistent view of the data. Recall the definition of consistency from the [CAP theorem](#cap-theorem) - Every read receives the most recent write or an error. + +### Weak consistency + +After a write, reads may or may not see it. A best effort approach is taken. + +This approach is seen in systems such as memcached. Weak consistency works well in real time use cases such as VoIP, video chat, and realtime multiplayer games. For example, if you are on a phone call and lose reception for a few seconds, when you regain connection you do not hear what was spoken during connection loss. + +### Eventual consistency + +After a write, reads will eventually see it (typically within milliseconds). Data is replicated asynchronously. + +This approach is seen in systems such as DNS and email. Eventual consistency works well in highly available systems. + +### Strong consistency + +After a write, reads will see it. Data is replicated synchronously. + +This approach is seen in file systems and RDBMSes. Strong consistency works well in systems that need transactions. + +### Source(s) and further reading + +* [Transactions across data centers](http://snarfed.org/transactions_across_datacenters_io.html) + +## Availability patterns + +There are two main patterns to support high availability: **fail-over** and **replication**. + +### Fail-over + +#### Active-passive + +With active-passive fail-over, heartbeats are sent between the active and the passive server on standby. If the heartbeat is interrupted, the passive server takes over the active's IP address and resumes service. + +The length of downtime is determined by whether the passive server is already running in 'hot' standby or whether it needs to start up from 'cold' standby. Only the active server handles traffic. + +Active-passive failover can also be referred to as master-slave failover. + +#### Active-active + +In active-active, both servers are managing traffic, spreading the load between them. + +If the servers are public-facing, the DNS would need to know about the public IPs of both servers. If the servers are internal-facing, application logic would need to know about both servers. + +Active-active failover can also be referred to as master-master failover. + +### Disadvantage(s): failover + +* Fail-over adds more hardware and additional complexity. +* There is a potential for loss of data if the active system fails before any newly written data can be replicated to the passive. + +### Replication + +#### Master-slave and master-master + +This topic is further discussed in the [Database](#database) section: + +* [Master-slave replication](#master-slave-replication) +* [Master-master replication](#master-master-replication) + +### Availability in numbers + +Availability is often quantified by uptime (or downtime) as a percentage of time the service is available. Availability is generally measured in number of 9s--a service with 99.99% availability is described as having four 9s. + +#### 99.9% availability - three 9s + +| Duration | Acceptable downtime| +|---------------------|--------------------| +| Downtime per year | 8h 45min 57s | +| Downtime per month | 43m 49.7s | +| Downtime per week | 10m 4.8s | +| Downtime per day | 1m 26.4s | + +#### 99.99% availability - four 9s + +| Duration | Acceptable downtime| +|---------------------|--------------------| +| Downtime per year | 52min 35.7s | +| Downtime per month | 4m 23s | +| Downtime per week | 1m 5s | +| Downtime per day | 8.6s | + +#### Availability in parallel vs in sequence + +If a service consists of multiple components prone to failure, the service's overall availability depends on whether the components are in sequence or in parallel. + +###### In sequence + +Overall availability decreases when two components with availability < 100% are in sequence: + +``` +Availability (Total) = Availability (Foo) * Availability (Bar) +``` + +If both `Foo` and `Bar` each had 99.9% availability, their total availability in sequence would be 99.8%. + +###### In parallel + +Overall availability increases when two components with availability < 100% are in parallel: + +``` +Availability (Total) = 1 - (1 - Availability (Foo)) * (1 - Availability (Bar)) +``` + +If both `Foo` and `Bar` each had 99.9% availability, their total availability in parallel would be 99.9999%. + +## Domain name system + +

+ +
+ Source: DNS security presentation +

+ +A Domain Name System (DNS) translates a domain name such as www.example.com to an IP address. + +DNS is hierarchical, with a few authoritative servers at the top level. Your router or ISP provides information about which DNS server(s) to contact when doing a lookup. Lower level DNS servers cache mappings, which could become stale due to DNS propagation delays. DNS results can also be cached by your browser or OS for a certain period of time, determined by the [time to live (TTL)](https://en.wikipedia.org/wiki/Time_to_live). + +* **NS record (name server)** - Specifies the DNS servers for your domain/subdomain. +* **MX record (mail exchange)** - Specifies the mail servers for accepting messages. +* **A record (address)** - Points a name to an IP address. +* **CNAME (canonical)** - Points a name to another name or `CNAME` (example.com to www.example.com) or to an `A` record. + +Services such as [CloudFlare](https://www.cloudflare.com/dns/) and [Route 53](https://aws.amazon.com/route53/) provide managed DNS services. Some DNS services can route traffic through various methods: + +* [Weighted round robin](https://www.g33kinfo.com/info/round-robin-vs-weighted-round-robin-lb) + * Prevent traffic from going to servers under maintenance + * Balance between varying cluster sizes + * A/B testing +* Latency-based +* Geolocation-based + +### Disadvantage(s): DNS + +* Accessing a DNS server introduces a slight delay, although mitigated by caching described above. +* DNS server management could be complex and is generally managed by [governments, ISPs, and large companies](http://superuser.com/questions/472695/who-controls-the-dns-servers/472729). +* DNS services have recently come under [DDoS attack](http://dyn.com/blog/dyn-analysis-summary-of-friday-october-21-attack/), preventing users from accessing websites such as Twitter without knowing Twitter's IP address(es). + +### Source(s) and further reading + +* [DNS architecture](https://technet.microsoft.com/en-us/library/dd197427(v=ws.10).aspx) +* [Wikipedia](https://en.wikipedia.org/wiki/Domain_Name_System) +* [DNS articles](https://support.dnsimple.com/categories/dns/) + +## Content delivery network + +

+ +
+ Source: Why use a CDN +

+ +A content delivery network (CDN) is a globally distributed network of proxy servers, serving content from locations closer to the user. Generally, static files such as HTML/CSS/JS, photos, and videos are served from CDN, although some CDNs such as Amazon's CloudFront support dynamic content. The site's DNS resolution will tell clients which server to contact. + +Serving content from CDNs can significantly improve performance in two ways: + +* Users receive content at data centers close to them +* Your servers do not have to serve requests that the CDN fulfills + +### Push CDNs + +Push CDNs receive new content whenever changes occur on your server. You take full responsibility for providing content, uploading directly to the CDN and rewriting URLs to point to the CDN. You can configure when content expires and when it is updated. Content is uploaded only when it is new or changed, minimizing traffic, but maximizing storage. + +Sites with a small amount of traffic or sites with content that isn't often updated work well with push CDNs. Content is placed on the CDNs once, instead of being re-pulled at regular intervals. + +### Pull CDNs + +Pull CDNs grab new content from your server when the first user requests the content. You leave the content on your server and rewrite URLs to point to the CDN. This results in a slower request until the content is cached on the CDN. + +A [time-to-live (TTL)](https://en.wikipedia.org/wiki/Time_to_live) determines how long content is cached. Pull CDNs minimize storage space on the CDN, but can create redundant traffic if files expire and are pulled before they have actually changed. + +Sites with heavy traffic work well with pull CDNs, as traffic is spread out more evenly with only recently-requested content remaining on the CDN. + +### Disadvantage(s): CDN + +* CDN costs could be significant depending on traffic, although this should be weighed with additional costs you would incur not using a CDN. +* Content might be stale if it is updated before the TTL expires it. +* CDNs require changing URLs for static content to point to the CDN. + +### Source(s) and further reading + +* [Globally distributed content delivery](https://figshare.com/articles/Globally_distributed_content_delivery/6605972) +* [The differences between push and pull CDNs](http://www.travelblogadvice.com/technical/the-differences-between-push-and-pull-cdns/) +* [Wikipedia](https://en.wikipedia.org/wiki/Content_delivery_network) + +## Load balancer + +

+ +
+ Source: Scalable system design patterns +

+ +Load balancers distribute incoming client requests to computing resources such as application servers and databases. In each case, the load balancer returns the response from the computing resource to the appropriate client. Load balancers are effective at: + +* Preventing requests from going to unhealthy servers +* Preventing overloading resources +* Helping eliminate single points of failure + +Load balancers can be implemented with hardware (expensive) or with software such as HAProxy. + +Additional benefits include: + +* **SSL termination** - Decrypt incoming requests and encrypt server responses so backend servers do not have to perform these potentially expensive operations + * Removes the need to install [X.509 certificates](https://en.wikipedia.org/wiki/X.509) on each server +* **Session persistence** - Issue cookies and route a specific client's requests to same instance if the web apps do not keep track of sessions + +To protect against failures, it's common to set up multiple load balancers, either in [active-passive](#active-passive) or [active-active](#active-active) mode. + +Load balancers can route traffic based on various metrics, including: + +* Random +* Least loaded +* Session/cookies +* [Round robin or weighted round robin](https://www.g33kinfo.com/info/round-robin-vs-weighted-round-robin-lb) +* [Layer 4](#layer-4-load-balancing) +* [Layer 7](#layer-7-load-balancing) + +### Layer 4 load balancing + +Layer 4 load balancers look at info at the [transport layer](#communication) to decide how to distribute requests. Generally, this involves the source, destination IP addresses, and ports in the header, but not the contents of the packet. Layer 4 load balancers forward network packets to and from the upstream server, performing [Network Address Translation (NAT)](https://www.nginx.com/resources/glossary/layer-4-load-balancing/). + +### Layer 7 load balancing + +Layer 7 load balancers look at the [application layer](#communication) to decide how to distribute requests. This can involve contents of the header, message, and cookies. Layer 7 load balancers terminates network traffic, reads the message, makes a load-balancing decision, then opens a connection to the selected server. For example, a layer 7 load balancer can direct video traffic to servers that host videos while directing more sensitive user billing traffic to security-hardened servers. + +At the cost of flexibility, layer 4 load balancing requires less time and computing resources than Layer 7, although the performance impact can be minimal on modern commodity hardware. + +### Horizontal scaling + +Load balancers can also help with horizontal scaling, improving performance and availability. Scaling out using commodity machines is more cost efficient and results in higher availability than scaling up a single server on more expensive hardware, called **Vertical Scaling**. It is also easier to hire for talent working on commodity hardware than it is for specialized enterprise systems. + +#### Disadvantage(s): horizontal scaling + +* Scaling horizontally introduces complexity and involves cloning servers + * Servers should be stateless: they should not contain any user-related data like sessions or profile pictures + * Sessions can be stored in a centralized data store such as a [database](#database) (SQL, NoSQL) or a persistent [cache](#cache) (Redis, Memcached) +* Downstream servers such as caches and databases need to handle more simultaneous connections as upstream servers scale out + +### Disadvantage(s): load balancer + +* The load balancer can become a performance bottleneck if it does not have enough resources or if it is not configured properly. +* Introducing a load balancer to help eliminate single points of failure results in increased complexity. +* A single load balancer is a single point of failure, configuring multiple load balancers further increases complexity. + +### Source(s) and further reading + +* [NGINX architecture](https://www.nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/) +* [HAProxy architecture guide](http://www.haproxy.org/download/1.2/doc/architecture.txt) +* [Scalability](http://www.lecloud.net/post/7295452622/scalability-for-dummies-part-1-clones) +* [Wikipedia](https://en.wikipedia.org/wiki/Load_balancing_(computing)) +* [Layer 4 load balancing](https://www.nginx.com/resources/glossary/layer-4-load-balancing/) +* [Layer 7 load balancing](https://www.nginx.com/resources/glossary/layer-7-load-balancing/) +* [ELB listener config](http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) + +## Reverse proxy (web server) + +

+ +
+ Source: Wikipedia +
+

+ +A reverse proxy is a web server that centralizes internal services and provides unified interfaces to the public. Requests from clients are forwarded to a server that can fulfill it before the reverse proxy returns the server's response to the client. + +Additional benefits include: + +* **Increased security** - Hide information about backend servers, blacklist IPs, limit number of connections per client +* **Increased scalability and flexibility** - Clients only see the reverse proxy's IP, allowing you to scale servers or change their configuration +* **SSL termination** - Decrypt incoming requests and encrypt server responses so backend servers do not have to perform these potentially expensive operations + * Removes the need to install [X.509 certificates](https://en.wikipedia.org/wiki/X.509) on each server +* **Compression** - Compress server responses +* **Caching** - Return the response for cached requests +* **Static content** - Serve static content directly + * HTML/CSS/JS + * Photos + * Videos + * Etc + +### Load balancer vs reverse proxy + +* Deploying a load balancer is useful when you have multiple servers. Often, load balancers route traffic to a set of servers serving the same function. +* Reverse proxies can be useful even with just one web server or application server, opening up the benefits described in the previous section. +* Solutions such as NGINX and HAProxy can support both layer 7 reverse proxying and load balancing. + +### Disadvantage(s): reverse proxy + +* Introducing a reverse proxy results in increased complexity. +* A single reverse proxy is a single point of failure, configuring multiple reverse proxies (ie a [failover](https://en.wikipedia.org/wiki/Failover)) further increases complexity. + +### Source(s) and further reading + +* [Reverse proxy vs load balancer](https://www.nginx.com/resources/glossary/reverse-proxy-vs-load-balancer/) +* [NGINX architecture](https://www.nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/) +* [HAProxy architecture guide](http://www.haproxy.org/download/1.2/doc/architecture.txt) +* [Wikipedia](https://en.wikipedia.org/wiki/Reverse_proxy) + +## Application layer + +

+ +
+ Source: Intro to architecting systems for scale +

+ +Separating out the web layer from the application layer (also known as platform layer) allows you to scale and configure both layers independently. Adding a new API results in adding application servers without necessarily adding additional web servers. The **single responsibility principle** advocates for small and autonomous services that work together. Small teams with small services can plan more aggressively for rapid growth. + +Workers in the application layer also help enable [asynchronism](#asynchronism). + +### Microservices + +Related to this discussion are [microservices](https://en.wikipedia.org/wiki/Microservices), which can be described as a suite of independently deployable, small, modular services. Each service runs a unique process and communicates through a well-defined, lightweight mechanism to serve a business goal. 1 + +Pinterest, for example, could have the following microservices: user profile, follower, feed, search, photo upload, etc. + +### Service Discovery + +Systems such as [Consul](https://www.consul.io/docs/index.html), [Etcd](https://coreos.com/etcd/docs/latest), and [Zookeeper](http://www.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper) can help services find each other by keeping track of registered names, addresses, and ports. [Health checks](https://www.consul.io/intro/getting-started/checks.html) help verify service integrity and are often done using an [HTTP](#hypertext-transfer-protocol-http) endpoint. Both Consul and Etcd have a built in [key-value store](#key-value-store) that can be useful for storing config values and other shared data. + +### Disadvantage(s): application layer + +* Adding an application layer with loosely coupled services requires a different approach from an architectural, operations, and process viewpoint (vs a monolithic system). +* Microservices can add complexity in terms of deployments and operations. + +### Source(s) and further reading + +* [Intro to architecting systems for scale](http://lethain.com/introduction-to-architecting-systems-for-scale) +* [Crack the system design interview](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview) +* [Service oriented architecture](https://en.wikipedia.org/wiki/Service-oriented_architecture) +* [Introduction to Zookeeper](http://www.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper) +* [Here's what you need to know about building microservices](https://cloudncode.wordpress.com/2016/07/22/msa-getting-started/) + +## Database + +

+ +
+ Source: Scaling up to your first 10 million users +

+ +### Relational database management system (RDBMS) + +A relational database like SQL is a collection of data items organized in tables. + +**ACID** is a set of properties of relational database [transactions](https://en.wikipedia.org/wiki/Database_transaction). + +* **Atomicity** - Each transaction is all or nothing +* **Consistency** - Any transaction will bring the database from one valid state to another +* **Isolation** - Executing transactions concurrently has the same results as if the transactions were executed serially +* **Durability** - Once a transaction has been committed, it will remain so + +There are many techniques to scale a relational database: **master-slave replication**, **master-master replication**, **federation**, **sharding**, **denormalization**, and **SQL tuning**. + +#### Master-slave replication + +The master serves reads and writes, replicating writes to one or more slaves, which serve only reads. Slaves can also replicate to additional slaves in a tree-like fashion. If the master goes offline, the system can continue to operate in read-only mode until a slave is promoted to a master or a new master is provisioned. + +

+ +
+ Source: Scalability, availability, stability, patterns +

+ +##### Disadvantage(s): master-slave replication + +* Additional logic is needed to promote a slave to a master. +* See [Disadvantage(s): replication](#disadvantages-replication) for points related to **both** master-slave and master-master. + +#### Master-master replication + +Both masters serve reads and writes and coordinate with each other on writes. If either master goes down, the system can continue to operate with both reads and writes. + +

+ +
+ Source: Scalability, availability, stability, patterns +

+ +##### Disadvantage(s): master-master replication + +* You'll need a load balancer or you'll need to make changes to your application logic to determine where to write. +* Most master-master systems are either loosely consistent (violating ACID) or have increased write latency due to synchronization. +* Conflict resolution comes more into play as more write nodes are added and as latency increases. +* See [Disadvantage(s): replication](#disadvantages-replication) for points related to **both** master-slave and master-master. + +##### Disadvantage(s): replication + +* There is a potential for loss of data if the master fails before any newly written data can be replicated to other nodes. +* Writes are replayed to the read replicas. If there are a lot of writes, the read replicas can get bogged down with replaying writes and can't do as many reads. +* The more read slaves, the more you have to replicate, which leads to greater replication lag. +* On some systems, writing to the master can spawn multiple threads to write in parallel, whereas read replicas only support writing sequentially with a single thread. +* Replication adds more hardware and additional complexity. + +##### Source(s) and further reading: replication + +* [Scalability, availability, stability, patterns](http://www.slideshare.net/jboner/scalability-availability-stability-patterns/) +* [Multi-master replication](https://en.wikipedia.org/wiki/Multi-master_replication) + +#### Federation + +

+ +
+ Source: Scaling up to your first 10 million users +

+ +Federation (or functional partitioning) splits up databases by function. For example, instead of a single, monolithic database, you could have three databases: **forums**, **users**, and **products**, resulting in less read and write traffic to each database and therefore less replication lag. Smaller databases result in more data that can fit in memory, which in turn results in more cache hits due to improved cache locality. With no single central master serializing writes you can write in parallel, increasing throughput. + +##### Disadvantage(s): federation + +* Federation is not effective if your schema requires huge functions or tables. +* You'll need to update your application logic to determine which database to read and write. +* Joining data from two databases is more complex with a [server link](http://stackoverflow.com/questions/5145637/querying-data-by-joining-two-tables-in-two-database-on-different-servers). +* Federation adds more hardware and additional complexity. + +##### Source(s) and further reading: federation + +* [Scaling up to your first 10 million users](https://www.youtube.com/watch?v=w95murBkYmU) + +#### Sharding + +

+ +
+ Source: Scalability, availability, stability, patterns +

+ +Sharding distributes data across different databases such that each database can only manage a subset of the data. Taking a users database as an example, as the number of users increases, more shards are added to the cluster. + +Similar to the advantages of [federation](#federation), sharding results in less read and write traffic, less replication, and more cache hits. Index size is also reduced, which generally improves performance with faster queries. If one shard goes down, the other shards are still operational, although you'll want to add some form of replication to avoid data loss. Like federation, there is no single central master serializing writes, allowing you to write in parallel with increased throughput. + +Common ways to shard a table of users is either through the user's last name initial or the user's geographic location. + +##### Disadvantage(s): sharding + +* You'll need to update your application logic to work with shards, which could result in complex SQL queries. +* Data distribution can become lopsided in a shard. For example, a set of power users on a shard could result in increased load to that shard compared to others. + * Rebalancing adds additional complexity. A sharding function based on [consistent hashing](http://www.paperplanes.de/2011/12/9/the-magic-of-consistent-hashing.html) can reduce the amount of transferred data. +* Joining data from multiple shards is more complex. +* Sharding adds more hardware and additional complexity. + +##### Source(s) and further reading: sharding + +* [The coming of the shard](http://highscalability.com/blog/2009/8/6/an-unorthodox-approach-to-database-design-the-coming-of-the.html) +* [Shard database architecture](https://en.wikipedia.org/wiki/Shard_(database_architecture)) +* [Consistent hashing](http://www.paperplanes.de/2011/12/9/the-magic-of-consistent-hashing.html) + +#### Denormalization + +Denormalization attempts to improve read performance at the expense of some write performance. Redundant copies of the data are written in multiple tables to avoid expensive joins. Some RDBMS such as [PostgreSQL](https://en.wikipedia.org/wiki/PostgreSQL) and Oracle support [materialized views](https://en.wikipedia.org/wiki/Materialized_view) which handle the work of storing redundant information and keeping redundant copies consistent. + +Once data becomes distributed with techniques such as [federation](#federation) and [sharding](#sharding), managing joins across data centers further increases complexity. Denormalization might circumvent the need for such complex joins. + +In most systems, reads can heavily outnumber writes 100:1 or even 1000:1. A read resulting in a complex database join can be very expensive, spending a significant amount of time on disk operations. + +##### Disadvantage(s): denormalization + +* Data is duplicated. +* Constraints can help redundant copies of information stay in sync, which increases complexity of the database design. +* A denormalized database under heavy write load might perform worse than its normalized counterpart. + +###### Source(s) and further reading: denormalization + +* [Denormalization](https://en.wikipedia.org/wiki/Denormalization) + +#### SQL tuning + +SQL tuning is a broad topic and many [books](https://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=sql+tuning) have been written as reference. + +It's important to **benchmark** and **profile** to simulate and uncover bottlenecks. + +* **Benchmark** - Simulate high-load situations with tools such as [ab](http://httpd.apache.org/docs/2.2/programs/ab.html). +* **Profile** - Enable tools such as the [slow query log](http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html) to help track performance issues. + +Benchmarking and profiling might point you to the following optimizations. + +##### Tighten up the schema + +* MySQL dumps to disk in contiguous blocks for fast access. +* Use `CHAR` instead of `VARCHAR` for fixed-length fields. + * `CHAR` effectively allows for fast, random access, whereas with `VARCHAR`, you must find the end of a string before moving onto the next one. +* Use `TEXT` for large blocks of text such as blog posts. `TEXT` also allows for boolean searches. Using a `TEXT` field results in storing a pointer on disk that is used to locate the text block. +* Use `INT` for larger numbers up to 2^32 or 4 billion. +* Use `DECIMAL` for currency to avoid floating point representation errors. +* Avoid storing large `BLOBS`, store the location of where to get the object instead. +* `VARCHAR(255)` is the largest number of characters that can be counted in an 8 bit number, often maximizing the use of a byte in some RDBMS. +* Set the `NOT NULL` constraint where applicable to [improve search performance](http://stackoverflow.com/questions/1017239/how-do-null-values-affect-performance-in-a-database-search). + +##### Use good indices + +* Columns that you are querying (`SELECT`, `GROUP BY`, `ORDER BY`, `JOIN`) could be faster with indices. +* Indices are usually represented as self-balancing [B-tree](https://en.wikipedia.org/wiki/B-tree) that keeps data sorted and allows searches, sequential access, insertions, and deletions in logarithmic time. +* Placing an index can keep the data in memory, requiring more space. +* Writes could also be slower since the index also needs to be updated. +* When loading large amounts of data, it might be faster to disable indices, load the data, then rebuild the indices. + +##### Avoid expensive joins + +* [Denormalize](#denormalization) where performance demands it. + +##### Partition tables + +* Break up a table by putting hot spots in a separate table to help keep it in memory. + +##### Tune the query cache + +* In some cases, the [query cache](https://dev.mysql.com/doc/refman/5.7/en/query-cache.html) could lead to [performance issues](https://www.percona.com/blog/2016/10/12/mysql-5-7-performance-tuning-immediately-after-installation/). + +##### Source(s) and further reading: SQL tuning + +* [Tips for optimizing MySQL queries](http://aiddroid.com/10-tips-optimizing-mysql-queries-dont-suck/) +* [Is there a good reason i see VARCHAR(255) used so often?](http://stackoverflow.com/questions/1217466/is-there-a-good-reason-i-see-varchar255-used-so-often-as-opposed-to-another-l) +* [How do null values affect performance?](http://stackoverflow.com/questions/1017239/how-do-null-values-affect-performance-in-a-database-search) +* [Slow query log](http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html) + +### NoSQL + +NoSQL is a collection of data items represented in a **key-value store**, **document store**, **wide column store**, or a **graph database**. Data is denormalized, and joins are generally done in the application code. Most NoSQL stores lack true ACID transactions and favor [eventual consistency](#eventual-consistency). + +**BASE** is often used to describe the properties of NoSQL databases. In comparison with the [CAP Theorem](#cap-theorem), BASE chooses availability over consistency. + +* **Basically available** - the system guarantees availability. +* **Soft state** - the state of the system may change over time, even without input. +* **Eventual consistency** - the system will become consistent over a period of time, given that the system doesn't receive input during that period. + +In addition to choosing between [SQL or NoSQL](#sql-or-nosql), it is helpful to understand which type of NoSQL database best fits your use case(s). We'll review **key-value stores**, **document stores**, **wide column stores**, and **graph databases** in the next section. + +#### Key-value store + +> Abstraction: hash table + +A key-value store generally allows for O(1) reads and writes and is often backed by memory or SSD. Data stores can maintain keys in [lexicographic order](https://en.wikipedia.org/wiki/Lexicographical_order), allowing efficient retrieval of key ranges. Key-value stores can allow for storing of metadata with a value. + +Key-value stores provide high performance and are often used for simple data models or for rapidly-changing data, such as an in-memory cache layer. Since they offer only a limited set of operations, complexity is shifted to the application layer if additional operations are needed. + +A key-value store is the basis for more complex systems such as a document store, and in some cases, a graph database. + +##### Source(s) and further reading: key-value store + +* [Key-value database](https://en.wikipedia.org/wiki/Key-value_database) +* [Disadvantages of key-value stores](http://stackoverflow.com/questions/4056093/what-are-the-disadvantages-of-using-a-key-value-table-over-nullable-columns-or) +* [Redis architecture](http://qnimate.com/overview-of-redis-architecture/) +* [Memcached architecture](https://www.adayinthelifeof.nl/2011/02/06/memcache-internals/) + +#### Document store + +> Abstraction: key-value store with documents stored as values + +A document store is centered around documents (XML, JSON, binary, etc), where a document stores all information for a given object. Document stores provide APIs or a query language to query based on the internal structure of the document itself. *Note, many key-value stores include features for working with a value's metadata, blurring the lines between these two storage types.* + +Based on the underlying implementation, documents are organized by collections, tags, metadata, or directories. Although documents can be organized or grouped together, documents may have fields that are completely different from each other. + +Some document stores like [MongoDB](https://www.mongodb.com/mongodb-architecture) and [CouchDB](https://blog.couchdb.org/2016/08/01/couchdb-2-0-architecture/) also provide a SQL-like language to perform complex queries. [DynamoDB](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/decandia07dynamo.pdf) supports both key-values and documents. + +Document stores provide high flexibility and are often used for working with occasionally changing data. + +##### Source(s) and further reading: document store + +* [Document-oriented database](https://en.wikipedia.org/wiki/Document-oriented_database) +* [MongoDB architecture](https://www.mongodb.com/mongodb-architecture) +* [CouchDB architecture](https://blog.couchdb.org/2016/08/01/couchdb-2-0-architecture/) +* [Elasticsearch architecture](https://www.elastic.co/blog/found-elasticsearch-from-the-bottom-up) + +#### Wide column store + +

+ +
+ Source: SQL & NoSQL, a brief history +

+ +> Abstraction: nested map `ColumnFamily>` + +A wide column store's basic unit of data is a column (name/value pair). A column can be grouped in column families (analogous to a SQL table). Super column families further group column families. You can access each column independently with a row key, and columns with the same row key form a row. Each value contains a timestamp for versioning and for conflict resolution. + +Google introduced [Bigtable](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/chang06bigtable.pdf) as the first wide column store, which influenced the open-source [HBase](https://www.mapr.com/blog/in-depth-look-hbase-architecture) often-used in the Hadoop ecosystem, and [Cassandra](http://docs.datastax.com/en/cassandra/3.0/cassandra/architecture/archIntro.html) from Facebook. Stores such as BigTable, HBase, and Cassandra maintain keys in lexicographic order, allowing efficient retrieval of selective key ranges. + +Wide column stores offer high availability and high scalability. They are often used for very large data sets. + +##### Source(s) and further reading: wide column store + +* [SQL & NoSQL, a brief history](http://blog.grio.com/2015/11/sql-nosql-a-brief-history.html) +* [Bigtable architecture](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/chang06bigtable.pdf) +* [HBase architecture](https://www.mapr.com/blog/in-depth-look-hbase-architecture) +* [Cassandra architecture](http://docs.datastax.com/en/cassandra/3.0/cassandra/architecture/archIntro.html) + +#### Graph database + +

+ +
+ Source: Graph database +

+ +> Abstraction: graph + +In a graph database, each node is a record and each arc is a relationship between two nodes. Graph databases are optimized to represent complex relationships with many foreign keys or many-to-many relationships. + +Graphs databases offer high performance for data models with complex relationships, such as a social network. They are relatively new and are not yet widely-used; it might be more difficult to find development tools and resources. Many graphs can only be accessed with [REST APIs](#representational-state-transfer-rest). + +##### Source(s) and further reading: graph + +* [Graph database](https://en.wikipedia.org/wiki/Graph_database) +* [Neo4j](https://neo4j.com/) +* [FlockDB](https://blog.twitter.com/2010/introducing-flockdb) + +#### Source(s) and further reading: NoSQL + +* [Explanation of base terminology](http://stackoverflow.com/questions/3342497/explanation-of-base-terminology) +* [NoSQL databases a survey and decision guidance](https://medium.com/baqend-blog/nosql-databases-a-survey-and-decision-guidance-ea7823a822d#.wskogqenq) +* [Scalability](http://www.lecloud.net/post/7994751381/scalability-for-dummies-part-2-database) +* [Introduction to NoSQL](https://www.youtube.com/watch?v=qI_g07C_Q5I) +* [NoSQL patterns](http://horicky.blogspot.com/2009/11/nosql-patterns.html) + +### SQL or NoSQL + +

+ +
+ Source: Transitioning from RDBMS to NoSQL +

+ +Reasons for **SQL**: + +* Structured data +* Strict schema +* Relational data +* Need for complex joins +* Transactions +* Clear patterns for scaling +* More established: developers, community, code, tools, etc +* Lookups by index are very fast + +Reasons for **NoSQL**: + +* Semi-structured data +* Dynamic or flexible schema +* Non-relational data +* No need for complex joins +* Store many TB (or PB) of data +* Very data intensive workload +* Very high throughput for IOPS + +Sample data well-suited for NoSQL: + +* Rapid ingest of clickstream and log data +* Leaderboard or scoring data +* Temporary data, such as a shopping cart +* Frequently accessed ('hot') tables +* Metadata/lookup tables + +##### Source(s) and further reading: SQL or NoSQL + +* [Scaling up to your first 10 million users](https://www.youtube.com/watch?v=w95murBkYmU) +* [SQL vs NoSQL differences](https://www.sitepoint.com/sql-vs-nosql-differences/) + +## Cache + +

+ +
+ Source: Scalable system design patterns +

+ +Caching improves page load times and can reduce the load on your servers and databases. In this model, the dispatcher will first lookup if the request has been made before and try to find the previous result to return, in order to save the actual execution. + +Databases often benefit from a uniform distribution of reads and writes across its partitions. Popular items can skew the distribution, causing bottlenecks. Putting a cache in front of a database can help absorb uneven loads and spikes in traffic. + +### Client caching + +Caches can be located on the client side (OS or browser), [server side](#reverse-proxy-web-server), or in a distinct cache layer. + +### CDN caching + +[CDNs](#content-delivery-network) are considered a type of cache. + +### Web server caching + +[Reverse proxies](#reverse-proxy-web-server) and caches such as [Varnish](https://www.varnish-cache.org/) can serve static and dynamic content directly. Web servers can also cache requests, returning responses without having to contact application servers. + +### Database caching + +Your database usually includes some level of caching in a default configuration, optimized for a generic use case. Tweaking these settings for specific usage patterns can further boost performance. + +### Application caching + +In-memory caches such as Memcached and Redis are key-value stores between your application and your data storage. Since the data is held in RAM, it is much faster than typical databases where data is stored on disk. RAM is more limited than disk, so [cache invalidation](https://en.wikipedia.org/wiki/Cache_algorithms) algorithms such as [least recently used (LRU)](https://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used) can help invalidate 'cold' entries and keep 'hot' data in RAM. + +Redis has the following additional features: + +* Persistence option +* Built-in data structures such as sorted sets and lists + +There are multiple levels you can cache that fall into two general categories: **database queries** and **objects**: + +* Row level +* Query-level +* Fully-formed serializable objects +* Fully-rendered HTML + +Generally, you should try to avoid file-based caching, as it makes cloning and auto-scaling more difficult. + +### Caching at the database query level + +Whenever you query the database, hash the query as a key and store the result to the cache. This approach suffers from expiration issues: + +* Hard to delete a cached result with complex queries +* If one piece of data changes such as a table cell, you need to delete all cached queries that might include the changed cell + +### Caching at the object level + +See your data as an object, similar to what you do with your application code. Have your application assemble the dataset from the database into a class instance or a data structure(s): + +* Remove the object from cache if its underlying data has changed +* Allows for asynchronous processing: workers assemble objects by consuming the latest cached object + +Suggestions of what to cache: + +* User sessions +* Fully rendered web pages +* Activity streams +* User graph data + +### When to update the cache + +Since you can only store a limited amount of data in cache, you'll need to determine which cache update strategy works best for your use case. + +#### Cache-aside + +

+ +
+ Source: From cache to in-memory data grid +

+ +The application is responsible for reading and writing from storage. The cache does not interact with storage directly. The application does the following: + +* Look for entry in cache, resulting in a cache miss +* Load entry from the database +* Add entry to cache +* Return entry + +```python +def get_user(self, user_id): + user = cache.get("user.{0}", user_id) + if user is None: + user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id) + if user is not None: + key = "user.{0}".format(user_id) + cache.set(key, json.dumps(user)) + return user +``` + +[Memcached](https://memcached.org/) is generally used in this manner. + +Subsequent reads of data added to cache are fast. Cache-aside is also referred to as lazy loading. Only requested data is cached, which avoids filling up the cache with data that isn't requested. + +##### Disadvantage(s): cache-aside + +* Each cache miss results in three trips, which can cause a noticeable delay. +* Data can become stale if it is updated in the database. This issue is mitigated by setting a time-to-live (TTL) which forces an update of the cache entry, or by using write-through. +* When a node fails, it is replaced by a new, empty node, increasing latency. + +#### Write-through + +

+ +
+ Source: Scalability, availability, stability, patterns +

+ +The application uses the cache as the main data store, reading and writing data to it, while the cache is responsible for reading and writing to the database: + +* Application adds/updates entry in cache +* Cache synchronously writes entry to data store +* Return + +Application code: + +```python +set_user(12345, {"foo":"bar"}) +``` + +Cache code: + +```python +def set_user(user_id, values): + user = db.query("UPDATE Users WHERE id = {0}", user_id, values) + cache.set(user_id, user) +``` + +Write-through is a slow overall operation due to the write operation, but subsequent reads of just written data are fast. Users are generally more tolerant of latency when updating data than reading data. Data in the cache is not stale. + +##### Disadvantage(s): write through + +* When a new node is created due to failure or scaling, the new node will not cache entries until the entry is updated in the database. Cache-aside in conjunction with write through can mitigate this issue. +* Most data written might never be read, which can be minimized with a TTL. + +#### Write-behind (write-back) + +

+ +
+ Source: Scalability, availability, stability, patterns +

+ +In write-behind, the application does the following: + +* Add/update entry in cache +* Asynchronously write entry to the data store, improving write performance + +##### Disadvantage(s): write-behind + +* There could be data loss if the cache goes down prior to its contents hitting the data store. +* It is more complex to implement write-behind than it is to implement cache-aside or write-through. + +#### Refresh-ahead + +

+ +
+ Source: From cache to in-memory data grid +

+ +You can configure the cache to automatically refresh any recently accessed cache entry prior to its expiration. + +Refresh-ahead can result in reduced latency vs read-through if the cache can accurately predict which items are likely to be needed in the future. + +##### Disadvantage(s): refresh-ahead + +* Not accurately predicting which items are likely to be needed in the future can result in reduced performance than without refresh-ahead. + +### Disadvantage(s): cache + +* Need to maintain consistency between caches and the source of truth such as the database through [cache invalidation](https://en.wikipedia.org/wiki/Cache_algorithms). +* Cache invalidation is a difficult problem, there is additional complexity associated with when to update the cache. +* Need to make application changes such as adding Redis or memcached. + +### Source(s) and further reading + +* [From cache to in-memory data grid](http://www.slideshare.net/tmatyashovsky/from-cache-to-in-memory-data-grid-introduction-to-hazelcast) +* [Scalable system design patterns](http://horicky.blogspot.com/2010/10/scalable-system-design-patterns.html) +* [Introduction to architecting systems for scale](http://lethain.com/introduction-to-architecting-systems-for-scale/) +* [Scalability, availability, stability, patterns](http://www.slideshare.net/jboner/scalability-availability-stability-patterns/) +* [Scalability](http://www.lecloud.net/post/9246290032/scalability-for-dummies-part-3-cache) +* [AWS ElastiCache strategies](http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Strategies.html) +* [Wikipedia](https://en.wikipedia.org/wiki/Cache_(computing)) + +## Asynchronism + +

+ +
+ Source: Intro to architecting systems for scale +

+ +Asynchronous workflows help reduce request times for expensive operations that would otherwise be performed in-line. They can also help by doing time-consuming work in advance, such as periodic aggregation of data. + +### Message queues + +Message queues receive, hold, and deliver messages. If an operation is too slow to perform inline, you can use a message queue with the following workflow: + +* An application publishes a job to the queue, then notifies the user of job status +* A worker picks up the job from the queue, processes it, then signals the job is complete + +The user is not blocked and the job is processed in the background. During this time, the client might optionally do a small amount of processing to make it seem like the task has completed. For example, if posting a tweet, the tweet could be instantly posted to your timeline, but it could take some time before your tweet is actually delivered to all of your followers. + +**[Redis](https://redis.io/)** is useful as a simple message broker but messages can be lost. + +**[RabbitMQ](https://www.rabbitmq.com/)** is popular but requires you to adapt to the 'AMQP' protocol and manage your own nodes. + +**[Amazon SQS](https://aws.amazon.com/sqs/)** is hosted but can have high latency and has the possibility of messages being delivered twice. + +### Task queues + +Tasks queues receive tasks and their related data, runs them, then delivers their results. They can support scheduling and can be used to run computationally-intensive jobs in the background. + +**Celery** has support for scheduling and primarily has python support. + +### Back pressure + +If queues start to grow significantly, the queue size can become larger than memory, resulting in cache misses, disk reads, and even slower performance. [Back pressure](http://mechanical-sympathy.blogspot.com/2012/05/apply-back-pressure-when-overloaded.html) can help by limiting the queue size, thereby maintaining a high throughput rate and good response times for jobs already in the queue. Once the queue fills up, clients get a server busy or HTTP 503 status code to try again later. Clients can retry the request at a later time, perhaps with [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff). + +### Disadvantage(s): asynchronism + +* Use cases such as inexpensive calculations and realtime workflows might be better suited for synchronous operations, as introducing queues can add delays and complexity. + +### Source(s) and further reading + +* [It's all a numbers game](https://www.youtube.com/watch?v=1KRYH75wgy4) +* [Applying back pressure when overloaded](http://mechanical-sympathy.blogspot.com/2012/05/apply-back-pressure-when-overloaded.html) +* [Little's law](https://en.wikipedia.org/wiki/Little%27s_law) +* [What is the difference between a message queue and a task queue?](https://www.quora.com/What-is-the-difference-between-a-message-queue-and-a-task-queue-Why-would-a-task-queue-require-a-message-broker-like-RabbitMQ-Redis-Celery-or-IronMQ-to-function) + +## Communication + +

+ +
+ Source: OSI 7 layer model +

+ +### Hypertext transfer protocol (HTTP) + +HTTP is a method for encoding and transporting data between a client and a server. It is a request/response protocol: clients issue requests and servers issue responses with relevant content and completion status info about the request. HTTP is self-contained, allowing requests and responses to flow through many intermediate routers and servers that perform load balancing, caching, encryption, and compression. + +A basic HTTP request consists of a verb (method) and a resource (endpoint). Below are common HTTP verbs: + +| Verb | Description | Idempotent* | Safe | Cacheable | +|---|---|---|---|---| +| GET | Reads a resource | Yes | Yes | Yes | +| POST | Creates a resource or trigger a process that handles data | No | No | Yes if response contains freshness info | +| PUT | Creates or replace a resource | Yes | No | No | +| PATCH | Partially updates a resource | No | No | Yes if response contains freshness info | +| DELETE | Deletes a resource | Yes | No | No | + +*Can be called many times without different outcomes. + +HTTP is an application layer protocol relying on lower-level protocols such as **TCP** and **UDP**. + +#### Source(s) and further reading: HTTP + +* [What is HTTP?](https://www.nginx.com/resources/glossary/http/) +* [Difference between HTTP and TCP](https://www.quora.com/What-is-the-difference-between-HTTP-protocol-and-TCP-protocol) +* [Difference between PUT and PATCH](https://laracasts.com/discuss/channels/general-discussion/whats-the-differences-between-put-and-patch?page=1) + +### Transmission control protocol (TCP) + +

+ +
+ Source: How to make a multiplayer game +

+ +TCP is a connection-oriented protocol over an [IP network](https://en.wikipedia.org/wiki/Internet_Protocol). Connection is established and terminated using a [handshake](https://en.wikipedia.org/wiki/Handshaking). All packets sent are guaranteed to reach the destination in the original order and without corruption through: + +* Sequence numbers and [checksum fields](https://en.wikipedia.org/wiki/Transmission_Control_Protocol#Checksum_computation) for each packet +* [Acknowledgement](https://en.wikipedia.org/wiki/Acknowledgement_(data_networks)) packets and automatic retransmission + +If the sender does not receive a correct response, it will resend the packets. If there are multiple timeouts, the connection is dropped. TCP also implements [flow control](https://en.wikipedia.org/wiki/Flow_control_(data)) and [congestion control](https://en.wikipedia.org/wiki/Network_congestion#Congestion_control). These guarantees cause delays and generally result in less efficient transmission than UDP. + +To ensure high throughput, web servers can keep a large number of TCP connections open, resulting in high memory usage. It can be expensive to have a large number of open connections between web server threads and say, a [memcached](https://memcached.org/) server. [Connection pooling](https://en.wikipedia.org/wiki/Connection_pool) can help in addition to switching to UDP where applicable. + +TCP is useful for applications that require high reliability but are less time critical. Some examples include web servers, database info, SMTP, FTP, and SSH. + +Use TCP over UDP when: + +* You need all of the data to arrive intact +* You want to automatically make a best estimate use of the network throughput + +### User datagram protocol (UDP) + +

+ +
+ Source: How to make a multiplayer game +

+ +UDP is connectionless. Datagrams (analogous to packets) are guaranteed only at the datagram level. Datagrams might reach their destination out of order or not at all. UDP does not support congestion control. Without the guarantees that TCP support, UDP is generally more efficient. + +UDP can broadcast, sending datagrams to all devices on the subnet. This is useful with [DHCP](https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol) because the client has not yet received an IP address, thus preventing a way for TCP to stream without the IP address. + +UDP is less reliable but works well in real time use cases such as VoIP, video chat, streaming, and realtime multiplayer games. + +Use UDP over TCP when: + +* You need the lowest latency +* Late data is worse than loss of data +* You want to implement your own error correction + +#### Source(s) and further reading: TCP and UDP + +* [Networking for game programming](http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/) +* [Key differences between TCP and UDP protocols](http://www.cyberciti.biz/faq/key-differences-between-tcp-and-udp-protocols/) +* [Difference between TCP and UDP](http://stackoverflow.com/questions/5970383/difference-between-tcp-and-udp) +* [Transmission control protocol](https://en.wikipedia.org/wiki/Transmission_Control_Protocol) +* [User datagram protocol](https://en.wikipedia.org/wiki/User_Datagram_Protocol) +* [Scaling memcache at Facebook](http://www.cs.bu.edu/~jappavoo/jappavoo.github.com/451/papers/memcache-fb.pdf) + +### Remote procedure call (RPC) + +

+ +
+ Source: Crack the system design interview +

+ +In an RPC, a client causes a procedure to execute on a different address space, usually a remote server. The procedure is coded as if it were a local procedure call, abstracting away the details of how to communicate with the server from the client program. Remote calls are usually slower and less reliable than local calls so it is helpful to distinguish RPC calls from local calls. Popular RPC frameworks include [Protobuf](https://developers.google.com/protocol-buffers/), [Thrift](https://thrift.apache.org/), and [Avro](https://avro.apache.org/docs/current/). + +RPC is a request-response protocol: + +* **Client program** - Calls the client stub procedure. The parameters are pushed onto the stack like a local procedure call. +* **Client stub procedure** - Marshals (packs) procedure id and arguments into a request message. +* **Client communication module** - OS sends the message from the client to the server. +* **Server communication module** - OS passes the incoming packets to the server stub procedure. +* **Server stub procedure** - Unmarshalls the results, calls the server procedure matching the procedure id and passes the given arguments. +* The server response repeats the steps above in reverse order. + +Sample RPC calls: + +``` +GET /someoperation?data=anId + +POST /anotheroperation +{ + "data":"anId"; + "anotherdata": "another value" +} +``` + +RPC is focused on exposing behaviors. RPCs are often used for performance reasons with internal communications, as you can hand-craft native calls to better fit your use cases. + +Choose a native library (aka SDK) when: + +* You know your target platform. +* You want to control how your "logic" is accessed. +* You want to control how error control happens off your library. +* Performance and end user experience is your primary concern. + +HTTP APIs following **REST** tend to be used more often for public APIs. + +#### Disadvantage(s): RPC + +* RPC clients become tightly coupled to the service implementation. +* A new API must be defined for every new operation or use case. +* It can be difficult to debug RPC. +* You might not be able to leverage existing technologies out of the box. For example, it might require additional effort to ensure [RPC calls are properly cached](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) on caching servers such as [Squid](http://www.squid-cache.org/). + +### Representational state transfer (REST) + +REST is an architectural style enforcing a client/server model where the client acts on a set of resources managed by the server. The server provides a representation of resources and actions that can either manipulate or get a new representation of resources. All communication must be stateless and cacheable. + +There are four qualities of a RESTful interface: + +* **Identify resources (URI in HTTP)** - use the same URI regardless of any operation. +* **Change with representations (Verbs in HTTP)** - use verbs, headers, and body. +* **Self-descriptive error message (status response in HTTP)** - Use status codes, don't reinvent the wheel. +* **[HATEOAS](http://restcookbook.com/Basics/hateoas/) (HTML interface for HTTP)** - your web service should be fully accessible in a browser. + +Sample REST calls: + +``` +GET /someresources/anId + +PUT /someresources/anId +{"anotherdata": "another value"} +``` + +REST is focused on exposing data. It minimizes the coupling between client/server and is often used for public HTTP APIs. REST uses a more generic and uniform method of exposing resources through URIs, [representation through headers](https://github.com/for-GET/know-your-http-well/blob/master/headers.md), and actions through verbs such as GET, POST, PUT, DELETE, and PATCH. Being stateless, REST is great for horizontal scaling and partitioning. + +#### Disadvantage(s): REST + +* With REST being focused on exposing data, it might not be a good fit if resources are not naturally organized or accessed in a simple hierarchy. For example, returning all updated records from the past hour matching a particular set of events is not easily expressed as a path. With REST, it is likely to be implemented with a combination of URI path, query parameters, and possibly the request body. +* REST typically relies on a few verbs (GET, POST, PUT, DELETE, and PATCH) which sometimes doesn't fit your use case. For example, moving expired documents to the archive folder might not cleanly fit within these verbs. +* Fetching complicated resources with nested hierarchies requires multiple round trips between the client and server to render single views, e.g. fetching content of a blog entry and the comments on that entry. For mobile applications operating in variable network conditions, these multiple roundtrips are highly undesirable. +* Over time, more fields might be added to an API response and older clients will receive all new data fields, even those that they do not need, as a result, it bloats the payload size and leads to larger latencies. + +### RPC and REST calls comparison + +| Operation | RPC | REST | +|---|---|---| +| Signup | **POST** /signup | **POST** /persons | +| Resign | **POST** /resign
{
"personid": "1234"
} | **DELETE** /persons/1234 | +| Read a person | **GET** /readPerson?personid=1234 | **GET** /persons/1234 | +| Read a person’s items list | **GET** /readUsersItemsList?personid=1234 | **GET** /persons/1234/items | +| Add an item to a person’s items | **POST** /addItemToUsersItemsList
{
"personid": "1234";
"itemid": "456"
} | **POST** /persons/1234/items
{
"itemid": "456"
} | +| Update an item | **POST** /modifyItem
{
"itemid": "456";
"key": "value"
} | **PUT** /items/456
{
"key": "value"
} | +| Delete an item | **POST** /removeItem
{
"itemid": "456"
} | **DELETE** /items/456 | + +

+ Source: Do you really know why you prefer REST over RPC +

+ +#### Source(s) and further reading: REST and RPC + +* [Do you really know why you prefer REST over RPC](https://apihandyman.io/do-you-really-know-why-you-prefer-rest-over-rpc/) +* [When are RPC-ish approaches more appropriate than REST?](http://programmers.stackexchange.com/a/181186) +* [REST vs JSON-RPC](http://stackoverflow.com/questions/15056878/rest-vs-json-rpc) +* [Debunking the myths of RPC and REST](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) +* [What are the drawbacks of using REST](https://www.quora.com/What-are-the-drawbacks-of-using-RESTful-APIs) +* [Crack the system design interview](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview) +* [Thrift](https://code.facebook.com/posts/1468950976659943/) +* [Why REST for internal use and not RPC](http://arstechnica.com/civis/viewtopic.php?t=1190508) + +## Security + +This section could use some updates. Consider [contributing](#contributing)! + +Security is a broad topic. Unless you have considerable experience, a security background, or are applying for a position that requires knowledge of security, you probably won't need to know more than the basics: + +* Encrypt in transit and at rest. +* Sanitize all user inputs or any input parameters exposed to user to prevent [XSS](https://en.wikipedia.org/wiki/Cross-site_scripting) and [SQL injection](https://en.wikipedia.org/wiki/SQL_injection). +* Use parameterized queries to prevent SQL injection. +* Use the principle of [least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege). + +### Source(s) and further reading + +* [API security checklist](https://github.com/shieldfy/API-Security-Checklist) +* [Security guide for developers](https://github.com/FallibleInc/security-guide-for-developers) +* [OWASP top ten](https://www.owasp.org/index.php/OWASP_Top_Ten_Cheat_Sheet) + +## Appendix + +You'll sometimes be asked to do 'back-of-the-envelope' estimates. For example, you might need to determine how long it will take to generate 100 image thumbnails from disk or how much memory a data structure will take. The **Powers of two table** and **Latency numbers every programmer should know** are handy references. + +### Powers of two table + +``` +Power Exact Value Approx Value Bytes +--------------------------------------------------------------- +7 128 +8 256 +10 1024 1 thousand 1 KB +16 65,536 64 KB +20 1,048,576 1 million 1 MB +30 1,073,741,824 1 billion 1 GB +32 4,294,967,296 4 GB +40 1,099,511,627,776 1 trillion 1 TB +``` + +#### Source(s) and further reading + +* [Powers of two](https://en.wikipedia.org/wiki/Power_of_two) + +### Latency numbers every programmer should know + +``` +Latency Comparison Numbers +-------------------------- +L1 cache reference 0.5 ns +Branch mispredict 5 ns +L2 cache reference 7 ns 14x L1 cache +Mutex lock/unlock 25 ns +Main memory reference 100 ns 20x L2 cache, 200x L1 cache +Compress 1K bytes with Zippy 10,000 ns 10 us +Send 1 KB bytes over 1 Gbps network 10,000 ns 10 us +Read 4 KB randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD +Read 1 MB sequentially from memory 250,000 ns 250 us +Round trip within same datacenter 500,000 ns 500 us +Read 1 MB sequentially from SSD* 1,000,000 ns 1,000 us 1 ms ~1GB/sec SSD, 4X memory +Disk seek 10,000,000 ns 10,000 us 10 ms 20x datacenter roundtrip +Read 1 MB sequentially from 1 Gbps 10,000,000 ns 10,000 us 10 ms 40x memory, 10X SSD +Read 1 MB sequentially from disk 30,000,000 ns 30,000 us 30 ms 120x memory, 30X SSD +Send packet CA->Netherlands->CA 150,000,000 ns 150,000 us 150 ms + +Notes +----- +1 ns = 10^-9 seconds +1 us = 10^-6 seconds = 1,000 ns +1 ms = 10^-3 seconds = 1,000 us = 1,000,000 ns +``` + +Handy metrics based on numbers above: + +* Read sequentially from disk at 30 MB/s +* Read sequentially from 1 Gbps Ethernet at 100 MB/s +* Read sequentially from SSD at 1 GB/s +* Read sequentially from main memory at 4 GB/s +* 6-7 world-wide round trips per second +* 2,000 round trips per second within a data center + +#### Latency numbers visualized + +![](https://camo.githubusercontent.com/77f72259e1eb58596b564d1ad823af1853bc60a3/687474703a2f2f692e696d6775722e636f6d2f6b307431652e706e67) + +#### Source(s) and further reading + +* [Latency numbers every programmer should know - 1](https://gist.github.com/jboner/2841832) +* [Latency numbers every programmer should know - 2](https://gist.github.com/hellerbarde/2843375) +* [Designs, lessons, and advice from building large distributed systems](http://www.cs.cornell.edu/projects/ladis2009/talks/dean-keynote-ladis2009.pdf) +* [Software Engineering Advice from Building Large-Scale Distributed Systems](https://static.googleusercontent.com/media/research.google.com/en//people/jeff/stanford-295-talk.pdf) + +### Additional system design interview questions + +> Common system design interview questions, with links to resources on how to solve each. + +| Question | Reference(s) | +|---|---| +| Design a file sync service like Dropbox | [youtube.com](https://www.youtube.com/watch?v=PE4gwstWhmc) | +| Design a search engine like Google | [queue.acm.org](http://queue.acm.org/detail.cfm?id=988407)
[stackexchange.com](http://programmers.stackexchange.com/questions/38324/interview-question-how-would-you-implement-google-search)
[ardendertat.com](http://www.ardendertat.com/2012/01/11/implementing-search-engines/)
[stanford.edu](http://infolab.stanford.edu/~backrub/google.html) | +| Design a scalable web crawler like Google | [quora.com](https://www.quora.com/How-can-I-build-a-web-crawler-from-scratch) | +| Design Google docs | [code.google.com](https://code.google.com/p/google-mobwrite/)
[neil.fraser.name](https://neil.fraser.name/writing/sync/) | +| Design a key-value store like Redis | [slideshare.net](http://www.slideshare.net/dvirsky/introduction-to-redis) | +| Design a cache system like Memcached | [slideshare.net](http://www.slideshare.net/oemebamo/introduction-to-memcached) | +| Design a recommendation system like Amazon's | [hulu.com](https://web.archive.org/web/20170406065247/http://tech.hulu.com/blog/2011/09/19/recommendation-system.html)
[ijcai13.org](http://ijcai13.org/files/tutorial_slides/td3.pdf) | +| Design a tinyurl system like Bitly | [n00tc0d3r.blogspot.com](http://n00tc0d3r.blogspot.com/) | +| Design a chat app like WhatsApp | [highscalability.com](http://highscalability.com/blog/2014/2/26/the-whatsapp-architecture-facebook-bought-for-19-billion.html) +| Design a picture sharing system like Instagram | [highscalability.com](http://highscalability.com/flickr-architecture)
[highscalability.com](http://highscalability.com/blog/2011/12/6/instagram-architecture-14-million-users-terabytes-of-photos.html) | +| Design the Facebook news feed function | [quora.com](http://www.quora.com/What-are-best-practices-for-building-something-like-a-News-Feed)
[quora.com](http://www.quora.com/Activity-Streams/What-are-the-scaling-issues-to-keep-in-mind-while-developing-a-social-network-feed)
[slideshare.net](http://www.slideshare.net/danmckinley/etsy-activity-feeds-architecture) | +| Design the Facebook timeline function | [facebook.com](https://www.facebook.com/note.php?note_id=10150468255628920)
[highscalability.com](http://highscalability.com/blog/2012/1/23/facebook-timeline-brought-to-you-by-the-power-of-denormaliza.html) | +| Design the Facebook chat function | [erlang-factory.com](http://www.erlang-factory.com/upload/presentations/31/EugeneLetuchy-ErlangatFacebook.pdf)
[facebook.com](https://www.facebook.com/note.php?note_id=14218138919&id=9445547199&index=0) | +| Design a graph search function like Facebook's | [facebook.com](https://www.facebook.com/notes/facebook-engineering/under-the-hood-building-out-the-infrastructure-for-graph-search/10151347573598920)
[facebook.com](https://www.facebook.com/notes/facebook-engineering/under-the-hood-indexing-and-ranking-in-graph-search/10151361720763920)
[facebook.com](https://www.facebook.com/notes/facebook-engineering/under-the-hood-the-natural-language-interface-of-graph-search/10151432733048920) | +| Design a content delivery network like CloudFlare | [figshare.com](https://figshare.com/articles/Globally_distributed_content_delivery/6605972) | +| Design a trending topic system like Twitter's | [michael-noll.com](http://www.michael-noll.com/blog/2013/01/18/implementing-real-time-trending-topics-in-storm/)
[snikolov .wordpress.com](http://snikolov.wordpress.com/2012/11/14/early-detection-of-twitter-trends/) | +| Design a random ID generation system | [blog.twitter.com](https://blog.twitter.com/2010/announcing-snowflake)
[github.com](https://github.com/twitter/snowflake/) | +| Return the top k requests during a time interval | [cs.ucsb.edu](https://www.cs.ucsb.edu/sites/cs.ucsb.edu/files/docs/reports/2005-23.pdf)
[wpi.edu](http://davis.wpi.edu/xmdv/docs/EDBT11-diyang.pdf) | +| Design a system that serves data from multiple data centers | [highscalability.com](http://highscalability.com/blog/2009/8/24/how-google-serves-data-from-multiple-datacenters.html) | +| Design an online multiplayer card game | [indieflashblog.com](http://www.indieflashblog.com/how-to-create-an-asynchronous-multiplayer-game.html)
[buildnewgames.com](http://buildnewgames.com/real-time-multiplayer/) | +| Design a garbage collection system | [stuffwithstuff.com](http://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/)
[washington.edu](http://courses.cs.washington.edu/courses/csep521/07wi/prj/rick.pdf) | +| Design an API rate limiter | [https://stripe.com/blog/](https://stripe.com/blog/rate-limiters) | +| Add a system design question | [Contribute](#contributing) | + +### Real world architectures + +> Articles on how real world systems are designed. + +

+ +
+ Source: Twitter timelines at scale +

+ +**Don't focus on nitty gritty details for the following articles, instead:** + +* Identify shared principles, common technologies, and patterns within these articles +* Study what problems are solved by each component, where it works, where it doesn't +* Review the lessons learned + +|Type | System | Reference(s) | +|---|---|---| +| Data processing | **MapReduce** - Distributed data processing from Google | [research.google.com](http://static.googleusercontent.com/media/research.google.com/zh-CN/us/archive/mapreduce-osdi04.pdf) | +| Data processing | **Spark** - Distributed data processing from Databricks | [slideshare.net](http://www.slideshare.net/AGrishchenko/apache-spark-architecture) | +| Data processing | **Storm** - Distributed data processing from Twitter | [slideshare.net](http://www.slideshare.net/previa/storm-16094009) | +| | | | +| Data store | **Bigtable** - Distributed column-oriented database from Google | [harvard.edu](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/chang06bigtable.pdf) | +| Data store | **HBase** - Open source implementation of Bigtable | [slideshare.net](http://www.slideshare.net/alexbaranau/intro-to-hbase) | +| Data store | **Cassandra** - Distributed column-oriented database from Facebook | [slideshare.net](http://www.slideshare.net/planetcassandra/cassandra-introduction-features-30103666) +| Data store | **DynamoDB** - Document-oriented database from Amazon | [harvard.edu](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/decandia07dynamo.pdf) | +| Data store | **MongoDB** - Document-oriented database | [slideshare.net](http://www.slideshare.net/mdirolf/introduction-to-mongodb) | +| Data store | **Spanner** - Globally-distributed database from Google | [research.google.com](http://research.google.com/archive/spanner-osdi2012.pdf) | +| Data store | **Memcached** - Distributed memory caching system | [slideshare.net](http://www.slideshare.net/oemebamo/introduction-to-memcached) | +| Data store | **Redis** - Distributed memory caching system with persistence and value types | [slideshare.net](http://www.slideshare.net/dvirsky/introduction-to-redis) | +| | | | +| File system | **Google File System (GFS)** - Distributed file system | [research.google.com](http://static.googleusercontent.com/media/research.google.com/zh-CN/us/archive/gfs-sosp2003.pdf) | +| File system | **Hadoop File System (HDFS)** - Open source implementation of GFS | [apache.org](http://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) | +| | | | +| Misc | **Chubby** - Lock service for loosely-coupled distributed systems from Google | [research.google.com](http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en/us/archive/chubby-osdi06.pdf) | +| Misc | **Dapper** - Distributed systems tracing infrastructure | [research.google.com](http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/36356.pdf) +| Misc | **Kafka** - Pub/sub message queue from LinkedIn | [slideshare.net](http://www.slideshare.net/mumrah/kafka-talk-tri-hug) | +| Misc | **Zookeeper** - Centralized infrastructure and services enabling synchronization | [slideshare.net](http://www.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper) | +| | Add an architecture | [Contribute](#contributing) | + +### Company architectures + +| Company | Reference(s) | +|---|---| +| Amazon | [Amazon architecture](http://highscalability.com/amazon-architecture) | +| Cinchcast | [Producing 1,500 hours of audio every day](http://highscalability.com/blog/2012/7/16/cinchcast-architecture-producing-1500-hours-of-audio-every-d.html) | +| DataSift | [Realtime datamining At 120,000 tweets per second](http://highscalability.com/blog/2011/11/29/datasift-architecture-realtime-datamining-at-120000-tweets-p.html) | +| DropBox | [How we've scaled Dropbox](https://www.youtube.com/watch?v=PE4gwstWhmc) | +| ESPN | [Operating At 100,000 duh nuh nuhs per second](http://highscalability.com/blog/2013/11/4/espns-architecture-at-scale-operating-at-100000-duh-nuh-nuhs.html) | +| Google | [Google architecture](http://highscalability.com/google-architecture) | +| Instagram | [14 million users, terabytes of photos](http://highscalability.com/blog/2011/12/6/instagram-architecture-14-million-users-terabytes-of-photos.html)
[What powers Instagram](http://instagram-engineering.tumblr.com/post/13649370142/what-powers-instagram-hundreds-of-instances) | +| Justin.tv | [Justin.Tv's live video broadcasting architecture](http://highscalability.com/blog/2010/3/16/justintvs-live-video-broadcasting-architecture.html) | +| Facebook | [Scaling memcached at Facebook](https://cs.uwaterloo.ca/~brecht/courses/854-Emerging-2014/readings/key-value/fb-memcached-nsdi-2013.pdf)
[TAO: Facebook’s distributed data store for the social graph](https://cs.uwaterloo.ca/~brecht/courses/854-Emerging-2014/readings/data-store/tao-facebook-distributed-datastore-atc-2013.pdf)
[Facebook’s photo storage](https://www.usenix.org/legacy/event/osdi10/tech/full_papers/Beaver.pdf)
[How Facebook Live Streams To 800,000 Simultaneous Viewers](http://highscalability.com/blog/2016/6/27/how-facebook-live-streams-to-800000-simultaneous-viewers.html) | +| Flickr | [Flickr architecture](http://highscalability.com/flickr-architecture) | +| Mailbox | [From 0 to one million users in 6 weeks](http://highscalability.com/blog/2013/6/18/scaling-mailbox-from-0-to-one-million-users-in-6-weeks-and-1.html) | +| Netflix | [A 360 Degree View Of The Entire Netflix Stack](http://highscalability.com/blog/2015/11/9/a-360-degree-view-of-the-entire-netflix-stack.html)
[Netflix: What Happens When You Press Play?](http://highscalability.com/blog/2017/12/11/netflix-what-happens-when-you-press-play.html) | +| Pinterest | [From 0 To 10s of billions of page views a month](http://highscalability.com/blog/2013/4/15/scaling-pinterest-from-0-to-10s-of-billions-of-page-views-a.html)
[18 million visitors, 10x growth, 12 employees](http://highscalability.com/blog/2012/5/21/pinterest-architecture-update-18-million-visitors-10x-growth.html) | +| Playfish | [50 million monthly users and growing](http://highscalability.com/blog/2010/9/21/playfishs-social-gaming-architecture-50-million-monthly-user.html) | +| PlentyOfFish | [PlentyOfFish architecture](http://highscalability.com/plentyoffish-architecture) | +| Salesforce | [How they handle 1.3 billion transactions a day](http://highscalability.com/blog/2013/9/23/salesforce-architecture-how-they-handle-13-billion-transacti.html) | +| Stack Overflow | [Stack Overflow architecture](http://highscalability.com/blog/2009/8/5/stack-overflow-architecture.html) | +| TripAdvisor | [40M visitors, 200M dynamic page views, 30TB data](http://highscalability.com/blog/2011/6/27/tripadvisor-architecture-40m-visitors-200m-dynamic-page-view.html) | +| Tumblr | [15 billion page views a month](http://highscalability.com/blog/2012/2/13/tumblr-architecture-15-billion-page-views-a-month-and-harder.html) | +| Twitter | [Making Twitter 10000 percent faster](http://highscalability.com/scaling-twitter-making-twitter-10000-percent-faster)
[Storing 250 million tweets a day using MySQL](http://highscalability.com/blog/2011/12/19/how-twitter-stores-250-million-tweets-a-day-using-mysql.html)
[150M active users, 300K QPS, a 22 MB/S firehose](http://highscalability.com/blog/2013/7/8/the-architecture-twitter-uses-to-deal-with-150m-active-users.html)
[Timelines at scale](https://www.infoq.com/presentations/Twitter-Timeline-Scalability)
[Big and small data at Twitter](https://www.youtube.com/watch?v=5cKTP36HVgI)
[Operations at Twitter: scaling beyond 100 million users](https://www.youtube.com/watch?v=z8LU0Cj6BOU)
[How Twitter Handles 3,000 Images Per Second](http://highscalability.com/blog/2016/4/20/how-twitter-handles-3000-images-per-second.html) | +| Uber | [How Uber scales their real-time market platform](http://highscalability.com/blog/2015/9/14/how-uber-scales-their-real-time-market-platform.html)
[Lessons Learned From Scaling Uber To 2000 Engineers, 1000 Services, And 8000 Git Repositories](http://highscalability.com/blog/2016/10/12/lessons-learned-from-scaling-uber-to-2000-engineers-1000-ser.html) | +| WhatsApp | [The WhatsApp architecture Facebook bought for $19 billion](http://highscalability.com/blog/2014/2/26/the-whatsapp-architecture-facebook-bought-for-19-billion.html) | +| YouTube | [YouTube scalability](https://www.youtube.com/watch?v=w5WVu624fY8)
[YouTube architecture](http://highscalability.com/youtube-architecture) | + +### Company engineering blogs + +> Architectures for companies you are interviewing with. +> +> Questions you encounter might be from the same domain. + +* [Airbnb Engineering](http://nerds.airbnb.com/) +* [Atlassian Developers](https://developer.atlassian.com/blog/) +* [AWS Blog](https://aws.amazon.com/blogs/aws/) +* [Bitly Engineering Blog](http://word.bitly.com/) +* [Box Blogs](https://blog.box.com/blog/category/engineering) +* [Cloudera Developer Blog](http://blog.cloudera.com/) +* [Dropbox Tech Blog](https://tech.dropbox.com/) +* [Engineering at Quora](http://engineering.quora.com/) +* [Ebay Tech Blog](http://www.ebaytechblog.com/) +* [Evernote Tech Blog](https://blog.evernote.com/tech/) +* [Etsy Code as Craft](http://codeascraft.com/) +* [Facebook Engineering](https://www.facebook.com/Engineering) +* [Flickr Code](http://code.flickr.net/) +* [Foursquare Engineering Blog](http://engineering.foursquare.com/) +* [GitHub Engineering Blog](http://githubengineering.com/) +* [Google Research Blog](http://googleresearch.blogspot.com/) +* [Groupon Engineering Blog](https://engineering.groupon.com/) +* [Heroku Engineering Blog](https://engineering.heroku.com/) +* [Hubspot Engineering Blog](http://product.hubspot.com/blog/topic/engineering) +* [High Scalability](http://highscalability.com/) +* [Instagram Engineering](http://instagram-engineering.tumblr.com/) +* [Intel Software Blog](https://software.intel.com/en-us/blogs/) +* [Jane Street Tech Blog](https://blogs.janestreet.com/category/ocaml/) +* [LinkedIn Engineering](http://engineering.linkedin.com/blog) +* [Microsoft Engineering](https://engineering.microsoft.com/) +* [Microsoft Python Engineering](https://blogs.msdn.microsoft.com/pythonengineering/) +* [Netflix Tech Blog](http://techblog.netflix.com/) +* [Paypal Developer Blog](https://devblog.paypal.com/category/engineering/) +* [Pinterest Engineering Blog](https://medium.com/@Pinterest_Engineering) +* [Quora Engineering](https://engineering.quora.com/) +* [Reddit Blog](http://www.redditblog.com/) +* [Salesforce Engineering Blog](https://developer.salesforce.com/blogs/engineering/) +* [Slack Engineering Blog](https://slack.engineering/) +* [Spotify Labs](https://labs.spotify.com/) +* [Twilio Engineering Blog](http://www.twilio.com/engineering) +* [Twitter Engineering](https://blog.twitter.com/engineering/) +* [Uber Engineering Blog](http://eng.uber.com/) +* [Yahoo Engineering Blog](http://yahooeng.tumblr.com/) +* [Yelp Engineering Blog](http://engineeringblog.yelp.com/) +* [Zynga Engineering Blog](https://www.zynga.com/blogs/engineering) + +#### Source(s) and further reading + +Looking to add a blog? To avoid duplicating work, consider adding your company blog to the following repo: + +* [kilimchoi/engineering-blogs](https://github.com/kilimchoi/engineering-blogs) + +## Under development + +Interested in adding a section or helping complete one in-progress? [Contribute](#contributing)! + +* Distributed computing with MapReduce +* Consistent hashing +* Scatter gather +* [Contribute](#contributing) + +## Credits + +Credits and sources are provided throughout this repo. + +Special thanks to: + +* [Hired in tech](http://www.hiredintech.com/system-design/the-system-design-process/) +* [Cracking the coding interview](https://www.amazon.com/dp/0984782850/) +* [High scalability](http://highscalability.com/) +* [checkcheckzz/system-design-interview](https://github.com/checkcheckzz/system-design-interview) +* [shashank88/system_design](https://github.com/shashank88/system_design) +* [mmcgrana/services-engineering](https://github.com/mmcgrana/services-engineering) +* [System design cheat sheet](https://gist.github.com/vasanthk/485d1c25737e8e72759f) +* [A distributed systems reading list](http://dancres.github.io/Pages/) +* [Cracking the system design interview](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview) + +## Contact info + +Feel free to contact me to discuss any issues, questions, or comments. + +My contact info can be found on my [GitHub page](https://github.com/donnemartin). + +## License + +*I am providing code and resources in this repository to you under an open source license. Because this is my personal repository, the license you receive to my code and resources is from me and not my employer (Facebook).* + + Copyright 2017 Donne Martin + + Creative Commons Attribution 4.0 International License (CC BY 4.0) + + http://creativecommons.org/licenses/by/4.0/ From 5793458ce5e448c1762381a04f2e59367e9cc623 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 13:07:23 +0700 Subject: [PATCH 02/32] Translate Anki flashcard section --- README-id.md | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/README-id.md b/README-id.md index 450adc1f..4fce8d17 100644 --- a/README-id.md +++ b/README-id.md @@ -13,48 +13,50 @@ > > Persiapan wawancara rancangan sistem. -### Learn how to design large-scale systems +### Belajar bagaimana merancang sistem dalam skala besar -Learning how to design scalable systems will help you become a better engineer. +Belajar bagaimana merancang sistem terskalakan membantu menjadikan kita perekayasa yang lebih baik. -System design is a broad topic. There is a **vast amount of resources scattered throughout the web** on system design principles. +Perancangan sistem merupakan topik yang luas. +Sumber daya mengenai prinsip-prinsip perancangan sistem banyak tersebar di berbagai situs di internet. +Hal ini menyulitkan karena sumber daya tersebut tidak terkumpul di satu tempat. -This repo is an **organized collection** of resources to help you learn how to build systems at scale. +Repositori ini menjadi tempat **pengorganisasian koleksi-koleksi** sumber daya yang dibutuhkan untuk belajar membangun sistem dalam sekala besar. -### Learn from the open source community +### Belajar dari komunitas sumber terbuka -This is a continually updated, open source project. +Proyek ini merupakan proyek sumber terbuka yang terus diperbarui. -[Contributions](#contributing) are welcome! +[Ayo kontribusi](#kontribusi) di sini! -### Prep for the system design interview +### Persiapan wawancara rancangan sistem -In addition to coding interviews, system design is a **required component** of the **technical interview process** at many tech companies. +Selain wawancara pemrograman, perancangan sistem adalah salah satu **komponen yang diwajibkan** dari dari **proses wawancara teknis** di banyak perusahaan teknologi. -**Practice common system design interview questions** and **compare** your results with **sample solutions**: discussions, code, and diagrams. +**Latih pertanyaan-pertanyaan umum wawancara rancangan sistem** dan **bandingkan** hasilmu dengan contoh solusi: diskusi, program, dan diagram. -Additional topics for interview prep: +Topik-topik tambahan untuk persiapan wawancara: -* [Study guide](#study-guide) -* [How to approach a system design interview question](#how-to-approach-a-system-design-interview-question) -* [System design interview questions, **with solutions**](#system-design-interview-questions-with-solutions) -* [Object-oriented design interview questions, **with solutions**](#object-oriented-design-interview-questions-with-solutions) -* [Additional system design interview questions](#additional-system-design-interview-questions) +* [Panduan belajar](#panduan-belajar) +* [Pendekatan untuk menjawab pertanyaan wawancara rancangan sistem](#how-to-approach-a-system-design-interview-question) +* [Pertanyaan-pertanyaan wawancara rancangan sistem beserta solusinya](#system-design-interview-questions-with-solutions) +* [Pertanyaan-pertanyaan wawancara rancangan berbasis objek beserta solusinya](#object-oriented-design-interview-questions-with-solutions) +* [Tambahan pertanyaan-pertanyaan wawancara rancangan sistem](#additional-system-design-interview-questions) -## Anki flashcards +## Kartu kilat Anki


-The provided [Anki flashcard decks](https://apps.ankiweb.net/) use spaced repetition to help you retain key system design concepts. +[Bungkusan kartu kilat Anki](https://apps.ankiweb.net/) yang disediakan menggunakan perulangan berjeda untuk membantu menguasai konsep-konsep kunci rancangan sistem. -* [System design deck](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/System%20Design.apkg) -* [System design exercises deck](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/System%20Design%20Exercises.apkg) -* [Object oriented design exercises deck](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/OO%20Design.apkg) +* [Bungkusan rancangan sistem](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/System%20Design.apkg) +* [Bungkusan latihan-latihan rancangan sistem](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/System%20Design%20Exercises.apkg) +* [Bungkusan latihan-latihan rancangan berbasis objek](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/OO%20Design.apkg) -Great for use while on-the-go. +Cocok untuk digunakan ketika dalam perjalanan. ### Coding Resource: Interactive Coding Challenges @@ -69,7 +71,7 @@ Check out the sister repo [**Interactive Coding Challenges**](https://github.com * [Coding deck](https://github.com/donnemartin/interactive-coding-challenges/tree/master/anki_cards/Coding.apkg) -## Contributing +## Kontribusi > Learn from the community. @@ -177,7 +179,7 @@ Review the [Contributing Guidelines](CONTRIBUTING.md). * [Contact info](#contact-info) * [License](#license) -## Study guide +## Panduan belajar > Suggested topics to review based on your interview timeline (short, medium, long). From 7bf0b5d05e535310f792695bdd03cf1900450e0e Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 13:15:39 +0700 Subject: [PATCH 03/32] Translate coding resource section --- README-id.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README-id.md b/README-id.md index 4fce8d17..2d105a95 100644 --- a/README-id.md +++ b/README-id.md @@ -58,18 +58,18 @@ Topik-topik tambahan untuk persiapan wawancara: Cocok untuk digunakan ketika dalam perjalanan. -### Coding Resource: Interactive Coding Challenges +### Sumber daya kode: Tantangan kode interaktif -Looking for resources to help you prep for the [**Coding Interview**](https://github.com/donnemartin/interactive-coding-challenges)? +Apakah Anda mencari sumber daya untuk membantu persiapan [wawancara pemrograman](https://github.com/donnemartin/interactive-coding-challenges)?


-Check out the sister repo [**Interactive Coding Challenges**](https://github.com/donnemartin/interactive-coding-challenges), which contains an additional Anki deck: +Silakan periksa repositori [Tantangan Pemrograman Interaktif](https://github.com/donnemartin/interactive-coding-challenges) yang berisi tambahan bungkusan Anki: -* [Coding deck](https://github.com/donnemartin/interactive-coding-challenges/tree/master/anki_cards/Coding.apkg) +* [Bungkusan pemrograman](https://github.com/donnemartin/interactive-coding-challenges/tree/master/anki_cards/Coding.apkg) ## Kontribusi From 68d9e5b5b9e69cf10e12510881d8bc3afa630e7b Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 13:32:24 +0700 Subject: [PATCH 04/32] Translate kontribution section --- README-id.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README-id.md b/README-id.md index 2d105a95..bef4365c 100644 --- a/README-id.md +++ b/README-id.md @@ -38,10 +38,10 @@ Selain wawancara pemrograman, perancangan sistem adalah salah satu **komponen ya Topik-topik tambahan untuk persiapan wawancara: * [Panduan belajar](#panduan-belajar) -* [Pendekatan untuk menjawab pertanyaan wawancara rancangan sistem](#how-to-approach-a-system-design-interview-question) -* [Pertanyaan-pertanyaan wawancara rancangan sistem beserta solusinya](#system-design-interview-questions-with-solutions) -* [Pertanyaan-pertanyaan wawancara rancangan berbasis objek beserta solusinya](#object-oriented-design-interview-questions-with-solutions) -* [Tambahan pertanyaan-pertanyaan wawancara rancangan sistem](#additional-system-design-interview-questions) +* [Pendekatan menjawab pertanyaan wawancara rancangan sistem](#pendekatan-menjawab-pertanyaan-wawancara-rancangan-sistem) +* [Pertanyaan wawancara rancangan sistem beserta solusinya](#pertanyaan-wawancara-rancangan-sistem-beserta-solusinya) +* [Pertanyaan wawancara rancangan berbasis objek beserta solusinya](#pertanyaan-wawancara-rancangan-berbasis-objek-beserta-solusinya) +* [Tambahan pertanyaan wawancara rancangan sistem](#tambahan-pertanyaan-wawancara-rancangan-sistem) ## Kartu kilat Anki @@ -73,18 +73,18 @@ Silakan periksa repositori [Tantangan Pemrograman Interaktif](https://github.com ## Kontribusi -> Learn from the community. +> Belajar dari komunitas. -Feel free to submit pull requests to help: +Silakan kirim permintaan tarik (pull request) untuk membantu hal-hal berikut: -* Fix errors -* Improve sections -* Add new sections -* [Translate](https://github.com/donnemartin/system-design-primer/issues/28) +* Membenarkan kesalahan +* Memperbaiki bagian yang ada +* Menambahkan bagian baru +* [Terjemahan](https://github.com/donnemartin/system-design-primer/issues/28) -Content that needs some polishing is placed [under development](#under-development). +Konten yang masih memerlukan polesan ditempatkan di bagian [dalam pengembangan](dalam-pengembangan) -Review the [Contributing Guidelines](CONTRIBUTING.md). +Tinjau kembali [Pedomain Kontribusi](CONTRIBUTING.md). ## Index of system design topics @@ -174,7 +174,7 @@ Review the [Contributing Guidelines](CONTRIBUTING.md). * [Real world architectures](#real-world-architectures) * [Company architectures](#company-architectures) * [Company engineering blogs](#company-engineering-blogs) -* [Under development](#under-development) +* [Dalam pengembangan](#dalam-pengembangan) * [Credits](#credits) * [Contact info](#contact-info) * [License](#license) @@ -215,7 +215,7 @@ Start broad and go deeper in a few areas. It helps to know a little about vario | Work through [Object-oriented design interview questions with solutions](#object-oriented-design-interview-questions-with-solutions) | Some | Many | Most | | Review [Additional system design interview questions](#additional-system-design-interview-questions) | Some | Many | Most | -## How to approach a system design interview question +## Pendekatan menjawab pertanyaan wawancara rancangan sistem > How to tackle a system design interview question. @@ -283,7 +283,7 @@ Check out the following links to get a better idea of what to expect: * [The system design interview](http://www.hiredintech.com/system-design) * [Intro to Architecture and Systems Design Interviews](https://www.youtube.com/watch?v=ZgdS0EUmn70) -## System design interview questions with solutions +## Pertanyaan wawancara rancangan sistem beserta solusinya > Common system design interview questions with sample discussions, code, and diagrams. > @@ -349,7 +349,7 @@ Check out the following links to get a better idea of what to expect: ![Imgur](http://i.imgur.com/jj3A5N8.png) -## Object-oriented design interview questions with solutions +## Pertanyaan wawancara rancangan berbasis objek beserta solusinya > Common object-oriented design interview questions with sample discussions, code, and diagrams. > @@ -1643,7 +1643,7 @@ Handy metrics based on numbers above: * [Designs, lessons, and advice from building large distributed systems](http://www.cs.cornell.edu/projects/ladis2009/talks/dean-keynote-ladis2009.pdf) * [Software Engineering Advice from Building Large-Scale Distributed Systems](https://static.googleusercontent.com/media/research.google.com/en//people/jeff/stanford-295-talk.pdf) -### Additional system design interview questions +### Tambahan pertanyaan wawancara rancangan sistem > Common system design interview questions, with links to resources on how to solve each. @@ -1794,7 +1794,7 @@ Looking to add a blog? To avoid duplicating work, consider adding your company * [kilimchoi/engineering-blogs](https://github.com/kilimchoi/engineering-blogs) -## Under development +## Dalam pengembangan Interested in adding a section or helping complete one in-progress? [Contribute](#contributing)! From 8ae7210a7e377f96bbffbe301cb0efd21672e294 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 14:12:51 +0700 Subject: [PATCH 05/32] Translate study guide section --- README-id.md | 56 ++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/README-id.md b/README-id.md index bef4365c..2e987804 100644 --- a/README-id.md +++ b/README-id.md @@ -86,11 +86,11 @@ Konten yang masih memerlukan polesan ditempatkan di bagian [dalam pengembangan]( Tinjau kembali [Pedomain Kontribusi](CONTRIBUTING.md). -## Index of system design topics +## Indeks topik rancangan sistem -> Summaries of various system design topics, including pros and cons. **Everything is a trade-off**. +> Ringkasan dari berbagai topik rancangan sistem, termasuk kelebihan dan kekurangannya. **Segala sesuatu dalam rancangan adalah hasil kompromi**. > -> Each section contains links to more in-depth resources. +> Setiap bagian berisi tautan ke sumber daya yang lebih dalam.

@@ -181,39 +181,43 @@ Tinjau kembali [Pedomain Kontribusi](CONTRIBUTING.md). ## Panduan belajar -> Suggested topics to review based on your interview timeline (short, medium, long). +> Topik yang disarankan untuk ditinjau ulang berdasarkan garis waktu wawancara (pendek, sedang, panjang). ![Imgur](http://i.imgur.com/OfVllex.png) -**Q: For interviews, do I need to know everything here?** +**P: Apakah saya perlu mengetahui segala sesuatu yang ada di sini untuk wawancara?** -**A: No, you don't need to know everything here to prepare for the interview**. +**J: Tidak. Anda tidak perlu tahu segala sesuatu yang ada di sini untuk persiapan wawancara**. -What you are asked in an interview depends on variables such as: +Apa yang menjadi pertanyaan saat Anda wawancara bergantung pada hal-hal yang tidak tentu, contohnya: -* How much experience you have -* What your technical background is -* What positions you are interviewing for -* Which companies you are interviewing with -* Luck +* Banyak pengalaman yang Anda miliki +* Latar belakang teknis Anda +* Posisi yang Anda lamar +* Perusahaan tempat Anda wawancara +* Keberuntungan -More experienced candidates are generally expected to know more about system design. Architects or team leads might be expected to know more than individual contributors. Top tech companies are likely to have one or more design interview rounds. +Kandidat yang berpengalaman umumnya diharapkan untuk tahu lebih mengenai rancangan sistem. +Arsitek atau pemimpin tim mungkin diharapkan untuk tahu lebih banyak dibandingkan kontributor perorangan. +Perusahan teknologi top kemungkinan besar mempunyai satu atau lebih sesi wawancara rancangan. -Start broad and go deeper in a few areas. It helps to know a little about various key system design topics. Adjust the following guide based on your timeline, experience, what positions you are interviewing for, and which companies you are interviewing with. +Mulai dari topik yang luas dan masuk lebih dalam ke beberapa area. +Pengetahuan dasar berbagai topik-topik kunci rancangan sistem akan sangat membantu. +Sesuaikan panduan berikut berdasarkan waktu, pengalaman, posisi yang dilamar, dan perusahan tempat Anda wawancara. -* **Short timeline** - Aim for **breadth** with system design topics. Practice by solving **some** interview questions. -* **Medium timeline** - Aim for **breadth** and **some depth** with system design topics. Practice by solving **many** interview questions. -* **Long timeline** - Aim for **breadth** and **more depth** with system design topics. Practice by solving **most** interview questions. +* **Garis waktu pendek** - Bidik topik-topik rancangan sistem secara luas. Latih dengan cara menjawab beberapa pertanyaan wawancara. +* **Garis waktu sedang** - Bidik topik-topik rancangan sistem secara luas dan perdalam dibeberapa bagian tertentu. Latih dengan cara menjawab banyak pertanyaan wawancara. +* **Garis waktu panjang** - Bidik topik-topik rancangan sistem secara laus dan mendalam. Latih dengan cara menyelesaikan seluruh pertanyaan wawancara. | | Short | Medium | Long | |---|---|---|---| -| Read through the [System design topics](#index-of-system-design-topics) to get a broad understanding of how systems work | :+1: | :+1: | :+1: | -| Read through a few articles in the [Company engineering blogs](#company-engineering-blogs) for the companies you are interviewing with | :+1: | :+1: | :+1: | -| Read through a few [Real world architectures](#real-world-architectures) | :+1: | :+1: | :+1: | -| Review [How to approach a system design interview question](#how-to-approach-a-system-design-interview-question) | :+1: | :+1: | :+1: | -| Work through [System design interview questions with solutions](#system-design-interview-questions-with-solutions) | Some | Many | Most | -| Work through [Object-oriented design interview questions with solutions](#object-oriented-design-interview-questions-with-solutions) | Some | Many | Most | -| Review [Additional system design interview questions](#additional-system-design-interview-questions) | Some | Many | Most | +| Baca sampai habis [Indeks topik rancangan sistem](#indeks-topik-rancangan-sistem) untuk pemahaman secara luas bagaimana cara kerja suatu sistem | :+1: | :+1: | :+1: | +| Baca sampai habis beberapa artikel di [Blog teknik perusahaan](#blog-teknik-perusahaan) untuk perusahaan tempat Anda wawancara | :+1: | :+1: | :+1: | +| Baca sampai habis beberapa [Arsitektur dunia nyata](#arsitektur-dunia-nyata) | :+1: | :+1: | :+1: | +| Ulas [Pendekatan menjawab pertanyaan wawancara rancangan sistem](#pendekatan-menjawab-pertanyaan-wawancara-rancangan-sistem) | :+1: | :+1: | :+1: | +| Tinjau [Pertanyaan wawancara rancangan sistem beserta solusinya](#pertanyaan-wawancara-rancangan-sistem-beserta-solusinya) | Some | Many | Most | +| Teliti [Pertanyaan wawancara rancangan berbasis objek beserta solusinya](#pertanyaan-wawancara-rancangan-berbasis-objek-beserta-solusinya) | Some | Many | Most | +| Periksa [Tambahan pertanyaan wawancara rancangan sistem](#tambahan-pertanyaan-wawancara-rancangan-sistem) | Some | Many | Most | ## Pendekatan menjawab pertanyaan wawancara rancangan sistem @@ -1673,7 +1677,7 @@ Handy metrics based on numbers above: | Design an API rate limiter | [https://stripe.com/blog/](https://stripe.com/blog/rate-limiters) | | Add a system design question | [Contribute](#contributing) | -### Real world architectures +### Arsitektu dunia nyata > Articles on how real world systems are designed. @@ -1741,7 +1745,7 @@ Handy metrics based on numbers above: | WhatsApp | [The WhatsApp architecture Facebook bought for $19 billion](http://highscalability.com/blog/2014/2/26/the-whatsapp-architecture-facebook-bought-for-19-billion.html) | | YouTube | [YouTube scalability](https://www.youtube.com/watch?v=w5WVu624fY8)
[YouTube architecture](http://highscalability.com/youtube-architecture) | -### Company engineering blogs +### Blog teknik perusahaan > Architectures for companies you are interviewing with. > From 94bc736479f84a8b88843027d8444f964ceb6e14 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 15:25:54 +0700 Subject: [PATCH 06/32] Translate section 6 How to approach a system design interview question --- README-id.md | 92 ++++++++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 42 deletions(-) diff --git a/README-id.md b/README-id.md index 2e987804..cbac4ef9 100644 --- a/README-id.md +++ b/README-id.md @@ -221,67 +221,75 @@ Sesuaikan panduan berikut berdasarkan waktu, pengalaman, posisi yang dilamar, da ## Pendekatan menjawab pertanyaan wawancara rancangan sistem -> How to tackle a system design interview question. +> Cara menangani pertanyaan wawancara perancangan sistem. -The system design interview is an **open-ended conversation**. You are expected to lead it. +Wawancara perancangan sistem adalah pembicaraan yang bersifat terbuka. +Kita diharapkan untuk menuntun pembicaraan tersebut. -You can use the following steps to guide the discussion. To help solidify this process, work through the [System design interview questions with solutions](#system-design-interview-questions-with-solutions) section using the following steps. +Kita dapat menggunakan langkah-langkah berikut untuk menuntun diskusi. +Untuk memperkuat proses diskusi, ulas bagian [Pertanyaan wawancara rancangan sistem beserta solusinya](#pertanyaan-wawancara-rancangan-sistem-beserta-solusinya) menggunakan langkah-langkah berikut. -### Step 1: Outline use cases, constraints, and assumptions +### Langkah 1: Uraikan kasus penggunaan, batasan, dan asumsi -Gather requirements and scope the problem. Ask questions to clarify use cases and constraints. Discuss assumptions. +Kumpulkan kebutuhan dan tentukan ruang lingkup permasalahan. +Gunakan pertanyaan untuk memperjelas kasus penggunaan dan batasan. +Diskusikan juga asumsi yang diambil. -* Who is going to use it? -* How are they going to use it? -* How many users are there? -* What does the system do? -* What are the inputs and outputs of the system? -* How much data do we expect to handle? -* How many requests per second do we expect? -* What is the expected read to write ratio? +* Siapa pengguna sistem? +* Bagaimana pengguna sistem akan menggunakan sistem tersebut? +* Berapa banyak pengguna sistem? +* Apa yang dilakukan oleh sistem? +* Masukan dan keluaran apa yang ada pada sistem? +* Berapa besar ekspektasi data yang perlu ditangani? +* Berapa ekspektasi jumlah permintaan per detik? +* Berapa ekspektasi rasio baca dan tulis? -### Step 2: Create a high level design +### Langkah 2: Buat rancangan tingkat tinggi -Outline a high level design with all important components. +Jabarkan rancangan tingkat tinggi yang mencakup seluruh komponen penting. -* Sketch the main components and connections -* Justify your ideas +* Buat sketsa komponen utama dan hubungannya +* Beri alasan untuk ide Anda -### Step 3: Design core components +### Langkah 3: Rancang komponen inti -Dive into details for each core component. For example, if you were asked to [design a url shortening service](solutions/system_design/pastebin/README.md), discuss: +Perinci setiap komponen inti. +Sebagai contoh, jika Anda diminta [merancang layanan penyingkat tautan](solutions/system_design/pastebin/README.md), diskusikan hal-hal berikut: -* Generating and storing a hash of the full url - * [MD5](solutions/system_design/pastebin/README.md) and [Base62](solutions/system_design/pastebin/README.md) - * Hash collisions - * SQL or NoSQL - * Database schema -* Translating a hashed url to the full url - * Database lookup -* API and object-oriented design +* Pembangkitan dan penyimpanan campuran (hash) dari tautan penuh + * [MD5](solutions/system_design/pastebin/README.md) dan [Base62](solutions/system_design/pastebin/README.md) + * Tabrakan campuran (hash) + * SQL atau NoSQL + * Skema basis data +* Penerjemahan tautan hasil pencampuran menjadi tautan penuh +* API dan rancangan berbasis objek -### Step 4: Scale the design +### Langkah 4: Menyekalakan rancangan -Identify and address bottlenecks, given the constraints. For example, do you need the following to address scalability issues? +Kenali dan tangani kemacetan dalam batasan yang ada. +Sebagai contoh, apakah diperlukan hal-hal berikut untuk menangani masalah skalabilitas? -* Load balancer -* Horizontal scaling -* Caching -* Database sharding +* Pembagi beban (Load balancer) +* Penyekalaan mendatar (Horizontal scaling) +* Penyinggahan (Caching) +* Pemecahan basis data (Database sharding) -Discuss potential solutions and trade-offs. Everything is a trade-off. Address bottlenecks using [principles of scalable system design](#index-of-system-design-topics). +Diskusikan potensi solusi dan kompromi. +Segala sesuatunya adalah hasil kompromi. +Tangani kemacetan menggunakan [prinsip-prinsip perancangan sistem terskala](#indeks-topik-rancangan-sistem). -### Back-of-the-envelope calculations +### Kalkulasi belakang amplop -You might be asked to do some estimates by hand. Refer to the [Appendix](#appendix) for the following resources: +Anda mungkin diminta untuk mengestimasi dengan tangan. +Aculah lampiran pada sumber daya berikut: * [Use back of the envelope calculations](http://highscalability.com/blog/2011/1/26/google-pro-tip-use-back-of-the-envelope-calculations-to-choo.html) -* [Powers of two table](#powers-of-two-table) -* [Latency numbers every programmer should know](#latency-numbers-every-programmer-should-know) +* [Tabel perpangkatan dua](#tabel-perpangkatan-dua) +* [Nilai latensi yang perlu diketahui oleh setiap pemrogram](#nilai-latensi-yang-perlu-diketahui-oleh-setiap-pemrogram]) -### Source(s) and further reading +### Sumber dan bacaan lanjutan -Check out the following links to get a better idea of what to expect: +Periksa tautan-tautan berikut untuk lebih memahami apa yang diharapkan saat wawancara perancangan sistem: * [How to ace a systems design interview](https://www.palantir.com/2011/10/how-to-rock-a-systems-design-interview/) * [The system design interview](http://www.hiredintech.com/system-design) @@ -1580,7 +1588,7 @@ Security is a broad topic. Unless you have considerable experience, a security You'll sometimes be asked to do 'back-of-the-envelope' estimates. For example, you might need to determine how long it will take to generate 100 image thumbnails from disk or how much memory a data structure will take. The **Powers of two table** and **Latency numbers every programmer should know** are handy references. -### Powers of two table +### Tabel Perpangkatan dua ``` Power Exact Value Approx Value Bytes @@ -1599,7 +1607,7 @@ Power Exact Value Approx Value Bytes * [Powers of two](https://en.wikipedia.org/wiki/Power_of_two) -### Latency numbers every programmer should know +### Nilai latensi yang perlu diketahui oleh setiap pemrogram] ``` Latency Comparison Numbers From 0f085482207ddf2cb5f65cb8dffb836974c5721c Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 15:57:56 +0700 Subject: [PATCH 07/32] Translate section 7 System design interview questions with solutions --- README-id.md | 57 ++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/README-id.md b/README-id.md index cbac4ef9..dbba36ce 100644 --- a/README-id.md +++ b/README-id.md @@ -297,67 +297,68 @@ Periksa tautan-tautan berikut untuk lebih memahami apa yang diharapkan saat wawa ## Pertanyaan wawancara rancangan sistem beserta solusinya -> Common system design interview questions with sample discussions, code, and diagrams. +> Pertanyaan umum pada wawancara perancangan sistem beserta contoh diskusi, kode, dan diagram. > -> Solutions linked to content in the `solutions/` folder. +> Solusi terkait dengan konten pada folder `solutions/`. -| Question | | + +| Pertanyaan | | |---|---| -| Design Pastebin.com (or Bit.ly) | [Solution](solutions/system_design/pastebin/README.md) | -| Design the Twitter timeline and search (or Facebook feed and search) | [Solution](solutions/system_design/twitter/README.md) | -| Design a web crawler | [Solution](solutions/system_design/web_crawler/README.md) | -| Design Mint.com | [Solution](solutions/system_design/mint/README.md) | -| Design the data structures for a social network | [Solution](solutions/system_design/social_graph/README.md) | -| Design a key-value store for a search engine | [Solution](solutions/system_design/query_cache/README.md) | -| Design Amazon's sales ranking by category feature | [Solution](solutions/system_design/sales_rank/README.md) | -| Design a system that scales to millions of users on AWS | [Solution](solutions/system_design/scaling_aws/README.md) | -| Add a system design question | [Contribute](#contributing) | +| Perancangan Pastebin.com (or Bit.ly) | [Solusi](solutions/system_design/pastebin/README.md) | +| Perancangan linimasa Twitter and pencarian (atau linimasa dan pencarian Facebook) | [Solusi](solutions/system_design/twitter/README.md) | +| Perancangan perayap web | [Solusi](solutions/system_design/web_crawler/README.md) | +| Perancangan Mint.com | [solusi](solutions/system_design/mint/README.md) | +| Perancangan struktur data untuk jejaring sosial | [Solusi](solutions/system_design/social_graph/README.md) | +| Perancangan gudang tanda-nilai (key-value) untuk mesin pencari | [Solusi](solutions/system_design/query_cache/README.md) | +| Perancangan peringkat penjualan Amazon berdasarkan fitur kategori | [Solusi](solutions/system_design/sales_rank/README.md) | +| Perancangan sistem terskala untuk jutaan pengguna pada AWS | [Solusi](solutions/system_design/scaling_aws/README.md) | +| Tambahkan pertanyaan perancangan sistem | [Kontribusi](#kontribusi) | -### Design Pastebin.com (or Bit.ly) +### Perancangan Pastebin.com (or Bit.ly) -[View exercise and solution](solutions/system_design/pastebin/README.md) +[Lihat latihan dan solusi](solutions/system_design/pastebin/README.md) ![Imgur](http://i.imgur.com/4edXG0T.png) -### Design the Twitter timeline and search (or Facebook feed and search) +### Perancangan linimasa Twitter and pencarian (atau linimasa dan pencarian Facebook) -[View exercise and solution](solutions/system_design/twitter/README.md) +[Lihat latihan dan solusi](solutions/system_design/twitter/README.md) ![Imgur](http://i.imgur.com/jrUBAF7.png) -### Design a web crawler +### Perancangan perayap web -[View exercise and solution](solutions/system_design/web_crawler/README.md) +[Lihat latihan dan solusi](solutions/system_design/web_crawler/README.md) ![Imgur](http://i.imgur.com/bWxPtQA.png) -### Design Mint.com +### Perancangan Mint.com -[View exercise and solution](solutions/system_design/mint/README.md) +[Lihat latihan dan solusi](solutions/system_design/mint/README.md) ![Imgur](http://i.imgur.com/V5q57vU.png) -### Design the data structures for a social network +### Perancangan struktur data untuk jejaring sosial -[View exercise and solution](solutions/system_design/social_graph/README.md) +[Lihat latihan dan solusi](solutions/system_design/social_graph/README.md) ![Imgur](http://i.imgur.com/cdCv5g7.png) -### Design a key-value store for a search engine +### Perancangan gudang tanda-nilai (key-value) untuk mesin pencari -[View exercise and solution](solutions/system_design/query_cache/README.md) +[Lihat latihan dan solusi](solutions/system_design/query_cache/README.md) ![Imgur](http://i.imgur.com/4j99mhe.png) -### Design Amazon's sales ranking by category feature +### Perancangan peringkat penjualan Amazon berdasarkan fitur kategori -[View exercise and solution](solutions/system_design/sales_rank/README.md) +[Lihat latihan dan solusi](solutions/system_design/sales_rank/README.md) ![Imgur](http://i.imgur.com/MzExP06.png) -### Design a system that scales to millions of users on AWS +### Perancangan sistem terskala untuk jutaan pengguna pada AWS -[View exercise and solution](solutions/system_design/scaling_aws/README.md) +[Lihat latihan dan solusi](solutions/system_design/scaling_aws/README.md) ![Imgur](http://i.imgur.com/jj3A5N8.png) From 5ec0b6d4bac45576fbbaee976ba14e74c56faa46 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 16:11:07 +0700 Subject: [PATCH 08/32] Translate section 8 Object-oriented design interview questions with solutions --- README-id.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README-id.md b/README-id.md index dbba36ce..9d208e12 100644 --- a/README-id.md +++ b/README-id.md @@ -299,7 +299,7 @@ Periksa tautan-tautan berikut untuk lebih memahami apa yang diharapkan saat wawa > Pertanyaan umum pada wawancara perancangan sistem beserta contoh diskusi, kode, dan diagram. > -> Solusi terkait dengan konten pada folder `solutions/`. +> Solusi terhubung dengan konten di dalam folder `solutions/`. | Pertanyaan | | @@ -364,22 +364,22 @@ Periksa tautan-tautan berikut untuk lebih memahami apa yang diharapkan saat wawa ## Pertanyaan wawancara rancangan berbasis objek beserta solusinya -> Common object-oriented design interview questions with sample discussions, code, and diagrams. +> Pertanyaan umum pada wawancara perancangan berbasis objek beserta diskusi, code, dan diagram. > -> Solutions linked to content in the `solutions/` folder. +> Solusi terhubung dengan konten di dalam folder `solutions/`. ->**Note: This section is under development** +> **Catatan: Bagian ini dalam proses pengembangan** -| Question | | +| Pertanyaan | | |---|---| -| Design a hash map | [Solution](solutions/object_oriented_design/hash_table/hash_map.ipynb) | -| Design a least recently used cache | [Solution](solutions/object_oriented_design/lru_cache/lru_cache.ipynb) | -| Design a call center | [Solution](solutions/object_oriented_design/call_center/call_center.ipynb) | -| Design a deck of cards | [Solution](solutions/object_oriented_design/deck_of_cards/deck_of_cards.ipynb) | -| Design a parking lot | [Solution](solutions/object_oriented_design/parking_lot/parking_lot.ipynb) | -| Design a chat server | [Solution](solutions/object_oriented_design/online_chat/online_chat.ipynb) | -| Design a circular array | [Contribute](#contributing) | -| Add an object-oriented design question | [Contribute](#contributing) | +| Perancangan peta campuran (hash map) | [Solusi](solutions/object_oriented_design/hash_table/hash_map.ipynb) | +| Perancangan singgahan yang paling jarang digunakan (LRU cache) | [Solusi](solutions/object_oriented_design/lru_cache/lru_cache.ipynb) | +| Perancangan pusat panggilan | [Solusi](solutions/object_oriented_design/call_center/call_center.ipynb) | +| Perancangan tumpukan kartu | [Solusi](solutions/object_oriented_design/deck_of_cards/deck_of_cards.ipynb) | +| Perancangan tempat parkir | [Solusi](solutions/object_oriented_design/parking_lot/parking_lot.ipynb) | +| Perancangan server obrolan | [Solusi](solutions/object_oriented_design/online_chat/online_chat.ipynb) | +| Perancangan larik melingkar (circular array) | [Kontribusi](#kontribusi) | +| Add an object-oriented design question | [Kontribusi](#kontribusi) | ## System design topics: start here From 3cd0f1290ec6b8aa28a9b4fe0d6626c2825fa857 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 16:34:11 +0700 Subject: [PATCH 09/32] Translate section 9 System design topics: start here --- README-id.md | 60 ++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/README-id.md b/README-id.md index 9d208e12..8caf1f0c 100644 --- a/README-id.md +++ b/README-id.md @@ -283,7 +283,7 @@ Tangani kemacetan menggunakan [prinsip-prinsip perancangan sistem terskala](#ind Anda mungkin diminta untuk mengestimasi dengan tangan. Aculah lampiran pada sumber daya berikut: -* [Use back of the envelope calculations](http://highscalability.com/blog/2011/1/26/google-pro-tip-use-back-of-the-envelope-calculations-to-choo.html) +* [Kalkulasi belakang amplop](http://highscalability.com/blog/2011/1/26/google-pro-tip-use-back-of-the-envelope-calculations-to-choo.html) * [Tabel perpangkatan dua](#tabel-perpangkatan-dua) * [Nilai latensi yang perlu diketahui oleh setiap pemrogram](#nilai-latensi-yang-perlu-diketahui-oleh-setiap-pemrogram]) @@ -291,9 +291,9 @@ Aculah lampiran pada sumber daya berikut: Periksa tautan-tautan berikut untuk lebih memahami apa yang diharapkan saat wawancara perancangan sistem: -* [How to ace a systems design interview](https://www.palantir.com/2011/10/how-to-rock-a-systems-design-interview/) -* [The system design interview](http://www.hiredintech.com/system-design) -* [Intro to Architecture and Systems Design Interviews](https://www.youtube.com/watch?v=ZgdS0EUmn70) +* [Cara jago melewati wawancara perancangan sistem](https://www.palantir.com/2011/10/how-to-rock-a-systems-design-interview/) +* [Wawancara perancangan sistem](http://www.hiredintech.com/system-design) +* [Pengantar Arsitektur dan Wawancara Perancangan Sistem](https://www.youtube.com/watch?v=ZgdS0EUmn70) ## Pertanyaan wawancara rancangan sistem beserta solusinya @@ -381,45 +381,45 @@ Periksa tautan-tautan berikut untuk lebih memahami apa yang diharapkan saat wawa | Perancangan larik melingkar (circular array) | [Kontribusi](#kontribusi) | | Add an object-oriented design question | [Kontribusi](#kontribusi) | -## System design topics: start here +## Topik perancangan sistem: Mulai dari sini -New to system design? +Baru mengenal perancangan sistem? -First, you'll need a basic understanding of common principles, learning about what they are, how they are used, and their pros and cons. +Pertama-tama, kita perlu memahami prinsip-prinsip umum, belajar apa saja prinsip-prinsip tersebut, bagaimana penggunaannya, dan kelebihan dan kekurangannya. -### Step 1: Review the scalability video lecture +### Langkah 1: Tonton kuliah video skalabilitas -[Scalability Lecture at Harvard](https://www.youtube.com/watch?v=-W9F__D3oY4) +[Kuliah skalabilitas di Harvard](https://www.youtube.com/watch?v=-W9F__D3oY4) -* Topics covered: - * Vertical scaling - * Horizontal scaling - * Caching - * Load balancing - * Database replication - * Database partitioning +* Topik yang dicakup: + * Penyekalaan tegak lurus (vertical scaling) + * Penyekalan mendatar (horizontal scaling) + * Penyinggahan (caching) + * Pembagian beban (load balancing) + * Pereplikasian basis data (database replication) + * Penyekatan basis data (database partitioning) -### Step 2: Review the scalability article +### Langkah 2: Baca artikel skalabilitas -[Scalability](http://www.lecloud.net/tagged/scalability/chrono) +[Skalabilitas untuk orang-orangan](http://www.lecloud.net/tagged/scalability/chrono) -* Topics covered: - * [Clones](http://www.lecloud.net/post/7295452622/scalability-for-dummies-part-1-clones) - * [Databases](http://www.lecloud.net/post/7994751381/scalability-for-dummies-part-2-database) - * [Caches](http://www.lecloud.net/post/9246290032/scalability-for-dummies-part-3-cache) - * [Asynchronism](http://www.lecloud.net/post/9699762917/scalability-for-dummies-part-4-asynchronism) +* Topik yang dicakup: + * [Klona](http://www.lecloud.net/post/7295452622/scalability-for-dummies-part-1-clones) + * [Basis data](http://www.lecloud.net/post/7994751381/scalability-for-dummies-part-2-database) + * [Singgahan](http://www.lecloud.net/post/9246290032/scalability-for-dummies-part-3-cache) + * [Asinkron](http://www.lecloud.net/post/9699762917/scalability-for-dummies-part-4-asynchronism) -### Next steps +### Langkah selanjutnya -Next, we'll look at high-level trade-offs: +Selanjutnya kita akan melihat kompromi pada tingkat tinggi: -* **Performance** vs **scalability** -* **Latency** vs **throughput** -* **Availability** vs **consistency** +* **Kinerja** vs **skalabilitas** +* **Latensi** vs **lewatan** +* **Ketersediaan** vs **konsistensi** -Keep in mind that **everything is a trade-off**. +Perlu diingat bahwa **segala sesuatunya adalah hasil kompromi**. -Then we'll dive into more specific topics such as DNS, CDNs, and load balancers. +Selanjutnya kita akan mempelajari lebih dalam topik-topik tertentu seperti DNS, CDNs, dan penyeimbang beban. ## Performance vs scalability From 48ded6fd00a72477a796091e9505e8581775194c Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 16:50:14 +0700 Subject: [PATCH 10/32] Translate section 10 Performance vs scalability --- README-id.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README-id.md b/README-id.md index 8caf1f0c..69776d9c 100644 --- a/README-id.md +++ b/README-id.md @@ -421,19 +421,21 @@ Perlu diingat bahwa **segala sesuatunya adalah hasil kompromi**. Selanjutnya kita akan mempelajari lebih dalam topik-topik tertentu seperti DNS, CDNs, dan penyeimbang beban. -## Performance vs scalability +## Kinerja vs skalabilitas -A service is **scalable** if it results in increased **performance** in a manner proportional to resources added. Generally, increasing performance means serving more units of work, but it can also be to handle larger units of work, such as when datasets grow.1 +Sebuah layanan disebut terskala jika layanan tersebut menghasilkan peningkatan kinerja secara proposional terhadap pertambahan sumber daya. +Secara umum, peningkatan kinerja berarti pertambahan unit kerja yang bisa diselesaikan. +kemungkinan lainnya adalah kemampuan menangani unit kerja ukurannya yang lebih besar, contohnya ketika himpunan data berkembang.1 -Another way to look at performance vs scalability: +Cara lain melihat kinerja vs skalabilitas: -* If you have a **performance** problem, your system is slow for a single user. -* If you have a **scalability** problem, your system is fast for a single user but slow under heavy load. +* Jika layanan terkena masalah kinerja, sistem terasa lambat oleh pengguna tunggal. +* Jika layanan terkena masalah skalabilitas, sistem terasa cepat oleh pengguna tunggal tetapi menjadi lambat ketika di bawah tekanan. -### Source(s) and further reading +### Sumber dan bacaan lanjutan -* [A word on scalability](http://www.allthingsdistributed.com/2006/03/a_word_on_scalability.html) -* [Scalability, availability, stability, patterns](http://www.slideshare.net/jboner/scalability-availability-stability-patterns/) +* [Sepatah kata untuk skalabilitas](http://www.allthingsdistributed.com/2006/03/a_word_on_scalability.html) +* [Skalabilitas, ketersediaan, stabilitas, pola](http://www.slideshare.net/jboner/scalability-availability-stability-patterns/) ## Latency vs throughput From 2d8dda339085a991c34d04955315b83d1e9fc2eb Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 16:53:27 +0700 Subject: [PATCH 11/32] Fix appropriate form for Menyekalakan --- README-id.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-id.md b/README-id.md index 69776d9c..d0139e05 100644 --- a/README-id.md +++ b/README-id.md @@ -264,7 +264,7 @@ Sebagai contoh, jika Anda diminta [merancang layanan penyingkat tautan](solution * Penerjemahan tautan hasil pencampuran menjadi tautan penuh * API dan rancangan berbasis objek -### Langkah 4: Menyekalakan rancangan +### Langkah 4: Skalakan rancangan Kenali dan tangani kemacetan dalam batasan yang ada. Sebagai contoh, apakah diperlukan hal-hal berikut untuk menangani masalah skalabilitas? From 82658f0a130ac83659387936c792543fddb319a6 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 17:00:00 +0700 Subject: [PATCH 12/32] Translate section 11 Latency vs throughput --- README-id.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README-id.md b/README-id.md index d0139e05..e63885a5 100644 --- a/README-id.md +++ b/README-id.md @@ -437,17 +437,17 @@ Cara lain melihat kinerja vs skalabilitas: * [Sepatah kata untuk skalabilitas](http://www.allthingsdistributed.com/2006/03/a_word_on_scalability.html) * [Skalabilitas, ketersediaan, stabilitas, pola](http://www.slideshare.net/jboner/scalability-availability-stability-patterns/) -## Latency vs throughput +## Latensi vs lewatan -**Latency** is the time to perform some action or to produce some result. +**Latensi** adalah waktu yang diperlukan untuk melakukan suatu aksi atau mendapatkan hasil. -**Throughput** is the number of such actions or results per unit of time. +**Lewatan** adalah jumlah aksi atau hasil yang didapatkan per satuan waktu. -Generally, you should aim for **maximal throughput** with **acceptable latency**. +Secara umum, kita menargetkan **lewatan yang maksimal** dengan **latensi yang dapat diterima**. -### Source(s) and further reading +### Sumber dan bacaan lanjutan -* [Understanding latency vs throughput](https://community.cadence.com/cadence_blogs_8/b/sd/archive/2010/09/13/understanding-latency-vs-throughput) +* [Memahami latensi vs lewatan](https://community.cadence.com/cadence_blogs_8/b/sd/archive/2010/09/13/understanding-latency-vs-throughput) ## Availability vs consistency From 5da4418d780404c19b980375fbdf8eede3d8cb76 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 17:31:40 +0700 Subject: [PATCH 13/32] Translate section 12 Availability vs consistency --- README-id.md | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/README-id.md b/README-id.md index e63885a5..de9dd05d 100644 --- a/README-id.md +++ b/README-id.md @@ -449,39 +449,42 @@ Secara umum, kita menargetkan **lewatan yang maksimal** dengan **latensi yang da * [Memahami latensi vs lewatan](https://community.cadence.com/cadence_blogs_8/b/sd/archive/2010/09/13/understanding-latency-vs-throughput) -## Availability vs consistency +## Ketersediaan vs konsistensi -### CAP theorem +### Teorema CAP


- Source: CAP theorem revisited + Sumber: tinjauan kembali teorema CAP

-In a distributed computer system, you can only support two of the following guarantees: +Dalam sistem komputer terdistribusi, kita hanya dapat mendukung dua dari jaminan berikut: -* **Consistency** - Every read receives the most recent write or an error -* **Availability** - Every request receives a response, without guarantee that it contains the most recent version of the information -* **Partition Tolerance** - The system continues to operate despite arbitrary partitioning due to network failures +* **Konsistensi (Consistency)** - Setiap operasi baca menerima tulisan terbaru atau error +* **Ketersediaan (Availability)** - Setiap permintaan mendapat tanggapan, tanpa jaminan tanggapan tersebut berisi informasi terbaru +* **Toleransi Penyekatan (Partition Tolerance)** - Sistem tetap bekerja meskipun terjadi penyekatan yang berubah-ubah karena kegagalan jaringan -*Networks aren't reliable, so you'll need to support partition tolerance. You'll need to make a software tradeoff between consistency and availability.* +*Jaringan tidak dapat diandalkan sehingga kita perlu mendukung toleransi penyekatan.* +*Kita perlu memilih kompromi perangkat lunak antara konsistensi dan ketersediaan.* -#### CP - consistency and partition tolerance +#### CP - konsistensi dan toleransi penyekatan -Waiting for a response from the partitioned node might result in a timeout error. CP is a good choice if your business needs require atomic reads and writes. +Menunggu tanggapan dari mesin yang tersekat mungkin akan gagal karena kehabisan waktu. +CP adalah kompromi yang baik jika bisnis mempunyai kebutuhan baca dan tulis yang bersifat atom. -#### AP - availability and partition tolerance +#### AP - ketersediaan dan toleransi penyekatan -Responses return the most recent version of the data available on a node, which might not be the latest. Writes might take some time to propagate when the partition is resolved. +Tanggapan berisi data terakhir yang tersedia pada sebuah mesin dimana data tersebut mungkin bukan data terbaru. +Tulisan bakal memerlukan beberapa saat untuk tersebar ke mesin lain ketika masalah penyekatan selesai. -AP is a good choice if the business needs allow for [eventual consistency](#eventual-consistency) or when the system needs to continue working despite external errors. +AP adalah kompromi yang baik jika kebutuhan bisnis mengijinkan untuk [konsistensi akan datang](#konsistensi-akan-datang-eventual-consistency) atau ketika sistem perlu tetap bekerja walaupun ada kesalahan pihak luar. -### Source(s) and further reading +### Sumber dan bacaan lanjutan -* [CAP theorem revisited](http://robertgreiner.com/2014/08/cap-theorem-revisited/) -* [A plain english introduction to CAP theorem](http://ksat.me/a-plain-english-introduction-to-cap-theorem) -* [CAP FAQ](https://github.com/henryr/cap-faq) +* [Tinjauan kembali teorema CAP](http://robertgreiner.com/2014/08/cap-theorem-revisited/) +* [Pengantar teoream CAP dalam bahasa inggris polos](http://ksat.me/a-plain-english-introduction-to-cap-theorem) +* [Tanya jawab CAP](https://github.com/henryr/cap-faq) ## Consistency patterns @@ -493,7 +496,7 @@ After a write, reads may or may not see it. A best effort approach is taken. This approach is seen in systems such as memcached. Weak consistency works well in real time use cases such as VoIP, video chat, and realtime multiplayer games. For example, if you are on a phone call and lose reception for a few seconds, when you regain connection you do not hear what was spoken during connection loss. -### Eventual consistency +### Konsistensi akan datang (eventual consistency) After a write, reads will eventually see it (typically within milliseconds). Data is replicated asynchronously. From e41292440d49737e12f9de0c836ea5a12727e8a0 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 18:05:42 +0700 Subject: [PATCH 14/32] Translate section 13 Consistency patterns --- README-id.md | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/README-id.md b/README-id.md index de9dd05d..fcb37157 100644 --- a/README-id.md +++ b/README-id.md @@ -486,31 +486,40 @@ AP adalah kompromi yang baik jika kebutuhan bisnis mengijinkan untuk [konsistens * [Pengantar teoream CAP dalam bahasa inggris polos](http://ksat.me/a-plain-english-introduction-to-cap-theorem) * [Tanya jawab CAP](https://github.com/henryr/cap-faq) -## Consistency patterns +## Pola konsistensi -With multiple copies of the same data, we are faced with options on how to synchronize them so clients have a consistent view of the data. Recall the definition of consistency from the [CAP theorem](#cap-theorem) - Every read receives the most recent write or an error. +Dengan adanya salinan ganda data, kita dihadapkan dengan pilihan cara untuk menyinkronkan salinan tersebut. +Salinan data perlu disinkronkan sehingga pengguna memiliki pandangan yang konsisten terhadap data. +Ingat kembali definisi konsistensi dari [teorema CAP](#teorema-cap) - Setiap operasi baca menerima tulisan terbaru atau gagal. -### Weak consistency +### Konsistensi lemah -After a write, reads may or may not see it. A best effort approach is taken. +Setelah operasi tulis, operasi baca belum tentu melihat hasil operasi tulis. +Pendekatan usaha terbaik perlu diambil. -This approach is seen in systems such as memcached. Weak consistency works well in real time use cases such as VoIP, video chat, and realtime multiplayer games. For example, if you are on a phone call and lose reception for a few seconds, when you regain connection you do not hear what was spoken during connection loss. +Pendekatan ini bisa dilihat pada sistem contohnya Memcached. +Konsistensi lemah bekerja dengan baik pada sistem kasus penggunaan waktu nyata contohnya VoIP, obrolan video, dan permainan banyak pemain waktu nyata. +Sebagai contoh, jika kita dalam panggilan telpon dan kehilangan sinyal untuk beberapa detik, kita tidak akan mendengar pembicaraan yang terjadi ketika koneksi terputus. ### Konsistensi akan datang (eventual consistency) -After a write, reads will eventually see it (typically within milliseconds). Data is replicated asynchronously. +Setelah operasi tulis, operasi baca akan melihat pada waktu yang akan datang (biasanya dalam mili seconds). +Data direplikasi secara asinkron. -This approach is seen in systems such as DNS and email. Eventual consistency works well in highly available systems. +Pendekatan ini terlihat di sistem contohnya DNS dan email. +Konsistensi akan datang bekerja dengan baik di sistem yang sangat tersedia. -### Strong consistency +### Konsisten kuat -After a write, reads will see it. Data is replicated synchronously. +Setelah operasi tulis, operasi baca akan langsung melihatnya. +Data direplikasi secara sinkron. -This approach is seen in file systems and RDBMSes. Strong consistency works well in systems that need transactions. +Pendekatan ini terlihat pada sistem pemberkasan dan RDBMS. +Konsistensi kuat bekerja dengan baik di sistem yang membutuhkan transaksi. -### Source(s) and further reading +### Sumber dan bacaan tambahan -* [Transactions across data centers](http://snarfed.org/transactions_across_datacenters_io.html) +* [Transaksi lintas pusat data](http://snarfed.org/transactions_across_datacenters_io.html) ## Availability patterns From d235b85ac41b4692b6ad5d247003a9be6e2b41ea Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 23:25:18 +0700 Subject: [PATCH 15/32] Translate section 14 Availability patterns --- README-id.md | 87 +++++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/README-id.md b/README-id.md index fcb37157..4deccd2e 100644 --- a/README-id.md +++ b/README-id.md @@ -521,87 +521,92 @@ Konsistensi kuat bekerja dengan baik di sistem yang membutuhkan transaksi. * [Transaksi lintas pusat data](http://snarfed.org/transactions_across_datacenters_io.html) -## Availability patterns +## Pola ketersediaan -There are two main patterns to support high availability: **fail-over** and **replication**. +Ada dua pola utama untuk mendukung ketersediaan tinggi: **fail-over** dan **replikasi**. ### Fail-over -#### Active-passive +#### Aktif-pasif -With active-passive fail-over, heartbeats are sent between the active and the passive server on standby. If the heartbeat is interrupted, the passive server takes over the active's IP address and resumes service. +Dengan mekanisme fail-over aktif-pasif, denyut nadi dikirim antara server aktif dan pasif dalam keadaan siaga. +Jika pengiriman denyut nadi terinterupsi, server pasif akan mengambil alih alamat IP yang aktif dan meneruskan layanan. -The length of downtime is determined by whether the passive server is already running in 'hot' standby or whether it needs to start up from 'cold' standby. Only the active server handles traffic. +Lamanya waktu penghentian ditentukan berdasarkan kondisi server pasif apakah dalam status siaga 'panas' atau siaga 'dingin'. +Hanya server yang aktif yang melayani permintaan. -Active-passive failover can also be referred to as master-slave failover. +Fail-over aktif-pasif disebut juga dengan istilah failover _master-slave_. -#### Active-active +#### Aktif-aktif -In active-active, both servers are managing traffic, spreading the load between them. +Dalam aktif-aktif, kedua server mengelola layanan secara berbarengan, menyebarkan beban kerja diantara mereka. -If the servers are public-facing, the DNS would need to know about the public IPs of both servers. If the servers are internal-facing, application logic would need to know about both servers. +Jika server terhubung langsung ke internet, DNS perlu mengetahui IP publik kedua server. +Jika server terhubung ke jaringan internal, logik pada aplikasi perlu mengetahui alamat IP kedua server. -Active-active failover can also be referred to as master-master failover. +Failover aktif-aktif disebut juga dengan istilah failover _master-master_. -### Disadvantage(s): failover +### Kerugian: failover -* Fail-over adds more hardware and additional complexity. -* There is a potential for loss of data if the active system fails before any newly written data can be replicated to the passive. +* Fail-over meningkatkan jumlah perangkat keras yang dibutuhkan dan kompleksitas. +* Ada potensi kehilangan data ketika sistem aktif gagal pada ada data terbaru yang sudah berhasil ditulis di server aktif tetapi belum direplikasi ke server pasif. -### Replication +### Replikasi #### Master-slave and master-master -This topic is further discussed in the [Database](#database) section: +Topik ini dibahas lebih lanjut di bagian [Basis data](#basis-data): -* [Master-slave replication](#master-slave-replication) -* [Master-master replication](#master-master-replication) +* [Replikasi Master-slave](#replikasi-master-slave) +* [Replikasi Master-master](#replikasi-master-master) -### Availability in numbers +### Ketersediaan dalam angka -Availability is often quantified by uptime (or downtime) as a percentage of time the service is available. Availability is generally measured in number of 9s--a service with 99.99% availability is described as having four 9s. +Ketersediaan seringnya dinyatakan berdasarkan waktu nyala (atau waktu padam) sebagai persentasi dari waktu ketersediaan layanan. +Ketersediaan umumnya diukur di dalam angka 9s. +Sebuah layanan dengan tingkat ketersediaan 99.99% digambarkan sebagai layanan yang memiliki empat 9. -#### 99.9% availability - three 9s +#### Ketersediaan 99.9% - tiga 9 -| Duration | Acceptable downtime| +| Durasi | Waktu padam yang terterima| |---------------------|--------------------| -| Downtime per year | 8h 45min 57s | -| Downtime per month | 43m 49.7s | -| Downtime per week | 10m 4.8s | -| Downtime per day | 1m 26.4s | +| Waktu padam per tahun | 8h 45min 57s | +| Waktu padam per bulan | 43m 49.7s | +| Waktu padam per minggu | 10m 4.8s | +| Waktu padam per hari | 1m 26.4s | -#### 99.99% availability - four 9s +#### Ketersediaan 99.99% - empat 9 -| Duration | Acceptable downtime| +| Durasi | Waktu padam yang terterima| |---------------------|--------------------| -| Downtime per year | 52min 35.7s | -| Downtime per month | 4m 23s | -| Downtime per week | 1m 5s | -| Downtime per day | 8.6s | +| Waktu padam per tahun | 52min 35.7s | +| Waktu padam per bulan | 4m 23s | +| Waktu padam per minggu | 1m 5s | +| Waktu padam per hari | 8.6s | -#### Availability in parallel vs in sequence +#### Ketersediaan sejajar vs berurutan -If a service consists of multiple components prone to failure, the service's overall availability depends on whether the components are in sequence or in parallel. +Jika suatu layanan terdiri dari beberapa komponen yang rentan mengalami kegagalan, ketersediaan layanan secara keseluruhan tergantung apakah komponen tersebut sejajar atau berurutan. -###### In sequence +###### Berurutan -Overall availability decreases when two components with availability < 100% are in sequence: +Ketersedian secara keseluruhan berkurang ketika dua komponen dengan tingkat ketersediaan kurang dari 100% bekerja berurutan: ``` -Availability (Total) = Availability (Foo) * Availability (Bar) +Ketersedian (Total) = Ketersediaan (Foo) * Ketersedian (Bar) ``` -If both `Foo` and `Bar` each had 99.9% availability, their total availability in sequence would be 99.8%. +Jika `Foo` dan `Bar` keduanya masing-masing memiliki 99.9% tingkat ketersediaan, maka total tingkat ketersediaan keduanya berurutan menjadi 99.8%. -###### In parallel +###### Sejajar -Overall availability increases when two components with availability < 100% are in parallel: +Ketersediaan secara keseluruhan meningkat ketika dua komponen dengan tingkat tersediaan kurang dari 100% bekerja sejajar: ``` -Availability (Total) = 1 - (1 - Availability (Foo)) * (1 - Availability (Bar)) +Ketersediaan (Total) = 1 - (1 - Ketersediaan (Foo)) * (1 - Ketersediaan (Bar)) ``` -If both `Foo` and `Bar` each had 99.9% availability, their total availability in parallel would be 99.9999%. +Jika `Foo` dan `Bar` keduanya masing-masing memiliki tingkat ketersediaan sebesar 99.9%, maka total tingkat ketersediaan sejajar keduanya adalah 99.9999%. ## Domain name system From 807422e2359e91b9aacb303f128b669a442e3932 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 23:25:54 +0700 Subject: [PATCH 16/32] Translate section 15 Domain Name System --- README-id.md | 50 +++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/README-id.md b/README-id.md index 4deccd2e..9f81ec5a 100644 --- a/README-id.md +++ b/README-id.md @@ -613,38 +613,42 @@ Jika `Foo` dan `Bar` keduanya masing-masing memiliki tingkat ketersediaan sebesa


- Source: DNS security presentation + Sumber: presentasi keamanan DNS

-A Domain Name System (DNS) translates a domain name such as www.example.com to an IP address. +Domain Name System (DNS) menerjemahkan nama suatu domain seperti www.example.com menjadi alamaat IP. -DNS is hierarchical, with a few authoritative servers at the top level. Your router or ISP provides information about which DNS server(s) to contact when doing a lookup. Lower level DNS servers cache mappings, which could become stale due to DNS propagation delays. DNS results can also be cached by your browser or OS for a certain period of time, determined by the [time to live (TTL)](https://en.wikipedia.org/wiki/Time_to_live). +DNS bersifat hierarki, dengan beberapa server berkuasa di level puncak. +Router atau ISP yang kita gunakan menyediakan informasi mengenai server DNS yang dihubungi ketika melakukan pencarian. +Server DNS tingkat lebih rendah menyinggahkan pemetaan yang mungkin tidak mutakhir karena penundaan perambatan DNS. +Hasil DNS bisa juga disinggahkan oleh peramban atau sistem operasi selama periode tertentu yang ditentukan oleh [masa berlaku DNS](https://en.wikipedia.org/wiki/Time_to_live). -* **NS record (name server)** - Specifies the DNS servers for your domain/subdomain. -* **MX record (mail exchange)** - Specifies the mail servers for accepting messages. -* **A record (address)** - Points a name to an IP address. -* **CNAME (canonical)** - Points a name to another name or `CNAME` (example.com to www.example.com) or to an `A` record. +* **NS record (name server)** - Menentukan server DNS untuk domain/subdomain tersebut. +* **MX record (mail exchange)** - Menentukan server email untuk penerimaan pesan. +* **A record (address)** - Mengarahkan sebuah nama ke alamat IP. +* **CNAME (canonical)** - Mengarahkan sebuah nama ke nama lain. Nama lain tersebut bisa berupa `CNAME` atau `A` (Contohnya example.com diarahkan ke www.example.com). -Services such as [CloudFlare](https://www.cloudflare.com/dns/) and [Route 53](https://aws.amazon.com/route53/) provide managed DNS services. Some DNS services can route traffic through various methods: +Layanan seperti [CloudFlare](https://www.cloudflare.com/dns/) dan [Route 53](https://aws.amazon.com/route53/) menyediakan layanan DNS terkelola. +Beberapa layanan DNS mampu mengarahkan lalu lintas melalui berbagai metode: * [Weighted round robin](https://www.g33kinfo.com/info/round-robin-vs-weighted-round-robin-lb) - * Prevent traffic from going to servers under maintenance - * Balance between varying cluster sizes - * A/B testing -* Latency-based -* Geolocation-based + * Mencegah lalu lintas bergerak menuju server yang sedang dalam pemeliharaan + * Menyeimbangkan antara berbagai ukuran gugusan + * Pengujian A/B +* Berdasarkan latensi +* Berdasarkan geolokasi -### Disadvantage(s): DNS +### Kekurangan: DNS -* Accessing a DNS server introduces a slight delay, although mitigated by caching described above. -* DNS server management could be complex and is generally managed by [governments, ISPs, and large companies](http://superuser.com/questions/472695/who-controls-the-dns-servers/472729). -* DNS services have recently come under [DDoS attack](http://dyn.com/blog/dyn-analysis-summary-of-friday-october-21-attack/), preventing users from accessing websites such as Twitter without knowing Twitter's IP address(es). +* Pengaksesan server DNS menambahkan sedikit penundaan, walaupun sudah diperingan menggunakan singgahan seperti penjelasan di atas. +* Pengelolaan server DNS bisa jadi rumit dan umumnya dikelola oleh [pemerintah, penyedia jasa internet, dan perusahaan besar](http://superuser.com/questions/472695/who-controls-the-dns-servers/472729). +* Layanan DNS belakangan ini mengalami [serangan DDoS](http://dyn.com/blog/dyn-analysis-summary-of-friday-october-21-attack/), preventing users from accessing websites such as Twitter without knowing Twitter's IP address(es). -### Source(s) and further reading +### Sumber dan bacaan lanjutan -* [DNS architecture](https://technet.microsoft.com/en-us/library/dd197427(v=ws.10).aspx) +* [Arsitektur DNS](https://technet.microsoft.com/en-us/library/dd197427(v=ws.10).aspx) * [Wikipedia](https://en.wikipedia.org/wiki/Domain_Name_System) -* [DNS articles](https://support.dnsimple.com/categories/dns/) +* [Artikel tentang DNS](https://support.dnsimple.com/categories/dns/) ## Content delivery network @@ -835,7 +839,7 @@ Systems such as [Consul](https://www.consul.io/docs/index.html), [Etcd](https:// * [Introduction to Zookeeper](http://www.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper) * [Here's what you need to know about building microservices](https://cloudncode.wordpress.com/2016/07/22/msa-getting-started/) -## Database +## Basis data

@@ -856,7 +860,7 @@ A relational database like SQL is a collection of data items organized in tables There are many techniques to scale a relational database: **master-slave replication**, **master-master replication**, **federation**, **sharding**, **denormalization**, and **SQL tuning**. -#### Master-slave replication +#### Replikasi master-slave The master serves reads and writes, replicating writes to one or more slaves, which serve only reads. Slaves can also replicate to additional slaves in a tree-like fashion. If the master goes offline, the system can continue to operate in read-only mode until a slave is promoted to a master or a new master is provisioned. @@ -871,7 +875,7 @@ The master serves reads and writes, replicating writes to one or more slaves, wh * Additional logic is needed to promote a slave to a master. * See [Disadvantage(s): replication](#disadvantages-replication) for points related to **both** master-slave and master-master. -#### Master-master replication +#### Replikasi master-master Both masters serve reads and writes and coordinate with each other on writes. If either master goes down, the system can continue to operate with both reads and writes. From f2378251c7b78392c30efe68616876ccedb7fce5 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Thu, 6 Feb 2020 23:56:40 +0700 Subject: [PATCH 17/32] Translate section 16 Content delivery network --- README-id.md | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/README-id.md b/README-id.md index 9f81ec5a..36445ff8 100644 --- a/README-id.md +++ b/README-id.md @@ -655,40 +655,49 @@ Beberapa layanan DNS mampu mengarahkan lalu lintas melalui berbagai metode:


- Source: Why use a CDN + Sumber: Mengapa menggunakan CDN

-A content delivery network (CDN) is a globally distributed network of proxy servers, serving content from locations closer to the user. Generally, static files such as HTML/CSS/JS, photos, and videos are served from CDN, although some CDNs such as Amazon's CloudFront support dynamic content. The site's DNS resolution will tell clients which server to contact. +Content delivery network (CDN) adalah jaringan server proksi yang tersebar secara global, menyuguhkan konten dari lokasi terdekat ke pengguna. +Umumnya, berkas statis seperti HTML/CSS/JS, foto, dan video disuguhkan oleh CDN, meskipun beberapa CDN seperti Amazon CloudFront mendukung konten dinamis. +Resolusi DNS situs akan memberitahu pengguna server mana yang dihubungi. -Serving content from CDNs can significantly improve performance in two ways: +Penyuguhan konten melalui CDN bisa meningkatkan kinerja secara signifikan melalui dua cara: -* Users receive content at data centers close to them -* Your servers do not have to serve requests that the CDN fulfills +* Pengguna menerima konten dari pusat data terdekat ke mereka +* Server kita tidak perlu melayani permintaan yang dipenuhi oleh CDN -### Push CDNs +### CDN setor -Push CDNs receive new content whenever changes occur on your server. You take full responsibility for providing content, uploading directly to the CDN and rewriting URLs to point to the CDN. You can configure when content expires and when it is updated. Content is uploaded only when it is new or changed, minimizing traffic, but maximizing storage. +CDN setor menerima konten baru kapanpun perubahan terjadi di server kita. +Kita bertanggungjawab penuh untuk menyediakan konten, mengunggah langsung ke CDN dan menulis ulang alamat URL supaya mengarah ke CDN. +Kita dapat mengkonfigurasi kapan konten kedaluarsa dan kapan konten diperbarui. +Konten diunggah hanya ketika ada konten baru atau konten berubah untuk meminimalkan lalu lintas dan memaksimalkan penyimpanan. -Sites with a small amount of traffic or sites with content that isn't often updated work well with push CDNs. Content is placed on the CDNs once, instead of being re-pulled at regular intervals. +Situs dengan lalu lintas kecil atau situs dengan konten yang tidak sering diperbarui bekerja baik dengan CDN setor. +Konten ditempatkan pada CDN sekali, daripada ditarik ulang secara berkala. -### Pull CDNs +### CDN tarik -Pull CDNs grab new content from your server when the first user requests the content. You leave the content on your server and rewrite URLs to point to the CDN. This results in a slower request until the content is cached on the CDN. +CDN tarik mengambil konten baru dari server kita ketika ada user pertama yang meminta konten tersebut. +Kita menyimpan konten di server kita dan menulis ulang URL supaya mengarah ke CDN. +Mekanisme ini menghasilkan permintaan yang lebih lambat sampai konten singgah di CDN. -A [time-to-live (TTL)](https://en.wikipedia.org/wiki/Time_to_live) determines how long content is cached. Pull CDNs minimize storage space on the CDN, but can create redundant traffic if files expire and are pulled before they have actually changed. +[Masa berlaku](https://en.wikipedia.org/wiki/Time_to_live) menentukan berapa lama konten akan singgah. +CDN tarik meminimalkan ruang penyimpanan pada CDN, tetapi bisa menciptakan lalu lintas yang berlebihan jika berkas kedaluarsa dan ditarik sebelum berkas tersebut diubah. -Sites with heavy traffic work well with pull CDNs, as traffic is spread out more evenly with only recently-requested content remaining on the CDN. +Situs dengan lalu lintas padat bekerja baik dengan CDN tarik, sebagaimana lalu lintas tersebar secara merata dengan konten yang baru diminta saja yang tersimpan di CDN. -### Disadvantage(s): CDN +### Kekurangan: CDN -* CDN costs could be significant depending on traffic, although this should be weighed with additional costs you would incur not using a CDN. -* Content might be stale if it is updated before the TTL expires it. -* CDNs require changing URLs for static content to point to the CDN. +* Biaya CDN bisa signifikan tergantung kepadatan lalu lintas, meskipun perlu ditimbang biaya tambahan yang akan ditanggung tanpa CDN. +* Konten mungkin kedaluarsa jika konten diupdate sebelum masa berlaku habis. +* CDN mengharuskan perubahan alamat URL sehingga konten statis mengarah ke CDN. -### Source(s) and further reading +### Sumber dan bacaan lanjutan -* [Globally distributed content delivery](https://figshare.com/articles/Globally_distributed_content_delivery/6605972) -* [The differences between push and pull CDNs](http://www.travelblogadvice.com/technical/the-differences-between-push-and-pull-cdns/) +* [Pengiriman konten terdistribusi secara global](https://figshare.com/articles/Globally_distributed_content_delivery/6605972) +* [Perbedaan antara CDN setor dan tarik](http://www.travelblogadvice.com/technical/the-differences-between-push-and-pull-cdns/) * [Wikipedia](https://en.wikipedia.org/wiki/Content_delivery_network) ## Load balancer From dcb9b6e5ce0d68639e3ac7f97af285d7d02c3014 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Fri, 7 Feb 2020 09:11:20 +0700 Subject: [PATCH 18/32] Translate section 17 Load balancer --- README-id.md | 99 +++++++++++++++++++++++++++++----------------------- 1 file changed, 55 insertions(+), 44 deletions(-) diff --git a/README-id.md b/README-id.md index 36445ff8..64d1c4fb 100644 --- a/README-id.md +++ b/README-id.md @@ -700,75 +700,86 @@ Situs dengan lalu lintas padat bekerja baik dengan CDN tarik, sebagaimana lalu l * [Perbedaan antara CDN setor dan tarik](http://www.travelblogadvice.com/technical/the-differences-between-push-and-pull-cdns/) * [Wikipedia](https://en.wikipedia.org/wiki/Content_delivery_network) -## Load balancer +## Penyeimbang beban


- Source: Scalable system design patterns + Sumber: Pola perancangan sistem terskala

-Load balancers distribute incoming client requests to computing resources such as application servers and databases. In each case, the load balancer returns the response from the computing resource to the appropriate client. Load balancers are effective at: +Penyeimbang beban membagikan permintaan klien yang masuk ke sumber daya komputasi seperti server aplikasi dan basis data. +Dalam setiap kasus, penyeimbang beban mengembalikan tanggapan dari sumber daya komputasi ke klien yang sesuai. +Penyeimbang beban efektif dalam hal: -* Preventing requests from going to unhealthy servers -* Preventing overloading resources -* Helping eliminate single points of failure +* Mencegah permintaan dilayani oleh server yang tidak sehat +* Mencegah sumber daya kelebihan beban +* Membantu menghilangkan titik kegagalan -Load balancers can be implemented with hardware (expensive) or with software such as HAProxy. +Penyeimbang beban bisa diimplementasikan menggunakan perangkat keras (mahal) atau dengan perangkat lunak seperti HAProxy. -Additional benefits include: +Yang termasuk dalam manfaat tambahan: -* **SSL termination** - Decrypt incoming requests and encrypt server responses so backend servers do not have to perform these potentially expensive operations - * Removes the need to install [X.509 certificates](https://en.wikipedia.org/wiki/X.509) on each server -* **Session persistence** - Issue cookies and route a specific client's requests to same instance if the web apps do not keep track of sessions +* **Terminasi SSL** - Mendekripsi permintaan yang datang dan mengenkripsi tanggapan server sehingga server bagian belakang tidak perlu melakukan operasi yang berpotensi mahal ini + * Menghilangkan kebutuhan menginstall [sertifikat x.509](https://en.wikipedia.org/wiki/X.509) pada setiap server +* **Persistensi sesi** - Mengeluarkan kuki dan mengarahkan permintaan klien yang spesifik ke server yang sama jika aplikasi web tidak melakukan pelacakan sesi -To protect against failures, it's common to set up multiple load balancers, either in [active-passive](#active-passive) or [active-active](#active-active) mode. +Untuk menjaga dari kegagalan, biasa dilakukan pendirian penyeimbang beban berganda, baik itu mode [aktif-pasif](#aktif-pasif) atau [aktif-aktif](#aktif-aktif). -Load balancers can route traffic based on various metrics, including: +Penyeimbang beban dapat mengarahkan lalu linta berdasarkan berbagai metrik termasuk: -* Random -* Least loaded -* Session/cookies -* [Round robin or weighted round robin](https://www.g33kinfo.com/info/round-robin-vs-weighted-round-robin-lb) -* [Layer 4](#layer-4-load-balancing) -* [Layer 7](#layer-7-load-balancing) +* Sembarang +* Beban tersedikit +* Sesi/kuki +* [Bergantian atau bergantian dengan bobot](https://www.g33kinfo.com/info/round-robin-vs-weighted-round-robin-lb) +* [Lapisan ke-4](#penyeimbangan-beban-lapisan-ke-4) +* [Lapisan ke-7](#layer-7-load-balancing) -### Layer 4 load balancing +### Penyeimbangan beban lapisan ke-4 -Layer 4 load balancers look at info at the [transport layer](#communication) to decide how to distribute requests. Generally, this involves the source, destination IP addresses, and ports in the header, but not the contents of the packet. Layer 4 load balancers forward network packets to and from the upstream server, performing [Network Address Translation (NAT)](https://www.nginx.com/resources/glossary/layer-4-load-balancing/). +Penyeimbang beban lapisan ke-4 menggunakan informasi pada [lapisan transportasi](#komunikasi) untuk menentukan bagaimana cara mendistribusikan permintaan. +Umumnya, proses ini melibatkan asal alamat ip, tujuan alamat ip dan porta pada tajuk (header), tetapi bukan isi paket. +Penyeimbang beban lapisan ke-4 meneruskan paket jaringan dari dan ke server hulu dengan melakukan [translasi alamat jaringan](https://www.nginx.com/resources/glossary/layer-4-load-balancing/). -### Layer 7 load balancing +### Penyeimbang beban lapisan ke-7 -Layer 7 load balancers look at the [application layer](#communication) to decide how to distribute requests. This can involve contents of the header, message, and cookies. Layer 7 load balancers terminates network traffic, reads the message, makes a load-balancing decision, then opens a connection to the selected server. For example, a layer 7 load balancer can direct video traffic to servers that host videos while directing more sensitive user billing traffic to security-hardened servers. +Penyeimbang beban lapisan ke-7 menggunakan informasi pada [lapisan aplikasi](#komunikasi) untuk menentukan cara mendistribusikan permintaan. +Informasi yang dapat dilibat adalah tajuk, pesan, dan kuki. +Penyeimbang beban lapisan ke-7 mengakhiri lalu lintas jaringan, membaca pesan, membuat keputusan penyeimbangan beban, kemudian membuka koneksi ke server terpilih. +Sebagai contoh, penyeimbang beban lapisan ke-7 bisa mengarahkan lalu lintas video menuju server yang menginangi video tersebut sembari mengarahkan lalu lintas tagihan pengguna yang lebih sensitif ke server yang keamanannya sudah diperketat. +Layer 7 load balancers look at the [application layer](#communication) to decide how to distribute requests. -At the cost of flexibility, layer 4 load balancing requires less time and computing resources than Layer 7, although the performance impact can be minimal on modern commodity hardware. +Dengan mengorbankan fleksibilitas, penyeimbang beban lapisan ke-4 memerlukan waktu dan sumber daya komputasi yang lebih sedikit dibandingkan dengan penyeimbang beban lapisan ke-7, walaupun dampak kinerjanya bisa sangat minim pada perangkat keras komoditas modern. -### Horizontal scaling +### Penyekalaan horizontal -Load balancers can also help with horizontal scaling, improving performance and availability. Scaling out using commodity machines is more cost efficient and results in higher availability than scaling up a single server on more expensive hardware, called **Vertical Scaling**. It is also easier to hire for talent working on commodity hardware than it is for specialized enterprise systems. +Penyeimbang beban bisa juga membantu penyekalaan horizontal untuk meningkatkan kinerja dan ketersediaan. +Penyekalaan keluar menggunakan mesin komoditas lebih efisien dari segi biaya dan menghasilkan ketersediaan yang lebih tinggi dibandingkan dengan penyekalaan ke atas server. +Penyekalaan ke atas sebuah server individu menggunakan perangkat keras yang lebih mahal disebut dengan penyekalaan vertikal. +Mencari pekerja yang bekerja pada perangkat lunak komoditas juga lebih mudah dibandingkan mencari pekerja untuk sistem firma terspesialisasi. -#### Disadvantage(s): horizontal scaling +#### Kekurangan: Penyekalaan horizontal -* Scaling horizontally introduces complexity and involves cloning servers - * Servers should be stateless: they should not contain any user-related data like sessions or profile pictures - * Sessions can be stored in a centralized data store such as a [database](#database) (SQL, NoSQL) or a persistent [cache](#cache) (Redis, Memcached) -* Downstream servers such as caches and databases need to handle more simultaneous connections as upstream servers scale out +* Penyekalaan secara horizontal meningkatkan kompleksitas dan melibatkan pengklonaan server + * Server seharusnya nirkeadaan: server seharusnya tidak mengandung data apapun yang berhubungan dengan pengguna seperti sesi dan profil pengguna + * Sesi dapat disimpan pada penyimpanan data terpusat seperti [basis data](#basis-data) (SQL, NoSQL) atau [singgahan](#singgahan) persisten (Redis, Memcached) +* Server hilir seperti singgahan dan basis data perlu menangani lebih banyak koneksi secara simultan ketika terjadi penyekalaan keluar server hulu -### Disadvantage(s): load balancer +### Kekurangan: penyeimbang beban -* The load balancer can become a performance bottleneck if it does not have enough resources or if it is not configured properly. -* Introducing a load balancer to help eliminate single points of failure results in increased complexity. -* A single load balancer is a single point of failure, configuring multiple load balancers further increases complexity. +* Penyeimbang beban bisa menjadi titik macet kinerja jika penyeimbang beban tidak memiliki sumber daya yang cukup atau tidak dikonfigurasi dengan benar. +* Menambahkan penyeimbang beban untuk menghilangkan titik kegagalan akan meningkatkan kompleksitas. +* Penyeimbang beban tunggal adalah titik kegagalan. Konfigurasi penyeimbang beban ganda membuat sistem lebih kompleks lagi. -### Source(s) and further reading +### Sumber dan bacaan lanjutan -* [NGINX architecture](https://www.nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/) -* [HAProxy architecture guide](http://www.haproxy.org/download/1.2/doc/architecture.txt) -* [Scalability](http://www.lecloud.net/post/7295452622/scalability-for-dummies-part-1-clones) +* [Arsitektur NGINX](https://www.nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/) +* [Panduan arsitektur HAProxy](http://www.haproxy.org/download/1.2/doc/architecture.txt) +* [Penyekalaan](http://www.lecloud.net/post/7295452622/scalability-for-dummies-part-1-clones) * [Wikipedia](https://en.wikipedia.org/wiki/Load_balancing_(computing)) -* [Layer 4 load balancing](https://www.nginx.com/resources/glossary/layer-4-load-balancing/) -* [Layer 7 load balancing](https://www.nginx.com/resources/glossary/layer-7-load-balancing/) -* [ELB listener config](http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) +* [Penyeimbang beban lapisan ke-4](https://www.nginx.com/resources/glossary/layer-4-load-balancing/) +* [Penyeimbang beban lapisak ke-7](https://www.nginx.com/resources/glossary/layer-7-load-balancing/) +* [Konfigurasi pendengar ELB](http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) ## Reverse proxy (web server) @@ -1172,7 +1183,7 @@ Sample data well-suited for NoSQL: * [Scaling up to your first 10 million users](https://www.youtube.com/watch?v=w95murBkYmU) * [SQL vs NoSQL differences](https://www.sitepoint.com/sql-vs-nosql-differences/) -## Cache +## Singgahan

@@ -1410,7 +1421,7 @@ If queues start to grow significantly, the queue size can become larger than mem * [Little's law](https://en.wikipedia.org/wiki/Little%27s_law) * [What is the difference between a message queue and a task queue?](https://www.quora.com/What-is-the-difference-between-a-message-queue-and-a-task-queue-Why-would-a-task-queue-require-a-message-broker-like-RabbitMQ-Redis-Celery-or-IronMQ-to-function) -## Communication +## Komunikasi

From 879148e74f2a31f936ad2379eb6d6059f0247b9e Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Fri, 7 Feb 2020 09:35:34 +0700 Subject: [PATCH 19/32] Translate section 18 Reverse proxy (web server) --- README-id.md | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/README-id.md b/README-id.md index 64d1c4fb..4bd3c512 100644 --- a/README-id.md +++ b/README-id.md @@ -781,47 +781,48 @@ Mencari pekerja yang bekerja pada perangkat lunak komoditas juga lebih mudah dib * [Penyeimbang beban lapisak ke-7](https://www.nginx.com/resources/glossary/layer-7-load-balancing/) * [Konfigurasi pendengar ELB](http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) -## Reverse proxy (web server) +## Proksi terbalik (server web)


- Source: Wikipedia + Sumber: Wikipedia

-A reverse proxy is a web server that centralizes internal services and provides unified interfaces to the public. Requests from clients are forwarded to a server that can fulfill it before the reverse proxy returns the server's response to the client. +Proksi terbalik adalah server web yang memusatkan layanan-layanan internal dan menyediakan antarmuka terpadu ke publik. +Permintaan dari klien diteruskan ke salah satu server yang mampu memenuhi permintaan tersebut sebelum proksi terbalik mengembalikan tanggapan server tersebut ke klien. -Additional benefits include: +Benefit tambahan yang termasuk di dalamnya: -* **Increased security** - Hide information about backend servers, blacklist IPs, limit number of connections per client -* **Increased scalability and flexibility** - Clients only see the reverse proxy's IP, allowing you to scale servers or change their configuration -* **SSL termination** - Decrypt incoming requests and encrypt server responses so backend servers do not have to perform these potentially expensive operations - * Removes the need to install [X.509 certificates](https://en.wikipedia.org/wiki/X.509) on each server -* **Compression** - Compress server responses -* **Caching** - Return the response for cached requests -* **Static content** - Serve static content directly +* **Meningkatkan keamanan** - Menyembunyikan informasi mengenai server bagian belakang, memasukan alamat IP ke dalam daftar hitam, dan membatasi jumlah koneksi per klien +* **Meningkatkan skalabilitas dan fleksibilitas** - Klien hanya melihat alamat IP proksi terbalik sehingga memungkinkan kita untuk menyekalakan server atau mengganti konfigurasi +* **Terminasi SSL** - Mendekripsi permintaan yang datang dan mengenkripsi tanggapan server sehingga server bagian belakang tidak perlu melakukan operasi yang berpotensi mahal ini + * Menghapus keperluan untuk menginstall [sertifikat x.509](https://en.wikipedia.org/wiki/X.509) di setiap server +* **Kompresi** - Memampatkan tanggapan server +* **Singgahan** - Mengembalikan tanggapan berdasarkan permintaan yang ada disinggahan +* **Konten statis** - Melayani konten statis secara langsung * HTML/CSS/JS - * Photos - * Videos - * Etc + * Foto + * Video + * Dan lainnya -### Load balancer vs reverse proxy +### Penyeimbang beban vs proksi terbalik -* Deploying a load balancer is useful when you have multiple servers. Often, load balancers route traffic to a set of servers serving the same function. -* Reverse proxies can be useful even with just one web server or application server, opening up the benefits described in the previous section. -* Solutions such as NGINX and HAProxy can support both layer 7 reverse proxying and load balancing. +* Penggelaran penyeimbang beban berguna ketika kita mempunyai beberapa server. Seringkali, penyeimbang beban mengarahkan lalu lintas ke sekumpulan server yang melayani fungsi yang sama. +* Proksi terbalik bisa berguna bahkan untuk satu server web atau satu server aplikasi sehingga membuka manfaat yang dijelaskan pada bagian sebelumnya. +* Solusi seperti NGINX dan HAProxy mendukung pemproxyan terbalik dan penyeimbangan beban lapisan ke-7. -### Disadvantage(s): reverse proxy +### Kekurangan: proksi terbalik -* Introducing a reverse proxy results in increased complexity. -* A single reverse proxy is a single point of failure, configuring multiple reverse proxies (ie a [failover](https://en.wikipedia.org/wiki/Failover)) further increases complexity. +* Menambahkan proksi terbalik meningkatkan kompleksitas. +* Proksi terbalik tunggal adalah titik kegagalan. Pengkonfigurasian proksi terbalik ganda (Contohnya [failover](https://en.wikipedia.org/wiki/Failover)) meningkatkan kompleksitas lagi. -### Source(s) and further reading +### Sumber dan bacaan lanjutan -* [Reverse proxy vs load balancer](https://www.nginx.com/resources/glossary/reverse-proxy-vs-load-balancer/) -* [NGINX architecture](https://www.nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/) -* [HAProxy architecture guide](http://www.haproxy.org/download/1.2/doc/architecture.txt) +* [Proksi terbalik vs penyeimbang beban](https://www.nginx.com/resources/glossary/reverse-proxy-vs-load-balancer/) +* [Arsitektur NGINX](https://www.nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/) +* [Panduan arsitektur HAProxy](http://www.haproxy.org/download/1.2/doc/architecture.txt) * [Wikipedia](https://en.wikipedia.org/wiki/Reverse_proxy) ## Application layer From 2e1ed40013bdb72582ac7d5e71a13962b454f35f Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Fri, 7 Feb 2020 10:27:16 +0700 Subject: [PATCH 20/32] Translate section 19 Application layer --- README-id.md | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/README-id.md b/README-id.md index 4bd3c512..9bc889fd 100644 --- a/README-id.md +++ b/README-id.md @@ -825,40 +825,46 @@ Benefit tambahan yang termasuk di dalamnya: * [Panduan arsitektur HAProxy](http://www.haproxy.org/download/1.2/doc/architecture.txt) * [Wikipedia](https://en.wikipedia.org/wiki/Reverse_proxy) -## Application layer +## Lapisan aplikasi


- Source: Intro to architecting systems for scale + Sumber: Pengantar pengarsitekan sistem secara terskala

-Separating out the web layer from the application layer (also known as platform layer) allows you to scale and configure both layers independently. Adding a new API results in adding application servers without necessarily adding additional web servers. The **single responsibility principle** advocates for small and autonomous services that work together. Small teams with small services can plan more aggressively for rapid growth. +Pemisahan antara lapisan web dengan lapisan aplikasi (dikenal juga dengan istilah lapisan platform) memungkinkan kita untuk menyekala dan mengkonfigurasi kedua lapisan secara independen. +Penambahan API baru menghasilkan penambahan server aplikasi tanpa perlu penambahan server web. +Prinsip tanggung jawab tunggal menganjurkan untuk layanan yang kecil dan mandiri yang bekerja secara bersama. +Tim kecil dengan layanan kecil bisa merencanakan pertumbuhan yang cepat secara lebih agresif. -Workers in the application layer also help enable [asynchronism](#asynchronism). +Pekerja pada lapisan aplikasi membantu mengaktifkan [asinkronisme](#asinkronisme). -### Microservices +### Layanan mikro (Microservices) -Related to this discussion are [microservices](https://en.wikipedia.org/wiki/Microservices), which can be described as a suite of independently deployable, small, modular services. Each service runs a unique process and communicates through a well-defined, lightweight mechanism to serve a business goal. 1 +Sehubungan dengan diskusi ini adalah [microservices](https://en.wikipedia.org/wiki/Microservices) dimana dapat digambarkan sebagai sekumpulan layanan yang kecil, modular, dan dapat digelar secara independen. +Setiap layanan menjalankan proses yang unik dan berkomunikasi melalui mekanisme ringan dan sudah terdefinisi dengan baik untuk melayani tujuan bisnis.1 -Pinterest, for example, could have the following microservices: user profile, follower, feed, search, photo upload, etc. +Contohnya, Pinterest bisa memiliki layanan mikro: profil pengguna, pengikut, umpan, pencarian, pengunggahan foto, dan lain. -### Service Discovery +### Penemuan layanan (Service Discovery) -Systems such as [Consul](https://www.consul.io/docs/index.html), [Etcd](https://coreos.com/etcd/docs/latest), and [Zookeeper](http://www.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper) can help services find each other by keeping track of registered names, addresses, and ports. [Health checks](https://www.consul.io/intro/getting-started/checks.html) help verify service integrity and are often done using an [HTTP](#hypertext-transfer-protocol-http) endpoint. Both Consul and Etcd have a built in [key-value store](#key-value-store) that can be useful for storing config values and other shared data. +Sistem seperti [Consul](https://www.consul.io/docs/index.html), [Etcd](https://coreos.com/etcd/docs/latest), dan [Zookeeper](http://www.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper) bisa membantu layanan untuk saling menemukan dengan cara melacak nama yang terdaftar, alamat, dan porta. +[Pemeriksaan kesehatan](https://www.consul.io/intro/getting-started/checks.html) membantu menguji integritas layanan dan seringkali dilakukan menggunakan titik akhir [HTTP](#hypertext-transfer-protocol-http). +Baik Consul dan Etcd keduanya memiliki [gudang tanda-nilai](#gudang-tanda-nilai) bawaan yang berguna untuk menyimpan nilai konfigurasi dan data bersama lainnya. -### Disadvantage(s): application layer +### Kekurangan: lapisan aplikasi -* Adding an application layer with loosely coupled services requires a different approach from an architectural, operations, and process viewpoint (vs a monolithic system). -* Microservices can add complexity in terms of deployments and operations. +* Penambahan lapisan aplikasi dengan layanan hubungan renggang memerlukan pendekatan yang berbeda dari sudut pandang arsitektur, operasi, dan proses dibandingkan dengan sistem monolitik. +* Layanan mikro bisa meningkatkan kompleksitas dalam aspek penggelaran dan operasi. -### Source(s) and further reading +### Sumber dan bacaan lanjutan -* [Intro to architecting systems for scale](http://lethain.com/introduction-to-architecting-systems-for-scale) -* [Crack the system design interview](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview) -* [Service oriented architecture](https://en.wikipedia.org/wiki/Service-oriented_architecture) -* [Introduction to Zookeeper](http://www.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper) -* [Here's what you need to know about building microservices](https://cloudncode.wordpress.com/2016/07/22/msa-getting-started/) +* [Pengantar pengarsitekan sistem secara terskala](http://lethain.com/introduction-to-architecting-systems-for-scale) +* [Meretakan wawancara perancangan sistem](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview) +* [Arsitektur berorientasi layanan](https://en.wikipedia.org/wiki/Service-oriented_architecture) +* [Pengantar Zookeper](http://www.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper) +* [Alasan kenapa kita perlu tahu mengenai pembangunan layanan mikro](https://cloudncode.wordpress.com/2016/07/22/msa-getting-started/) ## Basis data @@ -1055,7 +1061,7 @@ NoSQL is a collection of data items represented in a **key-value store**, **docu In addition to choosing between [SQL or NoSQL](#sql-or-nosql), it is helpful to understand which type of NoSQL database best fits your use case(s). We'll review **key-value stores**, **document stores**, **wide column stores**, and **graph databases** in the next section. -#### Key-value store +#### Gudang tanda-nilai > Abstraction: hash table @@ -1376,7 +1382,7 @@ Refresh-ahead can result in reduced latency vs read-through if the cache can acc * [AWS ElastiCache strategies](http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Strategies.html) * [Wikipedia](https://en.wikipedia.org/wiki/Cache_(computing)) -## Asynchronism +## Asinkronisme

From 5f809c704d874534714fa157193ff6e2dd1aca5c Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Fri, 7 Feb 2020 14:56:39 +0700 Subject: [PATCH 21/32] Translate section 20: Database --- README-id.md | 400 ++++++++++++++++++++++++++++----------------------- 1 file changed, 219 insertions(+), 181 deletions(-) diff --git a/README-id.md b/README-id.md index 9bc889fd..7a116f8e 100644 --- a/README-id.md +++ b/README-id.md @@ -309,7 +309,7 @@ Periksa tautan-tautan berikut untuk lebih memahami apa yang diharapkan saat wawa | Perancangan perayap web | [Solusi](solutions/system_design/web_crawler/README.md) | | Perancangan Mint.com | [solusi](solutions/system_design/mint/README.md) | | Perancangan struktur data untuk jejaring sosial | [Solusi](solutions/system_design/social_graph/README.md) | -| Perancangan gudang tanda-nilai (key-value) untuk mesin pencari | [Solusi](solutions/system_design/query_cache/README.md) | +| Perancangan gudang kunci-nilai (key-value) untuk mesin pencari | [Solusi](solutions/system_design/query_cache/README.md) | | Perancangan peringkat penjualan Amazon berdasarkan fitur kategori | [Solusi](solutions/system_design/sales_rank/README.md) | | Perancangan sistem terskala untuk jutaan pengguna pada AWS | [Solusi](solutions/system_design/scaling_aws/README.md) | | Tambahkan pertanyaan perancangan sistem | [Kontribusi](#kontribusi) | @@ -344,7 +344,7 @@ Periksa tautan-tautan berikut untuk lebih memahami apa yang diharapkan saat wawa ![Imgur](http://i.imgur.com/cdCv5g7.png) -### Perancangan gudang tanda-nilai (key-value) untuk mesin pencari +### Perancangan gudang kunci-nilai (key-value) untuk mesin pencari [Lihat latihan dan solusi](solutions/system_design/query_cache/README.md) @@ -478,7 +478,7 @@ CP adalah kompromi yang baik jika bisnis mempunyai kebutuhan baca dan tulis yang Tanggapan berisi data terakhir yang tersedia pada sebuah mesin dimana data tersebut mungkin bukan data terbaru. Tulisan bakal memerlukan beberapa saat untuk tersebar ke mesin lain ketika masalah penyekatan selesai. -AP adalah kompromi yang baik jika kebutuhan bisnis mengijinkan untuk [konsistensi akan datang](#konsistensi-akan-datang-eventual-consistency) atau ketika sistem perlu tetap bekerja walaupun ada kesalahan pihak luar. +AP adalah kompromi yang baik jika kebutuhan bisnis mengijinkan untuk [konsistensi yang mungkin terjadi](#konsistensi-yang-mungkin-terjadi-eventual-consistency) atau ketika sistem perlu tetap bekerja walaupun ada kesalahan pihak luar. ### Sumber dan bacaan lanjutan @@ -501,13 +501,13 @@ Pendekatan ini bisa dilihat pada sistem contohnya Memcached. Konsistensi lemah bekerja dengan baik pada sistem kasus penggunaan waktu nyata contohnya VoIP, obrolan video, dan permainan banyak pemain waktu nyata. Sebagai contoh, jika kita dalam panggilan telpon dan kehilangan sinyal untuk beberapa detik, kita tidak akan mendengar pembicaraan yang terjadi ketika koneksi terputus. -### Konsistensi akan datang (eventual consistency) +### Konsistensi yang mungkin terjadi (eventual consistency) Setelah operasi tulis, operasi baca akan melihat pada waktu yang akan datang (biasanya dalam mili seconds). Data direplikasi secara asinkron. Pendekatan ini terlihat di sistem contohnya DNS dan email. -Konsistensi akan datang bekerja dengan baik di sistem yang sangat tersedia. +Konsistensi yang mungkin terjadi bekerja dengan baik di sistem yang sangat tersedia. ### Konsisten kuat @@ -851,7 +851,7 @@ Contohnya, Pinterest bisa memiliki layanan mikro: profil pengguna, pengikut, ump Sistem seperti [Consul](https://www.consul.io/docs/index.html), [Etcd](https://coreos.com/etcd/docs/latest), dan [Zookeeper](http://www.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper) bisa membantu layanan untuk saling menemukan dengan cara melacak nama yang terdaftar, alamat, dan porta. [Pemeriksaan kesehatan](https://www.consul.io/intro/getting-started/checks.html) membantu menguji integritas layanan dan seringkali dilakukan menggunakan titik akhir [HTTP](#hypertext-transfer-protocol-http). -Baik Consul dan Etcd keduanya memiliki [gudang tanda-nilai](#gudang-tanda-nilai) bawaan yang berguna untuk menyimpan nilai konfigurasi dan data bersama lainnya. +Baik Consul dan Etcd keduanya memiliki [gudang kunci-nilai](#gudang-kunci-nilai) bawaan yang berguna untuk menyimpan nilai konfigurasi dan data bersama lainnya. ### Kekurangan: lapisan aplikasi @@ -871,324 +871,362 @@ Baik Consul dan Etcd keduanya memiliki [gudang tanda-nilai](#gudang-tanda-nilai)


- Source: Scaling up to your first 10 million users + Sumber: Penyekalaan untuk 10 juta pengguna pertama

-### Relational database management system (RDBMS) +### Sistem pengelolaan basis data relasional (Relational database management system / RDBMS) -A relational database like SQL is a collection of data items organized in tables. +Basis data relasional seperti SQL merupakan sekumpulan butir data yang diorganisasi ke dalam tabel. -**ACID** is a set of properties of relational database [transactions](https://en.wikipedia.org/wiki/Database_transaction). +***ACID** adalah sekumpulan property dari [transaksi](https://en.wikipedia.org/wiki/Database_transaction) basis data relasional -* **Atomicity** - Each transaction is all or nothing -* **Consistency** - Any transaction will bring the database from one valid state to another -* **Isolation** - Executing transactions concurrently has the same results as if the transactions were executed serially -* **Durability** - Once a transaction has been committed, it will remain so +* **Atomicity** - Seluruh operasi dalam transaksi berhasil seluruhnya atau gagal semuanya +* **Consistency** - Transaksi apa pun akan membawa basis data dari satu keadaan ke keadaan lain +* **Isolation** - Menjalankan transaksi secara bersamaan memiliki hasil yang sama seolah-olah transaksi dijalankan secara berurutan +* **Durability** - Sekali transaksi telah dilakukan, transaksi akan bertahan -There are many techniques to scale a relational database: **master-slave replication**, **master-master replication**, **federation**, **sharding**, **denormalization**, and **SQL tuning**. +Ada banyak teknik untuk menyekala basis data relasional: **replikasi master-slave**, **replikasi master-master**, **federasi**, **sharding**, **denormalization**, dan **penyetelan SQL**. #### Replikasi master-slave -The master serves reads and writes, replicating writes to one or more slaves, which serve only reads. Slaves can also replicate to additional slaves in a tree-like fashion. If the master goes offline, the system can continue to operate in read-only mode until a slave is promoted to a master or a new master is provisioned. +Master melayani operasi baca dan tulis, mereplikasi tulisan ke slave lainnya dimana slave hanya melayani operasi baca. +Slave bisa juga mereplikasi data ke slave lainnya membentuk mode seperti pohon. +Jika master luring, sistem tetap bisa beroperasi dalam mode hanya baca sampai salah satu slave dipromosikan menjadi master atau master yang baru diadakan.


- Source: Scalability, availability, stability, patterns + Sumber: Skalabilitas, Ketersediaan, Kestabilan, Pola-pola

-##### Disadvantage(s): master-slave replication +##### Kekurangan: replikasi master-slave -* Additional logic is needed to promote a slave to a master. -* See [Disadvantage(s): replication](#disadvantages-replication) for points related to **both** master-slave and master-master. +* Logik tambahan diperlukan untuk mempromosikan sebuah slave menjadi master. +* Lihat [Kekurangan: replikasi](#kekurangan-replikasi) untuk hal yang berhubungan dengan master-slave dan master-master. #### Replikasi master-master -Both masters serve reads and writes and coordinate with each other on writes. If either master goes down, the system can continue to operate with both reads and writes. +Kedua master melayani operasi baca dan tulis dan berkoordinasi satu sama lain untuk operasi tulis. +Jika salah satu master mati, sistem tetap bisa beroperasi untuk baca dan tulis.


- Source: Scalability, availability, stability, patterns + Sumber: Skalabilitas, Ketersediaan, Kestabilan, Pola-pola

-##### Disadvantage(s): master-master replication +##### Kekurangan: master-master replication -* You'll need a load balancer or you'll need to make changes to your application logic to determine where to write. -* Most master-master systems are either loosely consistent (violating ACID) or have increased write latency due to synchronization. -* Conflict resolution comes more into play as more write nodes are added and as latency increases. -* See [Disadvantage(s): replication](#disadvantages-replication) for points related to **both** master-slave and master-master. +* Kita akan memerlukan penyeimbang beban atau membuat perubahan pada logik aplikasi untuk menentukan kemana operasi tulis diarahkan. +* Kebanyakan sistem master-master memiliki konsistensi yang longgar (melanggar prinsip ACID) atau mengalami peningkatan jeda operasi tulis karena ada sinkronisasi. +* Resolusi konflik lebih berperan karena lebih banyak simpul yang ditambahkan dan peningkatan latensi. +* Lihat [Kekurangan: replikasi](#kekurangan-replikasi) untuk hal yang berhubungan dengan master-slave dan master-master. -##### Disadvantage(s): replication +##### Kekurangan: replikasi -* There is a potential for loss of data if the master fails before any newly written data can be replicated to other nodes. -* Writes are replayed to the read replicas. If there are a lot of writes, the read replicas can get bogged down with replaying writes and can't do as many reads. -* The more read slaves, the more you have to replicate, which leads to greater replication lag. -* On some systems, writing to the master can spawn multiple threads to write in parallel, whereas read replicas only support writing sequentially with a single thread. -* Replication adds more hardware and additional complexity. +* Ada potensi kehilangan data jika master gagal sebelum data yang baru tertulis direplikasi ke simpul yang lain. +* Tulisan diputar ulang pada replika baca. Jika ada banyak tulisan, replika baca bisa macet ketika menulis ulang tulisan dan tidak mampu melakukan banyak operasi baca. +* Semakin banyak slave baca, semakin banyak pula yang perlu direplikasi sehingga meningkatkan jeda replikasi. +* Pada beberapa sistem, menulis ke master bisa menghidupkan beberapa ulir (thread) untuk menulis secara paralel, sedangkan replika baca hanya mendukung menulis secara berurutan menggunakan satu ulir. +* Replikasi meningkatkan kebutuhan perangkat keras dan tambahan kompleksitas. -##### Source(s) and further reading: replication +##### Sumber dan bacaan lanjuta: replikasi -* [Scalability, availability, stability, patterns](http://www.slideshare.net/jboner/scalability-availability-stability-patterns/) -* [Multi-master replication](https://en.wikipedia.org/wiki/Multi-master_replication) +* [Skalabilitas, Ketersediaan, Kestabilan, Pola-pola](http://www.slideshare.net/jboner/scalability-availability-stability-patterns/) +* [Replikasi multi master](https://en.wikipedia.org/wiki/Multi-master_replication) #### Federation


- Source: Scaling up to your first 10 million users + Sumber: Penyekalaan untuk 10 juta pengguna pertama

-Federation (or functional partitioning) splits up databases by function. For example, instead of a single, monolithic database, you could have three databases: **forums**, **users**, and **products**, resulting in less read and write traffic to each database and therefore less replication lag. Smaller databases result in more data that can fit in memory, which in turn results in more cache hits due to improved cache locality. With no single central master serializing writes you can write in parallel, increasing throughput. +Federasi (atau penyekatan fungsional) membagi basis data berdasarkan fungsi. +Sebagai contoh, alih-alih basis data tunggal yang monolitik, kita bisa memiliki tiga basis data: **forum**, **pengguna**, dan **produk**. +Federasi mengurangi lalu lintas baca dan tulis ke setiap basis data dan oleh karena itu mengurangi jeda replikasi. +Basis data yang lebih kecil memungkinkan lebih banyak data yang bisa dimuat di dalam memori sehingga meningkatkan popularitas singgahan dikarenakan kualitas lokalitasnya. +Tanpa master terpusat tunggal yang menyambungkan tulisan sehingga kita bisa melakukan operasi tulis secara paralel yang berdampak meningkatnya lewatan. -##### Disadvantage(s): federation +##### Kekurangan: federasi -* Federation is not effective if your schema requires huge functions or tables. -* You'll need to update your application logic to determine which database to read and write. -* Joining data from two databases is more complex with a [server link](http://stackoverflow.com/questions/5145637/querying-data-by-joining-two-tables-in-two-database-on-different-servers). -* Federation adds more hardware and additional complexity. +* Federasi tidak efektif jika skema kita memerlukan fungsi atau tabel dalam jumlah yang sangat besar. +* Kita perlu memperbarui logik aplikasi untuk menentukan basis data mana untuk operasi baca dan tulis. +* Menggabungkan data dari dua basis data menjadi lebih kompleks ketika menggunakan [hubungan server](http://stackoverflow.com/questions/5145637/querying-data-by-joining-two-tables-in-two-database-on-different-servers). +* Federasi meningkatkan jumlah perangkat keras dan kompleksitas. -##### Source(s) and further reading: federation +##### Sumber dan bacaan lanjutan: federasi -* [Scaling up to your first 10 million users](https://www.youtube.com/watch?v=w95murBkYmU) +* [Penyekalaan untuk 10 juta pengguna pertama](https://www.youtube.com/watch?v=w95murBkYmU) -#### Sharding +#### Pecahan (Sharding)


- Source: Scalability, availability, stability, patterns + Sumber: Skalabilitas, Ketersediaan, Kestabilan, Pola-pola

-Sharding distributes data across different databases such that each database can only manage a subset of the data. Taking a users database as an example, as the number of users increases, more shards are added to the cluster. +Pecahan (sharding) mendistribusikan data ke berbagai basis data yang berbeda dimana setiap basis data hanya dapat mengelola subset data. +Ambil basis data pengguna sebagai contoh. Ketika jumlah pengguna bertambah maka lebih banyak pecahan yang ditambahkan ke dalam gugusan. -Similar to the advantages of [federation](#federation), sharding results in less read and write traffic, less replication, and more cache hits. Index size is also reduced, which generally improves performance with faster queries. If one shard goes down, the other shards are still operational, although you'll want to add some form of replication to avoid data loss. Like federation, there is no single central master serializing writes, allowing you to write in parallel with increased throughput. +Serupa dengan manfaat dari (federasi)[#federasi], pecahan mengurangi lalu lintas baca dan tulis, mengurangi replikasi, dan meningkatkan popularitas singgahan. +Ukuran indeks juga berkurang yang secara umum meningkatkan kinerja dengan kueri yang lebih cepat. +Jika salah satu pecahan mati, pecahan yang lain masih beroperasi, meski kita ingin menambahkan beberapa bentuk replikasi untuk mencegah kehilangan data. +Seperti federasi, tidak ada master terpusat tunggal yang menyambungkan tulisan sehingga kita bisa melakukan operasi tulis secara paralel yang berdampak meningkatnya lewatan. -Common ways to shard a table of users is either through the user's last name initial or the user's geographic location. +Cara umum memecah sebuah tabel pengguna adalah salah satunya dengan memanfaat inisial nama belakang pengguna atau geolokasi pengguna. -##### Disadvantage(s): sharding +##### Kekurangan: pecahan -* You'll need to update your application logic to work with shards, which could result in complex SQL queries. -* Data distribution can become lopsided in a shard. For example, a set of power users on a shard could result in increased load to that shard compared to others. - * Rebalancing adds additional complexity. A sharding function based on [consistent hashing](http://www.paperplanes.de/2011/12/9/the-magic-of-consistent-hashing.html) can reduce the amount of transferred data. -* Joining data from multiple shards is more complex. -* Sharding adds more hardware and additional complexity. +* Kita perlu memperbarui logik aplikasi untuk bekerja dengan pecahan yang dapat menyebabkan kueri yang lebih kompleks. +* Distribusi data bisa menjadi tidak seimbang di dalam pecahan. Contohnya, sekumpulan pengguna dengan kuasa penuh pada suatu pecahan bisa menghasilkan beban berlebih dibandingkan pecahan lain. + * Penyeimbangan ulang menambah kompleksitas. Pecahan yang berfungsi berdasarkan [consistent hashing](http://www.paperplanes.de/2011/12/9/the-magic-of-consistent-hashing.html) bisa mengurangi jumlah data yang dikirim. +* Menggabungkan data dari berbagai pecahan menjadi lebih kompleks. +* Pecahan memerlukan lebih banyak perangkat keras dan menambah kompleksitas. -##### Source(s) and further reading: sharding +##### Sumber dan bacaan tambahan: pecahan -* [The coming of the shard](http://highscalability.com/blog/2009/8/6/an-unorthodox-approach-to-database-design-the-coming-of-the.html) -* [Shard database architecture](https://en.wikipedia.org/wiki/Shard_(database_architecture)) +* [Kedatangan pecahan](http://highscalability.com/blog/2009/8/6/an-unorthodox-approach-to-database-design-the-coming-of-the.html) +* [Arsitektur basis data pecahan](https://en.wikipedia.org/wiki/Shard_(database_architecture)) * [Consistent hashing](http://www.paperplanes.de/2011/12/9/the-magic-of-consistent-hashing.html) -#### Denormalization +#### Denormalisasi (Denormalization) -Denormalization attempts to improve read performance at the expense of some write performance. Redundant copies of the data are written in multiple tables to avoid expensive joins. Some RDBMS such as [PostgreSQL](https://en.wikipedia.org/wiki/PostgreSQL) and Oracle support [materialized views](https://en.wikipedia.org/wiki/Materialized_view) which handle the work of storing redundant information and keeping redundant copies consistent. +Denormalisasi mencoba memperbaiki kinerja operasi baca dengan mengorbankan operasi tulis. +Salinan data yang berlebihan ditulis di beberapa tabel untuk menghindari operasi penggabungan yang mahal. +Beberapa RDBMS seperti [PostgreSQL](https://en.wikipedia.org/wiki/PostgreSQL) dan Oracle mendukung [materialized views](https://en.wikipedia.org/wiki/Materialized_view) yang menangani penyimpanan informasi yang berlebih dan memastikan salinan tersebut konsisten. -Once data becomes distributed with techniques such as [federation](#federation) and [sharding](#sharding), managing joins across data centers further increases complexity. Denormalization might circumvent the need for such complex joins. +Ketika data menjadi terdistribusi dengan teknik seperti [federasi](#federasi) dan [pecahan](#pecahan), pengelolaan penggabungan data lintas pusat data meningkatkan kompleksitas lebih tinggi lagi. +Denormalisasi bisa jadi menghindari kebutuhan penggabungan yang bersifat kompleks. -In most systems, reads can heavily outnumber writes 100:1 or even 1000:1. A read resulting in a complex database join can be very expensive, spending a significant amount of time on disk operations. +Pada kebanyakan sistem, operasi baca bisa jauh mengalahkan operasi tulis dengan rasio 100:1 bahkan 1000:1. +Operasi baca yang memerlukan penggabungan basis data yang kompleks bisa menjadi sangat mahal biayanya dan menghabiskan banyak waktu untuk operasi disk. -##### Disadvantage(s): denormalization +##### Kekurangan: denormalisasi -* Data is duplicated. -* Constraints can help redundant copies of information stay in sync, which increases complexity of the database design. -* A denormalized database under heavy write load might perform worse than its normalized counterpart. +* Data punya salinan. +* Batasan bisa membantu salinan informasi yang berlebihan untuk tetap sinkron yang berdampak pada meningkatnya kompleksitas rancangan basis data. +* Basis data denormalisasi dengan beban operasi tulis berat mungkin kinerjanya akan lebih buruk dibandingkan basis data ternormalisasi. -###### Source(s) and further reading: denormalization +###### Sumber dan bacaan lanjutan: denormalisasi -* [Denormalization](https://en.wikipedia.org/wiki/Denormalization) +* [Denormalisasi](https://en.wikipedia.org/wiki/Denormalization) -#### SQL tuning +#### Penyetelan SQL (SQL tuning) -SQL tuning is a broad topic and many [books](https://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=sql+tuning) have been written as reference. +Penyetelah SQL merupakan topik yang luas dan banyak [buku](https://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=sql+tuning) yang sudah dituliskan sebagai referensi. -It's important to **benchmark** and **profile** to simulate and uncover bottlenecks. +**Tolok ukur** dan **profil** penting untuk menyimulasi dan menemukan kemacetan. -* **Benchmark** - Simulate high-load situations with tools such as [ab](http://httpd.apache.org/docs/2.2/programs/ab.html). -* **Profile** - Enable tools such as the [slow query log](http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html) to help track performance issues. +* **Tolok ukur** - Menyimulasi situasi beban tinggi dengan alat seperti [ab](http://httpd.apache.org/docs/2.2/programs/ab.html). +* **Profil** - Memungkinkan alat seperti [slow query log](http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html) membantu melacak masalah kinerja. -Benchmarking and profiling might point you to the following optimizations. +Pembuatan tolok ukur dan profil bisa mengarahkan kita kepada optimisasi berikut. -##### Tighten up the schema +##### Perketat skema -* MySQL dumps to disk in contiguous blocks for fast access. -* Use `CHAR` instead of `VARCHAR` for fixed-length fields. - * `CHAR` effectively allows for fast, random access, whereas with `VARCHAR`, you must find the end of a string before moving onto the next one. -* Use `TEXT` for large blocks of text such as blog posts. `TEXT` also allows for boolean searches. Using a `TEXT` field results in storing a pointer on disk that is used to locate the text block. -* Use `INT` for larger numbers up to 2^32 or 4 billion. -* Use `DECIMAL` for currency to avoid floating point representation errors. -* Avoid storing large `BLOBS`, store the location of where to get the object instead. -* `VARCHAR(255)` is the largest number of characters that can be counted in an 8 bit number, often maximizing the use of a byte in some RDBMS. -* Set the `NOT NULL` constraint where applicable to [improve search performance](http://stackoverflow.com/questions/1017239/how-do-null-values-affect-performance-in-a-database-search). +* MySQL menulis data ke disk pada blok yang berdekatan untuk mempercepat akses. +* Gunakan `CHAR` dari pada `VARCHAR` untuk bidang dengan panjang tetap. + * `CHAR` memungkinkan akses acak yang cepat secara efektif sedangkan pada `VARCHAR` kita harus menemukan ujung sebuah string sebelum pindah ke string selanjutnya. +* Gunakan `TEXT` untuk teks dalam blok besar seperti tulisan blog. `TEXT` juga memungkinkan untuk pencarian biner. Penggunaan `TEXT` menghasilkan penyimpanan penunjuk pada disk yang berguna untuk menemukan blok teks selanjutnya. +* Gunakan `INT` untuk menyimpan jumlah besar sampai dengan 2^32 atau 4 miliar. +* Gunakan `DECIMAL` untuk mata uang sehingga terhindar dari kesalahan representasi _floating point_. +* Hindari menyimpan `BLOBS` berukuran besar, simpan lokasi dimana objek tersebut berada. +* `VARCHAR(255)` adalah jumlah karakter terbesar yang bisa dihitung dalam angka 8 bit, seringkali memaksimalkan penggunaan byte pada beberapa RDBMS. +* Atur batasan `NOT NULL` ditempat yang relevan untuk [meningkatkan kinerja pencarian](http://stackoverflow.com/questions/1017239/how-do-null-values-affect-performance-in-a-database-search). -##### Use good indices +##### Gunakan indeks yang baik -* Columns that you are querying (`SELECT`, `GROUP BY`, `ORDER BY`, `JOIN`) could be faster with indices. -* Indices are usually represented as self-balancing [B-tree](https://en.wikipedia.org/wiki/B-tree) that keeps data sorted and allows searches, sequential access, insertions, and deletions in logarithmic time. -* Placing an index can keep the data in memory, requiring more space. -* Writes could also be slower since the index also needs to be updated. -* When loading large amounts of data, it might be faster to disable indices, load the data, then rebuild the indices. +* Kolom yang kita kueri (`SELECT`, `GROUP BY`, `ORDER BY`, `JOIN`) menjadi lebih cepat dengan indeks. +* Indeks umumnya digambarkan sebagai penyeimbang diri [B-tree](https://en.wikipedia.org/wiki/B-tree) yang menjaga data terurut dan memungkinkan pencarian, akses berurut, penambahan, dan penghapusan dalam waktu yang logaritmik. +* Penempatan pada indeks memungkinkan data disimpan pada memori sehingga membutuhkan ruang lebih. +* Operasi tulis bisa menjadi lebih lambat karena indeks juga perlu diperbarui. +* Ketika memuat data dalam jumlah besar, mungkin akan lebih cepat ketika indeks dinonaktifkan, muat data, kemudian bangun kembali indeks. -##### Avoid expensive joins +##### Hindari penggabungan mahal -* [Denormalize](#denormalization) where performance demands it. +* [Denormalisasi](#denormalisasi) ketika kinerja membutuhkan hal tersebut. -##### Partition tables +##### Partisi table -* Break up a table by putting hot spots in a separate table to help keep it in memory. +* Pisahkan tabel dengan menempatkan titik panas di tabel yang berbeda untuk membantu tabel tetap dalam memori. -##### Tune the query cache +##### Setel singgahan kueri -* In some cases, the [query cache](https://dev.mysql.com/doc/refman/5.7/en/query-cache.html) could lead to [performance issues](https://www.percona.com/blog/2016/10/12/mysql-5-7-performance-tuning-immediately-after-installation/). +* Pada beberapa kasus, [singgahan kueri](https://dev.mysql.com/doc/refman/5.7/en/query-cache.html) dapat menyebabkan [masalah kinerja](https://www.percona.com/blog/2016/10/12/mysql-5-7-performance-tuning-immediately-after-installation/). -##### Source(s) and further reading: SQL tuning +##### Sumber dan bacaan lanjutan: Peyetelan SQL -* [Tips for optimizing MySQL queries](http://aiddroid.com/10-tips-optimizing-mysql-queries-dont-suck/) -* [Is there a good reason i see VARCHAR(255) used so often?](http://stackoverflow.com/questions/1217466/is-there-a-good-reason-i-see-varchar255-used-so-often-as-opposed-to-another-l) -* [How do null values affect performance?](http://stackoverflow.com/questions/1017239/how-do-null-values-affect-performance-in-a-database-search) -* [Slow query log](http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html) +* [Kiat untuk mengoptimasi kueri MySQL](http://aiddroid.com/10-tips-optimizing-mysql-queries-dont-suck/) +* [Apakah ada alasan yang baik dibalik seringnya digunakan VARCHAR(255)?](http://stackoverflow.com/questions/1217466/is-there-a-good-reason-i-see-varchar255-used-so-often-as-opposed-to-another-l) +* [Bagaimana nilai null mempengaruhi kinerja?](http://stackoverflow.com/questions/1017239/how-do-null-values-affect-performance-in-a-database-search) +* [Log kueri lambat](http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html) ### NoSQL -NoSQL is a collection of data items represented in a **key-value store**, **document store**, **wide column store**, or a **graph database**. Data is denormalized, and joins are generally done in the application code. Most NoSQL stores lack true ACID transactions and favor [eventual consistency](#eventual-consistency). +NoSQL adalah sekumpulan butir data yang diwakili pada **gudang kunci-nilai**, **gudang dokumen**, **gudang kolom lebar**, atau **basis data graf**. +Data di denormalisasi dan penggabungan umumnya dilakukan pada kode aplikasi. +Kebanyakan gudang NoSQL tidak memiliki transaksi ACID dan memilih [konsistensi yang mungkin terjadi](#konsistensi-yang-mungkin-terjadi-eventual-consistency). -**BASE** is often used to describe the properties of NoSQL databases. In comparison with the [CAP Theorem](#cap-theorem), BASE chooses availability over consistency. +**BASE** seringkali digunakan untuk menggambarkan property basis data NoSQL. +Sebagai perbandingan dengan [teorema CAP](#teorema-cap), BASE memilih ketersediaan dibandingkan konsistensi. -* **Basically available** - the system guarantees availability. -* **Soft state** - the state of the system may change over time, even without input. -* **Eventual consistency** - the system will become consistent over a period of time, given that the system doesn't receive input during that period. +* **Basically available** - Sistem menjamin ketersediaan. +* **Soft state** - Keadaan sistem bisa berubah seiring waktu, bahkan tanpa ada masukan. +* **Eventual consistency** - Sistem akan menjadi konsisten selama periode waktu tertentu mengingat bahwa sistem tidak menerima masukan selama periode tersebut. -In addition to choosing between [SQL or NoSQL](#sql-or-nosql), it is helpful to understand which type of NoSQL database best fits your use case(s). We'll review **key-value stores**, **document stores**, **wide column stores**, and **graph databases** in the next section. +Sebagai tambahan dalam pemilihan antara [SQL atau NoSQL](#sql-atau-nosql), pemahaman akan tipe basis data NoSQL yang sesuai dengan kasus penggunan kita menjadi penting. +Kita akan bahas **gudang tanda-kunci**, **gudang dokumen**, **gudang kolom lebar**, dan **basis data graf** di bagian selanjutnya. -#### Gudang tanda-nilai +#### Gudang kunci-nilai -> Abstraction: hash table +> Abstraksi: tabel hash -A key-value store generally allows for O(1) reads and writes and is often backed by memory or SSD. Data stores can maintain keys in [lexicographic order](https://en.wikipedia.org/wiki/Lexicographical_order), allowing efficient retrieval of key ranges. Key-value stores can allow for storing of metadata with a value. +Gudang kunci-nilai umumnya memungkinkan operasi baca dan tulis dengan kompleksitas waktu O(1) dan umumnya didukung oleh memori atau SSD. +Gudang data mampu mengelola kunci menurut [urutan leksikografis](https://en.wikipedia.org/wiki/Lexicographical_order) yang memungkinkan pengambilan rentang kunci yang efisien. +Gudang kunci-nilai mengizinkan penyimpanan meta data beserta dengan nilai. -Key-value stores provide high performance and are often used for simple data models or for rapidly-changing data, such as an in-memory cache layer. Since they offer only a limited set of operations, complexity is shifted to the application layer if additional operations are needed. +Gudang kunci-nilai menyediakan kinerja tinggi dan sering kali digunakan untuk model data sederhana atau data yang berubah dengan cepat seperti lapisan singgah dalam memori. +Karena Gudan kunci-nilai hanya menawarkan kumpulan operasi yang terbatas, kompleksitas dipindahkan ke lapisan aplikasi jika operasi tambahan diperlukan. -A key-value store is the basis for more complex systems such as a document store, and in some cases, a graph database. +Gudang kunci-nilai menjadi dasar bagi sistem yang lebih kompleks seperti gudang dokumen, dan di beberapa kasus graf database. -##### Source(s) and further reading: key-value store +##### Sumber dan bacaan lanjutan: gudang kunci-nilai -* [Key-value database](https://en.wikipedia.org/wiki/Key-value_database) -* [Disadvantages of key-value stores](http://stackoverflow.com/questions/4056093/what-are-the-disadvantages-of-using-a-key-value-table-over-nullable-columns-or) -* [Redis architecture](http://qnimate.com/overview-of-redis-architecture/) -* [Memcached architecture](https://www.adayinthelifeof.nl/2011/02/06/memcache-internals/) +* [Basis data kunci-nilai](https://en.wikipedia.org/wiki/Key-value_database) +* [Kekurangan gudang kunci-nilai](http://stackoverflow.com/questions/4056093/what-are-the-disadvantages-of-using-a-key-value-table-over-nullable-columns-or) +* [Arsitektur Redis](http://qnimate.com/overview-of-redis-architecture/) +* [Arsitektur Memcached](https://www.adayinthelifeof.nl/2011/02/06/memcache-internals/) -#### Document store +#### Gudang dokumen (document store) -> Abstraction: key-value store with documents stored as values +> Abstraksi: gudang kunci-nilai dimana dokumen disimpan sebagai nilai -A document store is centered around documents (XML, JSON, binary, etc), where a document stores all information for a given object. Document stores provide APIs or a query language to query based on the internal structure of the document itself. *Note, many key-value stores include features for working with a value's metadata, blurring the lines between these two storage types.* +Gudang dokumen terpusat pada dokumen (XML, JSON, biner, dan lainnya) dimana dokumen menyimapan semua informasi untuk objek tertentu. +Gudang dokumen menyediakan API atau bahasa kueri untuk mengkueri berdasarkan struktur internal dari dokumen itu sendiri. +*Menjadi catatan bahwa banyak gudang kunci-nilai menyertakan fitur untuk bekerja dengan metadata suatu nilai sehingga mengaburkan batasan antara kedua jenis gudang.* -Based on the underlying implementation, documents are organized by collections, tags, metadata, or directories. Although documents can be organized or grouped together, documents may have fields that are completely different from each other. +Berdasarkan implementasi yang mendasarinya, dokumen diorganisasi berdasarkan koleksi, tag, metdata, atau direktori. +Meskipun dokumen bisa diorganisasi atau dikelompokan bersama, dokumen bisa memiliki bidang yang berbeda satu sama lain. -Some document stores like [MongoDB](https://www.mongodb.com/mongodb-architecture) and [CouchDB](https://blog.couchdb.org/2016/08/01/couchdb-2-0-architecture/) also provide a SQL-like language to perform complex queries. [DynamoDB](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/decandia07dynamo.pdf) supports both key-values and documents. +Beberapa gudang dokumen seperti [MongoDB](https://www.mongodb.com/mongodb-architecture) dan [CouchDB](https://blog.couchdb.org/2016/08/01/couchdb-2-0-architecture/) menyediakan bahasa seperti SQL untuk melakukan kueri yang kompleks. +[DynamoDB](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/decandia07dynamo.pdf) mendukung kunci-nilai dan dokumen. -Document stores provide high flexibility and are often used for working with occasionally changing data. +Gudang dokumen menyediakan fleksibilitas tinggi dan sering kali digunakan untuk bekerja dengan data yang sesekali berubah. -##### Source(s) and further reading: document store +##### Sumber dan bacaan lanjutan: gudang dokumen -* [Document-oriented database](https://en.wikipedia.org/wiki/Document-oriented_database) -* [MongoDB architecture](https://www.mongodb.com/mongodb-architecture) -* [CouchDB architecture](https://blog.couchdb.org/2016/08/01/couchdb-2-0-architecture/) -* [Elasticsearch architecture](https://www.elastic.co/blog/found-elasticsearch-from-the-bottom-up) +* [Basis data berorientasi dokumen](https://en.wikipedia.org/wiki/Document-oriented_database) +* [Arsitektur MongoDB](https://www.mongodb.com/mongodb-architecture) +* [Arsitektur CouchDB](https://blog.couchdb.org/2016/08/01/couchdb-2-0-architecture/) +* [Arsitektur Elasticsearch](https://www.elastic.co/blog/found-elasticsearch-from-the-bottom-up) -#### Wide column store +#### Gudang kolom lebar (Wide column store)


- Source: SQL & NoSQL, a brief history + Sumber: SQL & NoSQL, sejarah singkat

-> Abstraction: nested map `ColumnFamily>` +> Abstraksi: peta bersarang `ColumnFamily>` -A wide column store's basic unit of data is a column (name/value pair). A column can be grouped in column families (analogous to a SQL table). Super column families further group column families. You can access each column independently with a row key, and columns with the same row key form a row. Each value contains a timestamp for versioning and for conflict resolution. +Dasar unit data dari gudang kolom lebar adalah kolom (pasangan nama/nilai). +Kolom bisa digabung ke dalam keluarga kolom (sejalan dengan tabel SQL). +Keluarga kolom super menggabungkan keluarga kolom. +Kita bisa mengakses setiap kolom secara independen menggunakan kunci baris. +Kolom dengan kunci baris yang sama membentuk baris. +Setiap nilai mengandung cap waktu untuk kebutuh pemersian dan resolusi konflik. -Google introduced [Bigtable](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/chang06bigtable.pdf) as the first wide column store, which influenced the open-source [HBase](https://www.mapr.com/blog/in-depth-look-hbase-architecture) often-used in the Hadoop ecosystem, and [Cassandra](http://docs.datastax.com/en/cassandra/3.0/cassandra/architecture/archIntro.html) from Facebook. Stores such as BigTable, HBase, and Cassandra maintain keys in lexicographic order, allowing efficient retrieval of selective key ranges. +Google mengenalkan [Bigtable](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/chang06bigtable.pdf) sebagai gudang kolom lebar pertama. +Rancangan Bigtable mempengaruhi [HBase](https://www.mapr.com/blog/in-depth-look-hbase-architecture) yang sering digunakan pada ekosistem Hadoop dan [Cassandra](http://docs.datastax.com/en/cassandra/3.0/cassandra/architecture/archIntro.html) dari Facebook. +Gudang seperti BigTable, HBase, dan Cassandra memelihara kunci dengan urutan leksikografi yang memungkinkan pengambilan rentang kunci secara selektif. -Wide column stores offer high availability and high scalability. They are often used for very large data sets. +Gudang kolom lebar menawarkan ketersediaan dan skalabilitas tinggi. +Mereka sering kali digunakan untuk penyimpanan himpunan data yang sangat besar. -##### Source(s) and further reading: wide column store +##### Sumber dan bacaan lanjutan: gudang kolom lebar -* [SQL & NoSQL, a brief history](http://blog.grio.com/2015/11/sql-nosql-a-brief-history.html) -* [Bigtable architecture](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/chang06bigtable.pdf) -* [HBase architecture](https://www.mapr.com/blog/in-depth-look-hbase-architecture) -* [Cassandra architecture](http://docs.datastax.com/en/cassandra/3.0/cassandra/architecture/archIntro.html) +* [SQL & NoSQL, sejarah singkat](http://blog.grio.com/2015/11/sql-nosql-a-brief-history.html) +* [Arsitektur Bigtable](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/chang06bigtable.pdf) +* [Arsitektur HBase](https://www.mapr.com/blog/in-depth-look-hbase-architecture) +* [Arsitektur Cassandra](http://docs.datastax.com/en/cassandra/3.0/cassandra/architecture/archIntro.html) -#### Graph database +#### Basis data Graf (graph database)


- Source: Graph database + Sumber: Basis data graf

-> Abstraction: graph +> Abstraksi: graf -In a graph database, each node is a record and each arc is a relationship between two nodes. Graph databases are optimized to represent complex relationships with many foreign keys or many-to-many relationships. +Di dalam basis data graf, setiap simpul adalah catatan dan setiap busur adalah hubuungan antar dua simpul. +Basis data graf dioptimisasi untuk mengambarkan hubungan kompleks dengan banyak kunci asing atau hubungan banyak-ke-banyak. -Graphs databases offer high performance for data models with complex relationships, such as a social network. They are relatively new and are not yet widely-used; it might be more difficult to find development tools and resources. Many graphs can only be accessed with [REST APIs](#representational-state-transfer-rest). +Basis data graf menawarkan kinerja tinggi untuk model data dengan hubungan kompleks seperti jejaring sosial. +Basis data ini relatif baru dan belum banyak digunakan secara luas. +Hal ini menyebabkan lebih sulit menemukan alat pengembangan dan sumber daya. +Banyak graf hanya bisa diakses menggunakan [API REST](#representational-state-transfer-rest) -##### Source(s) and further reading: graph +##### Sumber dan bacaan lanjutan: graph -* [Graph database](https://en.wikipedia.org/wiki/Graph_database) +* [Basis data Graf](https://en.wikipedia.org/wiki/Graph_database) * [Neo4j](https://neo4j.com/) * [FlockDB](https://blog.twitter.com/2010/introducing-flockdb) -#### Source(s) and further reading: NoSQL +#### Sumber dan bacaan lanjutan: NoSQL -* [Explanation of base terminology](http://stackoverflow.com/questions/3342497/explanation-of-base-terminology) -* [NoSQL databases a survey and decision guidance](https://medium.com/baqend-blog/nosql-databases-a-survey-and-decision-guidance-ea7823a822d#.wskogqenq) -* [Scalability](http://www.lecloud.net/post/7994751381/scalability-for-dummies-part-2-database) -* [Introduction to NoSQL](https://www.youtube.com/watch?v=qI_g07C_Q5I) -* [NoSQL patterns](http://horicky.blogspot.com/2009/11/nosql-patterns.html) +* [Penjelasan terminologi base](http://stackoverflow.com/questions/3342497/explanation-of-base-terminology) +* [Panduan keputusan dan survei basis data NoSQL](https://medium.com/baqend-blog/nosql-databases-a-survey-and-decision-guidance-ea7823a822d#.wskogqenq) +* [Skalabilitas](http://www.lecloud.net/post/7994751381/scalability-for-dummies-part-2-database) +* [Pengantar NoSQL](https://www.youtube.com/watch?v=qI_g07C_Q5I) +* [Pola NoSQL](http://horicky.blogspot.com/2009/11/nosql-patterns.html) -### SQL or NoSQL +### SQL atau NoSQL


- Source: Transitioning from RDBMS to NoSQL + Sumber: Transisi dari RDBMS ke NoSQL

-Reasons for **SQL**: +Alasan memilih **SQL**: -* Structured data -* Strict schema -* Relational data -* Need for complex joins -* Transactions -* Clear patterns for scaling -* More established: developers, community, code, tools, etc -* Lookups by index are very fast +* Data terstruktur +* Ketat skema +* Data bersifat relasional +* Kebutuhan penggabungan yang kompleks +* Transaksi +* Pola penyekalaan jelas +* Lebih mapan: pengembang, komunitas, kode, alat-alat, dan lainnya +* Pencarian menggunakan indek sangat cepat -Reasons for **NoSQL**: +Alasan memilih **NoSQL**: -* Semi-structured data -* Dynamic or flexible schema -* Non-relational data -* No need for complex joins -* Store many TB (or PB) of data -* Very data intensive workload -* Very high throughput for IOPS +* Data semi terstruktur +* Skema fleksible dan dinamis +* Data bersifat tidak relasional +* Tidak perlu penggabungan yang kompleks +* Menyimpan banyak TB (bahkan PB) data +* Beban kerja yang sangat intens akan data +* Lewatan sangat tinggi untuk keluaran masukan per detik -Sample data well-suited for NoSQL: +Contoh data yang cocok untuk NoSQL: -* Rapid ingest of clickstream and log data -* Leaderboard or scoring data -* Temporary data, such as a shopping cart -* Frequently accessed ('hot') tables -* Metadata/lookup tables +* Mengkonsumsi secara cepat data *clickstream* dan log +* Papan peringkat atau data penilaian +* Data sementara seperti keranjang belanja +* Tabel yang sering diakses (tabel 'panas') +* Tabel metadata/pencarian -##### Source(s) and further reading: SQL or NoSQL +##### Sumber dan bacaan lanjutan: SQL atau NoSQL -* [Scaling up to your first 10 million users](https://www.youtube.com/watch?v=w95murBkYmU) -* [SQL vs NoSQL differences](https://www.sitepoint.com/sql-vs-nosql-differences/) +* [Penyekalaan untuk 10 juta pengguna pertama](https://www.youtube.com/watch?v=w95murBkYmU) +* [Perbedaan SQL vs NoSQL](https://www.sitepoint.com/sql-vs-nosql-differences/) ## Singgahan From 598a1e97fd659b8f6bcf1e714e4b1e0a43976292 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Fri, 7 Feb 2020 15:05:26 +0700 Subject: [PATCH 22/32] Fix rancangan vs perancangan translation --- README-id.md | 62 ++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/README-id.md b/README-id.md index 7a116f8e..c967d4c1 100644 --- a/README-id.md +++ b/README-id.md @@ -1,6 +1,6 @@ *[English](README.md) ∙ [Indonesian](README-id.md) ∙ [日本語](README-ja.md) ∙ [简体中文](README-zh-Hans.md) ∙ [繁體中文](README-zh-TW.md) | [العَرَبِيَّة‎](https://github.com/donnemartin/system-design-primer/issues/170) ∙ [বাংলা](https://github.com/donnemartin/system-design-primer/issues/220) ∙ [Português do Brasil](https://github.com/donnemartin/system-design-primer/issues/40) ∙ [Deutsch](https://github.com/donnemartin/system-design-primer/issues/186) ∙ [ελληνικά](https://github.com/donnemartin/system-design-primer/issues/130) ∙ [עברית](https://github.com/donnemartin/system-design-primer/issues/272) ∙ [Italiano](https://github.com/donnemartin/system-design-primer/issues/104) ∙ [韓國語](https://github.com/donnemartin/system-design-primer/issues/102) ∙ [فارسی](https://github.com/donnemartin/system-design-primer/issues/110) ∙ [Polski](https://github.com/donnemartin/system-design-primer/issues/68) ∙ [русский язык](https://github.com/donnemartin/system-design-primer/issues/87) ∙ [Español](https://github.com/donnemartin/system-design-primer/issues/136) ∙ [ภาษาไทย](https://github.com/donnemartin/system-design-primer/issues/187) ∙ [Türkçe](https://github.com/donnemartin/system-design-primer/issues/39) ∙ [tiếng Việt](https://github.com/donnemartin/system-design-primer/issues/127) ∙ [Français](https://github.com/donnemartin/system-design-primer/issues/250) | [Add Translation](https://github.com/donnemartin/system-design-primer/issues/28)* -# Dasar Rancangan Sistem +# Dasar Perancangan Sistem

@@ -29,19 +29,19 @@ Proyek ini merupakan proyek sumber terbuka yang terus diperbarui. [Ayo kontribusi](#kontribusi) di sini! -### Persiapan wawancara rancangan sistem +### Persiapan wawancara perancangan sistem Selain wawancara pemrograman, perancangan sistem adalah salah satu **komponen yang diwajibkan** dari dari **proses wawancara teknis** di banyak perusahaan teknologi. -**Latih pertanyaan-pertanyaan umum wawancara rancangan sistem** dan **bandingkan** hasilmu dengan contoh solusi: diskusi, program, dan diagram. +**Latih pertanyaan-pertanyaan umum wawancara perancangan sistem** dan **bandingkan** hasilmu dengan contoh solusi: diskusi, program, dan diagram. Topik-topik tambahan untuk persiapan wawancara: * [Panduan belajar](#panduan-belajar) -* [Pendekatan menjawab pertanyaan wawancara rancangan sistem](#pendekatan-menjawab-pertanyaan-wawancara-rancangan-sistem) -* [Pertanyaan wawancara rancangan sistem beserta solusinya](#pertanyaan-wawancara-rancangan-sistem-beserta-solusinya) -* [Pertanyaan wawancara rancangan berbasis objek beserta solusinya](#pertanyaan-wawancara-rancangan-berbasis-objek-beserta-solusinya) -* [Tambahan pertanyaan wawancara rancangan sistem](#tambahan-pertanyaan-wawancara-rancangan-sistem) +* [Pendekatan menjawab pertanyaan wawancara perancangan sistem](#pendekatan-menjawab-pertanyaan-wawancara-perancangan-sistem) +* [Pertanyaan wawancara perancangan sistem beserta solusinya](#pertanyaan-wawancara-perancangan-sistem-beserta-solusinya) +* [Pertanyaan wawancara perancangan berbasis objek beserta solusinya](#pertanyaan-wawancara-perancangan-berbasis-objek-beserta-solusinya) +* [Tambahan pertanyaan wawancara perancangan sistem](#tambahan-pertanyaan-wawancara-perancangan-sistem) ## Kartu kilat Anki @@ -50,11 +50,11 @@ Topik-topik tambahan untuk persiapan wawancara:

-[Bungkusan kartu kilat Anki](https://apps.ankiweb.net/) yang disediakan menggunakan perulangan berjeda untuk membantu menguasai konsep-konsep kunci rancangan sistem. +[Bungkusan kartu kilat Anki](https://apps.ankiweb.net/) yang disediakan menggunakan perulangan berjeda untuk membantu menguasai konsep-konsep kunci perancangan sistem. -* [Bungkusan rancangan sistem](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/System%20Design.apkg) -* [Bungkusan latihan-latihan rancangan sistem](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/System%20Design%20Exercises.apkg) -* [Bungkusan latihan-latihan rancangan berbasis objek](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/OO%20Design.apkg) +* [Bungkusan perancangan sistem](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/System%20Design.apkg) +* [Bungkusan latihan-latihan perancangan sistem](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/System%20Design%20Exercises.apkg) +* [Bungkusan latihan-latihan perancangan berbasis objek](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/OO%20Design.apkg) Cocok untuk digunakan ketika dalam perjalanan. @@ -86,9 +86,9 @@ Konten yang masih memerlukan polesan ditempatkan di bagian [dalam pengembangan]( Tinjau kembali [Pedomain Kontribusi](CONTRIBUTING.md). -## Indeks topik rancangan sistem +## Indeks topik perancangan sistem -> Ringkasan dari berbagai topik rancangan sistem, termasuk kelebihan dan kekurangannya. **Segala sesuatu dalam rancangan adalah hasil kompromi**. +> Ringkasan dari berbagai topik perancangan sistem, termasuk kelebihan dan kekurangannya. **Segala sesuatu dalam perancangan adalah hasil kompromi**. > > Setiap bagian berisi tautan ke sumber daya yang lebih dalam. @@ -197,29 +197,29 @@ Apa yang menjadi pertanyaan saat Anda wawancara bergantung pada hal-hal yang tid * Perusahaan tempat Anda wawancara * Keberuntungan -Kandidat yang berpengalaman umumnya diharapkan untuk tahu lebih mengenai rancangan sistem. +Kandidat yang berpengalaman umumnya diharapkan untuk tahu lebih mengenai perancangan sistem. Arsitek atau pemimpin tim mungkin diharapkan untuk tahu lebih banyak dibandingkan kontributor perorangan. -Perusahan teknologi top kemungkinan besar mempunyai satu atau lebih sesi wawancara rancangan. +Perusahan teknologi top kemungkinan besar mempunyai satu atau lebih sesi wawancara perancangan. Mulai dari topik yang luas dan masuk lebih dalam ke beberapa area. -Pengetahuan dasar berbagai topik-topik kunci rancangan sistem akan sangat membantu. +Pengetahuan dasar berbagai topik-topik kunci perancangan sistem akan sangat membantu. Sesuaikan panduan berikut berdasarkan waktu, pengalaman, posisi yang dilamar, dan perusahan tempat Anda wawancara. -* **Garis waktu pendek** - Bidik topik-topik rancangan sistem secara luas. Latih dengan cara menjawab beberapa pertanyaan wawancara. -* **Garis waktu sedang** - Bidik topik-topik rancangan sistem secara luas dan perdalam dibeberapa bagian tertentu. Latih dengan cara menjawab banyak pertanyaan wawancara. -* **Garis waktu panjang** - Bidik topik-topik rancangan sistem secara laus dan mendalam. Latih dengan cara menyelesaikan seluruh pertanyaan wawancara. +* **Garis waktu pendek** - Bidik topik-topik perancangan sistem secara luas. Latih dengan cara menjawab beberapa pertanyaan wawancara. +* **Garis waktu sedang** - Bidik topik-topik perancangan sistem secara luas dan perdalam dibeberapa bagian tertentu. Latih dengan cara menjawab banyak pertanyaan wawancara. +* **Garis waktu panjang** - Bidik topik-topik perancangan sistem secara laus dan mendalam. Latih dengan cara menyelesaikan seluruh pertanyaan wawancara. | | Short | Medium | Long | |---|---|---|---| -| Baca sampai habis [Indeks topik rancangan sistem](#indeks-topik-rancangan-sistem) untuk pemahaman secara luas bagaimana cara kerja suatu sistem | :+1: | :+1: | :+1: | +| Baca sampai habis [Indeks topik perancangan sistem](#indeks-topik-perancangan-sistem) untuk pemahaman secara luas bagaimana cara kerja suatu sistem | :+1: | :+1: | :+1: | | Baca sampai habis beberapa artikel di [Blog teknik perusahaan](#blog-teknik-perusahaan) untuk perusahaan tempat Anda wawancara | :+1: | :+1: | :+1: | | Baca sampai habis beberapa [Arsitektur dunia nyata](#arsitektur-dunia-nyata) | :+1: | :+1: | :+1: | -| Ulas [Pendekatan menjawab pertanyaan wawancara rancangan sistem](#pendekatan-menjawab-pertanyaan-wawancara-rancangan-sistem) | :+1: | :+1: | :+1: | -| Tinjau [Pertanyaan wawancara rancangan sistem beserta solusinya](#pertanyaan-wawancara-rancangan-sistem-beserta-solusinya) | Some | Many | Most | -| Teliti [Pertanyaan wawancara rancangan berbasis objek beserta solusinya](#pertanyaan-wawancara-rancangan-berbasis-objek-beserta-solusinya) | Some | Many | Most | -| Periksa [Tambahan pertanyaan wawancara rancangan sistem](#tambahan-pertanyaan-wawancara-rancangan-sistem) | Some | Many | Most | +| Ulas [Pendekatan menjawab pertanyaan wawancara perancangan sistem](#pendekatan-menjawab-pertanyaan-wawancara-perancangan-sistem) | :+1: | :+1: | :+1: | +| Tinjau [Pertanyaan wawancara perancangan sistem beserta solusinya](#pertanyaan-wawancara-perancangan-sistem-beserta-solusinya) | Some | Many | Most | +| Teliti [Pertanyaan wawancara perancangan berbasis objek beserta solusinya](#pertanyaan-wawancara-perancangan-berbasis-objek-beserta-solusinya) | Some | Many | Most | +| Periksa [Tambahan pertanyaan wawancara perancangan sistem](#tambahan-pertanyaan-wawancara-perancangan-sistem) | Some | Many | Most | -## Pendekatan menjawab pertanyaan wawancara rancangan sistem +## Pendekatan menjawab pertanyaan wawancara perancangan sistem > Cara menangani pertanyaan wawancara perancangan sistem. @@ -227,7 +227,7 @@ Wawancara perancangan sistem adalah pembicaraan yang bersifat terbuka. Kita diharapkan untuk menuntun pembicaraan tersebut. Kita dapat menggunakan langkah-langkah berikut untuk menuntun diskusi. -Untuk memperkuat proses diskusi, ulas bagian [Pertanyaan wawancara rancangan sistem beserta solusinya](#pertanyaan-wawancara-rancangan-sistem-beserta-solusinya) menggunakan langkah-langkah berikut. +Untuk memperkuat proses diskusi, ulas bagian [Pertanyaan wawancara perancangan sistem beserta solusinya](#pertanyaan-wawancara-rancangan-sistem-beserta-solusinya) menggunakan langkah-langkah berikut. ### Langkah 1: Uraikan kasus penggunaan, batasan, dan asumsi @@ -276,7 +276,7 @@ Sebagai contoh, apakah diperlukan hal-hal berikut untuk menangani masalah skalab Diskusikan potensi solusi dan kompromi. Segala sesuatunya adalah hasil kompromi. -Tangani kemacetan menggunakan [prinsip-prinsip perancangan sistem terskala](#indeks-topik-rancangan-sistem). +Tangani kemacetan menggunakan [prinsip-prinsip perancangan sistem terskala](#indeks-topik-perancangan-sistem). ### Kalkulasi belakang amplop @@ -295,7 +295,7 @@ Periksa tautan-tautan berikut untuk lebih memahami apa yang diharapkan saat wawa * [Wawancara perancangan sistem](http://www.hiredintech.com/system-design) * [Pengantar Arsitektur dan Wawancara Perancangan Sistem](https://www.youtube.com/watch?v=ZgdS0EUmn70) -## Pertanyaan wawancara rancangan sistem beserta solusinya +## Pertanyaan wawancara perancangan sistem beserta solusinya > Pertanyaan umum pada wawancara perancangan sistem beserta contoh diskusi, kode, dan diagram. > @@ -362,7 +362,7 @@ Periksa tautan-tautan berikut untuk lebih memahami apa yang diharapkan saat wawa ![Imgur](http://i.imgur.com/jj3A5N8.png) -## Pertanyaan wawancara rancangan berbasis objek beserta solusinya +## Pertanyaan wawancara perancangan berbasis objek beserta solusinya > Pertanyaan umum pada wawancara perancangan berbasis objek beserta diskusi, code, dan diagram. > @@ -1007,7 +1007,7 @@ Operasi baca yang memerlukan penggabungan basis data yang kompleks bisa menjadi ##### Kekurangan: denormalisasi * Data punya salinan. -* Batasan bisa membantu salinan informasi yang berlebihan untuk tetap sinkron yang berdampak pada meningkatnya kompleksitas rancangan basis data. +* Batasan (constraint) bisa membantu salinan informasi yang berlebihan untuk tetap sinkron yang berdampak pada meningkatnya kompleksitas rancangan basis data. * Basis data denormalisasi dengan beban operasi tulis berat mungkin kinerjanya akan lebih buruk dibandingkan basis data ternormalisasi. ###### Sumber dan bacaan lanjutan: denormalisasi @@ -1744,7 +1744,7 @@ Handy metrics based on numbers above: * [Designs, lessons, and advice from building large distributed systems](http://www.cs.cornell.edu/projects/ladis2009/talks/dean-keynote-ladis2009.pdf) * [Software Engineering Advice from Building Large-Scale Distributed Systems](https://static.googleusercontent.com/media/research.google.com/en//people/jeff/stanford-295-talk.pdf) -### Tambahan pertanyaan wawancara rancangan sistem +### Tambahan pertanyaan wawancara perancangan sistem > Common system design interview questions, with links to resources on how to solve each. From 3abe1fcd10dc8053f2998d904263865a123359df Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Fri, 7 Feb 2020 16:28:54 +0700 Subject: [PATCH 23/32] Translate section 21: Cache --- README-id.md | 183 ++++++++++++++++++++++++++++----------------------- 1 file changed, 99 insertions(+), 84 deletions(-) diff --git a/README-id.md b/README-id.md index c967d4c1..b590eeba 100644 --- a/README-id.md +++ b/README-id.md @@ -1233,86 +1233,97 @@ Contoh data yang cocok untuk NoSQL:


- Source: Scalable system design patterns + Sumber: Pola perancangan sistem terskala

-Caching improves page load times and can reduce the load on your servers and databases. In this model, the dispatcher will first lookup if the request has been made before and try to find the previous result to return, in order to save the actual execution. +Singgahan memperbaiki waktu pemuatan halaman dan bisa mengurangi beban pada server dan database. +Pada model ini, dispatcher pertama-tama akan mencari apakah permintaan sudah pernah diajukan sebelumnya dan mencoba mencari hasil sebelumnya untuk dikembalikan untuk menghemat eksekusi yang sebenarnya. -Databases often benefit from a uniform distribution of reads and writes across its partitions. Popular items can skew the distribution, causing bottlenecks. Putting a cache in front of a database can help absorb uneven loads and spikes in traffic. +Basis data umumnya mendapat manfaat dari distribusi yang merata antara operasi baca dan tulis lintas partisi. +Butir yang populer bisa memiringkan penyaluran yang menyebabkan kemacetan. +Penempatan singgahan di depan database akan membantu menyerap beban yang tidak merata dan lonjakan lalu lintas. -### Client caching +### Singgahan klien -Caches can be located on the client side (OS or browser), [server side](#reverse-proxy-web-server), or in a distinct cache layer. +Singgahan bisa tersedia pada sisi klien (Misalkan sistem operasi dan peramban), [sisi server](#proksi-terbalik-server-web), atau lapisan singgahan tersendiri. -### CDN caching +### Singgahan CDN -[CDNs](#content-delivery-network) are considered a type of cache. +[CDNs](#content-delivery-network) dianggap sebagai jenis singgahan. -### Web server caching +### Singgahan server web -[Reverse proxies](#reverse-proxy-web-server) and caches such as [Varnish](https://www.varnish-cache.org/) can serve static and dynamic content directly. Web servers can also cache requests, returning responses without having to contact application servers. +[Proksi terbalik](#proksi-terbalik-server-web) dan singgahan seperti [Varnish](https://www.varnish-cache.org/) mampu melayani konten statis dan dinamis secara langsung. +Server web juga bisa menyinggahi permintaan, mengembalikan tanggapan tanpa perlu mengontak server aplikasi. -### Database caching +### Singgahan basis data -Your database usually includes some level of caching in a default configuration, optimized for a generic use case. Tweaking these settings for specific usage patterns can further boost performance. +Basis data biasanya menyertakan berbagai level singgahan dalam konfigurasi bawaan yang dioptimasi untuk kebutuhan general. +Mengubah pengaturan untuk pola tertentu bisa meningkatkan kinerja basis data. -### Application caching +### Singgahan aplikasi -In-memory caches such as Memcached and Redis are key-value stores between your application and your data storage. Since the data is held in RAM, it is much faster than typical databases where data is stored on disk. RAM is more limited than disk, so [cache invalidation](https://en.wikipedia.org/wiki/Cache_algorithms) algorithms such as [least recently used (LRU)](https://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used) can help invalidate 'cold' entries and keep 'hot' data in RAM. +Singgahan dalam memori seperti Memcahed dan Redis adalah gudang kunci-nilai antara aplikasi kita dengan penyimpanan data. +Karena data tersimpan di memori, pengambilan data menjadi lebih cepat dibandingkan basis data yang menyimpan data di disk. +RAM lebih terbatas dibandingkan disk sehingga algoritma [invalidasi singgahan](https://en.wikipedia.org/wiki/Cache_algorithms) seperti [least recently used (LRU)](https://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used) bisa membantu menginvalidasi entri 'dingin' dan mempertahankan entri 'panas' di RAM. -Redis has the following additional features: +Redis memiliki fitur tambahan berikut: -* Persistence option -* Built-in data structures such as sorted sets and lists +* Opsi persisten +* Struktur data bawaan seperti himpunan terurut dan lis -There are multiple levels you can cache that fall into two general categories: **database queries** and **objects**: +Ada beberapa level yang dapat kita cache yang secara umum terbagi menjadi 2 kategori: **kueri basis data** dan **objek**: -* Row level -* Query-level -* Fully-formed serializable objects -* Fully-rendered HTML +* Level baris +* Level kueri +* Objek yang bisa diserialisasi dalam bentuk penuh +* HTML yang sudah disajikan sepenuhnya -Generally, you should try to avoid file-based caching, as it makes cloning and auto-scaling more difficult. +Secara umum, kita seharusnya menghindari singgahan berbasis file karena hal ini menyebabkan pengklonaan dan penyekalaan otomatis menjadi lebih sulit. -### Caching at the database query level +### Singgahan pada level kueri basis data -Whenever you query the database, hash the query as a key and store the result to the cache. This approach suffers from expiration issues: +Setiap kali kita mengkueri basis data, cincang kueri untuk jadi kunci dan simpan hasil kueri ke singgahan. +Pendekatan ini memiliki kelemahan dari sisi kedaluarsa: -* Hard to delete a cached result with complex queries -* If one piece of data changes such as a table cell, you need to delete all cached queries that might include the changed cell +* Susah menghapus hasil singgahan dengan kueri kompleks +* Jika satu potong data berubah contohnya sel tabel, kita perlu menghapus seluruh kueri singgahan yang mungkin di dalamnya termasuk sel yang berubah. -### Caching at the object level +### Singgahan pada level objek -See your data as an object, similar to what you do with your application code. Have your application assemble the dataset from the database into a class instance or a data structure(s): +Perlakukan data kita sebagai objek sebagaimana kita memperlakukan kode aplikasi. +Biarkan aplikasi kita mengumpulkan himpunan data dari basis data menjadi objek kelas atau struktur data: -* Remove the object from cache if its underlying data has changed -* Allows for asynchronous processing: workers assemble objects by consuming the latest cached object +* Hapus objek dari singgahan jika dasar datanya berubah +* Ijinkan pemrosesan asinkron: pekerja mengumpulkan objek dengan cara mengkonsumsi objek singgahan terbaru -Suggestions of what to cache: +Saran akan apa saja yang disinggahi: -* User sessions -* Fully rendered web pages -* Activity streams -* User graph data +* Sesi pengguna +* Halaman web yang sudah disajikan secara penuh +* Aliran aktivitas +* Data graf pengguna -### When to update the cache +### Kapan singgahan diperbarui -Since you can only store a limited amount of data in cache, you'll need to determine which cache update strategy works best for your use case. +Karena kita hanya bisa menyimpan data dalam jumlah terbatas pada singgahan, kita perlu menentukan strategi memperbarui singgahan yang bekerja paling baik untuk kasus penggunan kita. -#### Cache-aside +#### Singgahan sampingan (Cache-aside)


- Source: From cache to in-memory data grid + Sumber: Dari singgahan menuju kisi data dalam memori

-The application is responsible for reading and writing from storage. The cache does not interact with storage directly. The application does the following: +Aplikasi bertanggung jawab membaca dan menulis dari penyimpanan. +Singgahan tidak berinteraksi dengan penyimpanan secara langsung. +Aplikasi melakukan hal berikut: -* Look for entry in cache, resulting in a cache miss -* Load entry from the database -* Add entry to cache -* Return entry +* Mencari entri di singgahan yang menghasilkan entri luput +* Muat entri dari basis data +* Simpan entri ke dalam singgahan +* Kembalikan entri ```python def get_user(self, user_id): @@ -1325,37 +1336,39 @@ def get_user(self, user_id): return user ``` -[Memcached](https://memcached.org/) is generally used in this manner. +[Memcached](https://memcached.org/) umumnya digunakan untuk kasus seperti di atas. -Subsequent reads of data added to cache are fast. Cache-aside is also referred to as lazy loading. Only requested data is cached, which avoids filling up the cache with data that isn't requested. +Operasi pembacaan data selanjutnya menjadi cepat. +Singgahan sampingan dikenal juga dengan istilah _lazy loading_. +Hanya data yang diminta yang ada disinggahan sehingga menghindari singgahan penuh dengan data yang tidak diminta. -##### Disadvantage(s): cache-aside +##### Kekurangan: singgahan sampingan -* Each cache miss results in three trips, which can cause a noticeable delay. -* Data can become stale if it is updated in the database. This issue is mitigated by setting a time-to-live (TTL) which forces an update of the cache entry, or by using write-through. -* When a node fails, it is replaced by a new, empty node, increasing latency. +* Setiap singgahan yang luput menghasilkan tiga perjalanan yang dapat menyebabkan jeda nyata. +* Data bisa kedaluarsa jika data diperbarui pada basis data. Masalah ini dimitigasi dengan aturan masa berlaku yang memaksa pembaruan entri singgahan atau menggunakan mekanisme _write-through_. +* Ketika simpul gagal, simpul digantikan oleh simpul yang baru yang kosong sehingga meningkatkan latensi. #### Write-through


- Source: Scalability, availability, stability, patterns + Sumber: Skalabilitas, ketersedian, stabilitas, pola

-The application uses the cache as the main data store, reading and writing data to it, while the cache is responsible for reading and writing to the database: +Aplikasi menggunakan singgahan sebagai gudang data utama, membaca dan menulis data ke singgahan sementara singgahan bertanggung jawab membaca dan menulis ke basis data: -* Application adds/updates entry in cache -* Cache synchronously writes entry to data store -* Return +* Aplikasi menambah/mengubah entri pada singgahan +* Singgahan secara sinkron menulis entri ke gudang data +* Kembali -Application code: +Kode aplikasi: ```python set_user(12345, {"foo":"bar"}) ``` -Cache code: +Kode singgahan: ```python def set_user(user_id, values): @@ -1363,61 +1376,63 @@ def set_user(user_id, values): cache.set(user_id, user) ``` -Write-through is a slow overall operation due to the write operation, but subsequent reads of just written data are fast. Users are generally more tolerant of latency when updating data than reading data. Data in the cache is not stale. +Write-through adalah operasi yang lambat secara keseluruhan karena beban operasi menulis, tetapi operasi baca selanjutnya terhadap data yang baru ditulis menjadi cepat. +Pengguna umumnya lebih toleran terhadap latensi ketika mengubah data dibandingkan membaca data. +Data di dalam singgahan tidak kedaluarsa. -##### Disadvantage(s): write through +##### Kekurangan: write through -* When a new node is created due to failure or scaling, the new node will not cache entries until the entry is updated in the database. Cache-aside in conjunction with write through can mitigate this issue. -* Most data written might never be read, which can be minimized with a TTL. +* Ketika simpul baru diciptakan karena kegagalan atau penyekalaan, simpul baru tersebut tidak menyimpan entri sampai entri diperbarui di basis data. Singgahan sampingan bersamaan dengan _write-through_ dapat meringakan masalah ini. +* Kebanyakan data yang tertulis mungkin tidak pernah dibaca. Hal ini bisa diminimalkan dengan masa berlaku. #### Write-behind (write-back)


- Source: Scalability, availability, stability, patterns + Sumber: Sumber: Skalabilitas, ketersedian, stabilitas, pola

-In write-behind, the application does the following: +Pada *write-behind*, aplikasi melakukan hal berikut: -* Add/update entry in cache -* Asynchronously write entry to the data store, improving write performance +* Menambah/memperbarui entri pada singgahan +* Secara asinkron menuliskan entri ke gudang data untuk meningkatkan kinerja -##### Disadvantage(s): write-behind +##### Kekurangan: write-behind -* There could be data loss if the cache goes down prior to its contents hitting the data store. -* It is more complex to implement write-behind than it is to implement cache-aside or write-through. +* Ada potensi kehilangan data jika singgahan mati sebelum konten tersimpan ke gudang data. +* Lebih kompleks untuk diimplementasikan dibandingkan singgahan sampingan dan _write-through_. #### Refresh-ahead


- Source: From cache to in-memory data grid + Sumber: Dari singgahan menuju kisi data dalam memori

-You can configure the cache to automatically refresh any recently accessed cache entry prior to its expiration. +Kita dapat mengkonfigurasi singgahan agar secara otomatis menyegarkan entri singgahan yang paling baru diakses sebelum waktu kedaluarsa. -Refresh-ahead can result in reduced latency vs read-through if the cache can accurately predict which items are likely to be needed in the future. +_Refresh-ahead_ bisa menghasilkan pengurangan latensi dibandingkan _read-through_ jika singgahan bisa memprediksi dengan akurat butir-butir mana yang kemungkinan besar dibutuhkan di masa yang akan datang. -##### Disadvantage(s): refresh-ahead +##### Kekurangan: refresh-ahead -* Not accurately predicting which items are likely to be needed in the future can result in reduced performance than without refresh-ahead. +* Kesalahan prediksi butir yang kemungkinan dibutuhkan di masa yang akan datang bisa berdampak pada penurunan kinerja jika dibandingkan dengan singgahan tanpa _refresh-ahead_. -### Disadvantage(s): cache +### Kekurangan: singgahan -* Need to maintain consistency between caches and the source of truth such as the database through [cache invalidation](https://en.wikipedia.org/wiki/Cache_algorithms). -* Cache invalidation is a difficult problem, there is additional complexity associated with when to update the cache. -* Need to make application changes such as adding Redis or memcached. +* Perlu memelihara konsistensi antara singgahan dan sumber kebenaran seperti basis data melalui [invalidasi singgahan](https://en.wikipedia.org/wiki/Cache_algorithms). +* Invalidasi cache adalah masalah sulit. Tambahan kompleksitas lainnya adalah penentuan waktu untuk memperbarui singgahan. +* Perlu mengubah aplikasi contohnya menambahkan Redis atau Memcached. -### Source(s) and further reading +### Sumber dan bacaan lanjutan: -* [From cache to in-memory data grid](http://www.slideshare.net/tmatyashovsky/from-cache-to-in-memory-data-grid-introduction-to-hazelcast) -* [Scalable system design patterns](http://horicky.blogspot.com/2010/10/scalable-system-design-patterns.html) -* [Introduction to architecting systems for scale](http://lethain.com/introduction-to-architecting-systems-for-scale/) -* [Scalability, availability, stability, patterns](http://www.slideshare.net/jboner/scalability-availability-stability-patterns/) -* [Scalability](http://www.lecloud.net/post/9246290032/scalability-for-dummies-part-3-cache) -* [AWS ElastiCache strategies](http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Strategies.html) +* [Dari singgahan menuju kisi data dalam memori](http://www.slideshare.net/tmatyashovsky/from-cache-to-in-memory-data-grid-introduction-to-hazelcast) +* [Pola perancangan sistem terskala](http://horicky.blogspot.com/2010/10/scalable-system-design-patterns.html) +* [Pengantar arsitektur sistem terskala](http://lethain.com/introduction-to-architecting-systems-for-scale/) +* [Skalabilitas, ketersediaan, kestabilan, pola](http://www.slideshare.net/jboner/scalability-availability-stability-patterns/) +* [Skalabilitas](http://www.lecloud.net/post/9246290032/scalability-for-dummies-part-3-cache) +* [Strategi AWS ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Strategies.html) * [Wikipedia](https://en.wikipedia.org/wiki/Cache_(computing)) ## Asinkronisme From 05f2ead9f8e833f8b8b724076fab3d01dc9f499c Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Fri, 7 Feb 2020 17:01:32 +0700 Subject: [PATCH 24/32] Translate section 22: Asynchronism --- README-id.md | 53 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/README-id.md b/README-id.md index b590eeba..e27aa3a3 100644 --- a/README-id.md +++ b/README-id.md @@ -1440,46 +1440,55 @@ _Refresh-ahead_ bisa menghasilkan pengurangan latensi dibandingkan _read-through


- Source: Intro to architecting systems for scale + Sumber: Pengantar arsitektur sistem terskala

-Asynchronous workflows help reduce request times for expensive operations that would otherwise be performed in-line. They can also help by doing time-consuming work in advance, such as periodic aggregation of data. +Alur kerja asinkron membantu mengurangi waktu permintaan untuk operasi mahal yang sebaliknya dilakukan dalam barisan. +Alur kerja ini juga dapat membantu terlebih dahulu mengerjakan pekerjaan yang memakan waktu seperti agregasi data berkala. -### Message queues +### Antrian pesan (Message queues) -Message queues receive, hold, and deliver messages. If an operation is too slow to perform inline, you can use a message queue with the following workflow: +Antrian pesan menerima, menahan, dan mengirimkan pesan. +Jika operasi terlalu lambat dilakukan secara berurutan, kita dapat menggunakan antrian pesan dengan alur kerja sebagai berikut: -* An application publishes a job to the queue, then notifies the user of job status -* A worker picks up the job from the queue, processes it, then signals the job is complete +* Aplikasi menerbitkan kerjaan ke antrian, kemudian memberitahu penggunan tentang status pekerjaan +* Pekerja akan mengambil pekerjaan dari antrian, memproses pekerjaan tersebut, kemudian memberi isyarat ketika pekerjaan selesai -The user is not blocked and the job is processed in the background. During this time, the client might optionally do a small amount of processing to make it seem like the task has completed. For example, if posting a tweet, the tweet could be instantly posted to your timeline, but it could take some time before your tweet is actually delivered to all of your followers. +Pengguna tidak terhambat dan pekerjaan bisa diproses dibelakang layar. +Selama periode ini, klien bisa melakukan pemrosesan kecil-kecilan supaya kelihatan pekerjaan telah selesai. +Contohnya, ketika mengirimkan sebuah tweet, tweet bisa saja muncul secara instan di linimasa kita, tetapi tweet akan membutuhkan waktu untuk bisa muncul di linimasa pengikut kita. -**[Redis](https://redis.io/)** is useful as a simple message broker but messages can be lost. +**[Redis](https://redis.io/)** adalah broker pesan sederhana yang berguna dimana pesan bisa hilang. -**[RabbitMQ](https://www.rabbitmq.com/)** is popular but requires you to adapt to the 'AMQP' protocol and manage your own nodes. +**[RabbitMQ](https://www.rabbitmq.com/)** adalah antrian pesan yang populer yang mengharuskan kita untuk beradaptasi dengan protokol 'AMQP' dan mengelola simpul kita sendiri. -**[Amazon SQS](https://aws.amazon.com/sqs/)** is hosted but can have high latency and has the possibility of messages being delivered twice. +**[Amazon SQS](https://aws.amazon.com/sqs/)** adalah antrian pesan yang dikelola oleh pihak lain dimana ada kemungkinan latensi yang tinggi. Kemungkinan lain adalah pesan dikirimkan lebih dari sekali. -### Task queues +### Antrian tugas -Tasks queues receive tasks and their related data, runs them, then delivers their results. They can support scheduling and can be used to run computationally-intensive jobs in the background. +Antrian tugas menerima tugas dan data lainnya, menjalankan tugas tersebut, dan kemudian mengirimkan hasilnya. +Antrian tugas mendukung penjadwalan dan bisa digunakan untuk menjalankan tugas komputasi intens di belakang layar. -**Celery** has support for scheduling and primarily has python support. +**Celery** adalah antrian tugas yang memiliki support python yang baik. Selain itu Celery juga mendukung untuk penjadwalan. -### Back pressure +### Tekanan balik (Back pressure) -If queues start to grow significantly, the queue size can become larger than memory, resulting in cache misses, disk reads, and even slower performance. [Back pressure](http://mechanical-sympathy.blogspot.com/2012/05/apply-back-pressure-when-overloaded.html) can help by limiting the queue size, thereby maintaining a high throughput rate and good response times for jobs already in the queue. Once the queue fills up, clients get a server busy or HTTP 503 status code to try again later. Clients can retry the request at a later time, perhaps with [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff). +Jika antrian mulai tumbuh secara signifikan maka ukuran antrian menjadi lebih lebih besar dibandingkan ukuran memori. +Hal ini mengakibatkan singgahan luput, operasi baca disk, dan bahkan kinerja yang lebih lambat. +[Tekanan balik](http://mechanical-sympathy.blogspot.com/2012/05/apply-back-pressure-when-overloaded.html) membantu dengan cara membatasi ukuran antrian dengan demikian memelihara laju lewatan tinggi dan waktu tanggap yang baik bagi pekerjaan yang ada di dalam antrian. +Ketika antrian penuh, klien memperoleh balasan server sibuk atau HTTP code status 503 untuk mencoba lagi di waktu yang akan datang. +Klien dapat mencoba mengiriman permintaan lagi di waktu yang akan datang dengan tambahan [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff). -### Disadvantage(s): asynchronism +### Kekurangan: asinkronisme -* Use cases such as inexpensive calculations and realtime workflows might be better suited for synchronous operations, as introducing queues can add delays and complexity. +* Kasus penggunaan seperti kalkulasi yang tidak mahal dan alur kerja waktu nyata lebih cocok untuk operasi secara sinkron. Penambahan antrian meningkatkan jeda dan kompleksitas. -### Source(s) and further reading +### Sumber dan bacaan lanjutan: -* [It's all a numbers game](https://www.youtube.com/watch?v=1KRYH75wgy4) -* [Applying back pressure when overloaded](http://mechanical-sympathy.blogspot.com/2012/05/apply-back-pressure-when-overloaded.html) -* [Little's law](https://en.wikipedia.org/wiki/Little%27s_law) -* [What is the difference between a message queue and a task queue?](https://www.quora.com/What-is-the-difference-between-a-message-queue-and-a-task-queue-Why-would-a-task-queue-require-a-message-broker-like-RabbitMQ-Redis-Celery-or-IronMQ-to-function) +* [Semua ini adalah permainan angka](https://www.youtube.com/watch?v=1KRYH75wgy4) +* [Menerapkan tekanan balik ketika kelebihan beban](http://mechanical-sympathy.blogspot.com/2012/05/apply-back-pressure-when-overloaded.html) +* [Hukum Little](https://en.wikipedia.org/wiki/Little%27s_law) +* [Apa perbedaan antara antrian pesan dan antrian tugas?](https://www.quora.com/What-is-the-difference-between-a-message-queue-and-a-task-queue-Why-would-a-task-queue-require-a-message-broker-like-RabbitMQ-Redis-Celery-or-IronMQ-to-function) ## Komunikasi From 69bce3813b902444e5d84bd2c11534e5ab4a6e4a Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Mon, 10 Feb 2020 17:52:48 +0700 Subject: [PATCH 25/32] Translate section 23: Communication --- README-id.md | 206 +++++++++++++++++++++++++++++---------------------- 1 file changed, 119 insertions(+), 87 deletions(-) diff --git a/README-id.md b/README-id.md index e27aa3a3..61a04bf4 100644 --- a/README-id.md +++ b/README-id.md @@ -1495,78 +1495,94 @@ Klien dapat mencoba mengiriman permintaan lagi di waktu yang akan datang dengan


- Source: OSI 7 layer model + Sumber: Model 7 lapisan OSI

### Hypertext transfer protocol (HTTP) -HTTP is a method for encoding and transporting data between a client and a server. It is a request/response protocol: clients issue requests and servers issue responses with relevant content and completion status info about the request. HTTP is self-contained, allowing requests and responses to flow through many intermediate routers and servers that perform load balancing, caching, encryption, and compression. +HTTP adalah metode pengkodean dan pengiriman data antara klien dan server. +HTTP merupakan protokol permintaan/tanggapan dimana klien mengirimkan permintaan dan server menerbitkan tanggapan dengan konten yang relevan dan informasi status penyelesaian mengenai permintaan klien. +HTTP bersifat mandiri, memungkinkan permintaan dan tanggapan mengalir melewati berbagai perute menengah dan server yang melakukan penyeimbangan beban, persinggahan, enkripsi, dan kompresi. -A basic HTTP request consists of a verb (method) and a resource (endpoint). Below are common HTTP verbs: +Dasar permintaan HTTP terdiri dari kata kerja (metode) dan sumber daya (endpoint). +Berikut adalah kata kerja HTTP yang umum: -| Verb | Description | Idempotent* | Safe | Cacheable | +| Kata kerja | Deskripsi | Idempoten* | Aman | Bisa disinggahkan | |---|---|---|---|---| -| GET | Reads a resource | Yes | Yes | Yes | -| POST | Creates a resource or trigger a process that handles data | No | No | Yes if response contains freshness info | -| PUT | Creates or replace a resource | Yes | No | No | -| PATCH | Partially updates a resource | No | No | Yes if response contains freshness info | -| DELETE | Deletes a resource | Yes | No | No | +| GET | Membaca sumber daya | Ya | Ya | Ya | +| POST | Menciptakan sumber daya atau memicu proses yang menangani data | Tidak | Tidak | Ya jika tanggapan berisi informasi kesegaran | +| PUT | Menciptakan atau mengganti sumber daya | Ya | Tidak | Tidak | +| PATCH | Memperbarui sebagian sumber daya | Tidak | Tidak | Ya jika tanggapan berisi informasi kesegaran | +| DELETE | Menghapus sumber daya | Ya | Tidak | Tidak | -*Can be called many times without different outcomes. +*Menghasilkan hasil yang sama ketika dipanggil berkali-kali. -HTTP is an application layer protocol relying on lower-level protocols such as **TCP** and **UDP**. +HTTP adalah protokol pada lapisan aplikasi yang bergantung pada protokol lapisan bawah seperti **TCP** dan **UDP**. -#### Source(s) and further reading: HTTP +#### Sumber dan bacaan lanjutan: HTTP -* [What is HTTP?](https://www.nginx.com/resources/glossary/http/) -* [Difference between HTTP and TCP](https://www.quora.com/What-is-the-difference-between-HTTP-protocol-and-TCP-protocol) -* [Difference between PUT and PATCH](https://laracasts.com/discuss/channels/general-discussion/whats-the-differences-between-put-and-patch?page=1) +* [Apakah HTTP itu?](https://www.nginx.com/resources/glossary/http/) +* [Perbedaan antara HTTP dan TCP](https://www.quora.com/What-is-the-difference-between-HTTP-protocol-and-TCP-protocol) +* [Perbedaan antara PUT dan PATCH](https://laracasts.com/discuss/channels/general-discussion/whats-the-differences-between-put-and-patch?page=1) ### Transmission control protocol (TCP)


- Source: How to make a multiplayer game + Sumber: Bagaimana membuat permainan banyak pemain

-TCP is a connection-oriented protocol over an [IP network](https://en.wikipedia.org/wiki/Internet_Protocol). Connection is established and terminated using a [handshake](https://en.wikipedia.org/wiki/Handshaking). All packets sent are guaranteed to reach the destination in the original order and without corruption through: +TCP adalah protokol berorientasi koneksi yang melalui [jaringan IP](https://en.wikipedia.org/wiki/Internet_Protocol) +Koneksi dibangun dan diterminasi menggunakan [salam](https://en.wikipedia.org/wiki/Handshaking) +Seluruh paket yang dikirim dijamin akan mencapai tujuan sesuai dengan urutan pengiriman tanpa korupsi melalui: -* Sequence numbers and [checksum fields](https://en.wikipedia.org/wiki/Transmission_Control_Protocol#Checksum_computation) for each packet -* [Acknowledgement](https://en.wikipedia.org/wiki/Acknowledgement_(data_networks)) packets and automatic retransmission +* Nomor urut dan [checksum fields](https://en.wikipedia.org/wiki/Transmission_Control_Protocol#Checksum_computation) untuk setiap paket +* [Pengakuan](https://en.wikipedia.org/wiki/Acknowledgement_(data_networks)) paket dan pengiriman ulang secara otomatis -If the sender does not receive a correct response, it will resend the packets. If there are multiple timeouts, the connection is dropped. TCP also implements [flow control](https://en.wikipedia.org/wiki/Flow_control_(data)) and [congestion control](https://en.wikipedia.org/wiki/Network_congestion#Congestion_control). These guarantees cause delays and generally result in less efficient transmission than UDP. +Jika pengiriman tidak menerima tanggapan yang benar maka paket akan dikirim ulang. +Jika waktu habis beberapa kali maka koneksi akan batalkan. +TCP juga menjalankan [flow control](https://en.wikipedia.org/wiki/Flow_control_(data)) dan [congestion control](https://en.wikipedia.org/wiki/Network_congestion#Congestion_control). +Jaminan ini menyebabkan jeda dan menghasilkan pengiriman yang kurang efisien dibandingkan UDP. -To ensure high throughput, web servers can keep a large number of TCP connections open, resulting in high memory usage. It can be expensive to have a large number of open connections between web server threads and say, a [memcached](https://memcached.org/) server. [Connection pooling](https://en.wikipedia.org/wiki/Connection_pool) can help in addition to switching to UDP where applicable. +Untuk memastikan lewatan yang tinggi, server web membuka koneksi TCP dalam jumlah yang besar yang berdampak pada penggunaan memori yang tinggi. +Membuka koneksi dalam jumlah yang besar antara ulir server web dengan server lain seperti Memcached memiliki harga yang mahal. +[Connection pooling](https://en.wikipedia.org/wiki/Connection_pool) bisa membantu meringankan biaya koneksi selain berganti ke protokol UDP jika dirasa tepat. -TCP is useful for applications that require high reliability but are less time critical. Some examples include web servers, database info, SMTP, FTP, and SSH. +TCP berguna untuk aplikasi yang memerlukan keandalan tinggi tetapi tidak kritis terhadap waktu. +Beberapa contoh pengguna protokol TCP adalah server web, basis data, SMTP, FTP, dan SSH. -Use TCP over UDP when: +Gunakan TCP daripada UDP ketika: -* You need all of the data to arrive intact -* You want to automatically make a best estimate use of the network throughput +* Kita perlu seluruh data sampai dengan utuh +* Kita ingin secara otomatis menggunakan estimasi terbaik dari lewatan jaringan ### User datagram protocol (UDP)


- Source: How to make a multiplayer game + Sumber: Bagaimana membuat permainan banyak pemain

-UDP is connectionless. Datagrams (analogous to packets) are guaranteed only at the datagram level. Datagrams might reach their destination out of order or not at all. UDP does not support congestion control. Without the guarantees that TCP support, UDP is generally more efficient. +UDP adalah protokol tanpa koneksi. +Datagram (sepadan dengan paket) hanya dijamin pada level datagram. +Datagram mungkin mencapai tujuannya secara tidak berurut atau tidak sampai sama sekali. +UDP tidak mendukung kontrol kemacetan. +Tanpa jaminan seperti yang didukung TCP, UDP secara umum lebih efisien. -UDP can broadcast, sending datagrams to all devices on the subnet. This is useful with [DHCP](https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol) because the client has not yet received an IP address, thus preventing a way for TCP to stream without the IP address. +UDP bisa mengirimkan datagram ke seluruh perangkat yang ada di jaringan. +Hal ini berguna pada [DHCP](https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol) karena klien belum memiliki alamat IP sehingga menghalangi TCP untuk bisa bekerja. -UDP is less reliable but works well in real time use cases such as VoIP, video chat, streaming, and realtime multiplayer games. +UDP kuranga dapat diandalkan tetapi bekerja dengan baik untuk kasus penggunaan waktu nyata seperti VoIP, obrolan video, streaming, dan permain banyak pemain waktu nyata. -Use UDP over TCP when: +Gunakan UDP daripada TCP ketika: -* You need the lowest latency -* Late data is worse than loss of data -* You want to implement your own error correction +* Kita membutuhkan latensi terendah +* Data telat lebih parah dibandingkan data hilang +* Kita ingin menerapkan sendiri mekanisme koreksi kesalahan -#### Source(s) and further reading: TCP and UDP +#### Sumber dan bacaan lanjutan: TCP dan UDP * [Networking for game programming](http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/) * [Key differences between TCP and UDP protocols](http://www.cyberciti.biz/faq/key-differences-between-tcp-and-udp-protocols/) @@ -1580,21 +1596,24 @@ Use UDP over TCP when:


- Source: Crack the system design interview + Sumber: Memecahkan wawancara perangcangan sistem

-In an RPC, a client causes a procedure to execute on a different address space, usually a remote server. The procedure is coded as if it were a local procedure call, abstracting away the details of how to communicate with the server from the client program. Remote calls are usually slower and less reliable than local calls so it is helpful to distinguish RPC calls from local calls. Popular RPC frameworks include [Protobuf](https://developers.google.com/protocol-buffers/), [Thrift](https://thrift.apache.org/), and [Avro](https://avro.apache.org/docs/current/). +Pada RPC, klien menyebabkan prosedur dieksekusi pada ruang alamat berbeda, biasanya pada server jarak jauh. +Prosedur dikode dengan cara seolah-olah prosedur adalah pemanggilan lokal, menyembunyikan detail cara komunikasi antara klien program dengan server. +Pemanggilan jarak jauh biasanya lebih lambat dan kurang biasa diandalkan dibandingkan dengan pemanggilan lokal sehingga pembedaan antara pemanggilan RCP dan lokal berguna untuk dilakukan. +Kerangka kerja RPC yang popular termasuk di dalamnya adalah [Protobuf](https://developers.google.com/protocol-buffers/), [Thrift](https://thrift.apache.org/), dan [Avro](https://avro.apache.org/docs/current/). -RPC is a request-response protocol: +RPC adalah protokol permintaan-tanggapan: -* **Client program** - Calls the client stub procedure. The parameters are pushed onto the stack like a local procedure call. -* **Client stub procedure** - Marshals (packs) procedure id and arguments into a request message. -* **Client communication module** - OS sends the message from the client to the server. -* **Server communication module** - OS passes the incoming packets to the server stub procedure. -* **Server stub procedure** - Unmarshalls the results, calls the server procedure matching the procedure id and passes the given arguments. -* The server response repeats the steps above in reverse order. +* **Client program** - Memanggil prosedur rintisan klien. Parameter dikirim ke tumpukan seperti pemanggilan prosedur lokal. +* **Client stub procedure** - Menyusun id dan argumen prosedur ke dalam pesan permintaan. +* **Client communication module** - Sistem operasi mengirimkan pesan dari klien ke server. +* **Server communication module** - Sistem operasi menyampaikan paket yang datang ke prosedur rintisan server. +* **Server stub procedure** - Membongkar pesan permintaan dari klien, memanggil prosedur server yang sesuai dengan id dan menyampaikan argumen pemanggilan. +* Tanggapan server mengulangi langkah-langkah di atas dengan urutan terbalik. -Sample RPC calls: +Contoh pemanggilan RPC: ``` GET /someoperation?data=anId @@ -1605,37 +1624,39 @@ POST /anotheroperation "anotherdata": "another value" } ``` +RPC fokus pada memperlihatkan perilaku. +RPC umumnya digunakan untuk alasan kinerja pada komunikasi internal, karena kita bisa menempa pemanggilan alami sesuai dengan kebutuhan kasus penggunan kita. -RPC is focused on exposing behaviors. RPCs are often used for performance reasons with internal communications, as you can hand-craft native calls to better fit your use cases. +Pilih pustaka alamiah (alias SDK) ketika: -Choose a native library (aka SDK) when: +* Kita mengetahui platform sasaran kita. +* Kita ingin mengontrol cara akses "logik" kita. +* Kita ingin mengendalikan cara kontrol kesalahan terjadi di luar pustaka kita. +* Kinerja dan pengalaman pengguna akhir adalah perhatian utama kita. -* You know your target platform. -* You want to control how your "logic" is accessed. -* You want to control how error control happens off your library. -* Performance and end user experience is your primary concern. +API HTTP yang mengikuti REST cendrung lebih banyakan digunakan untuk API publik. -HTTP APIs following **REST** tend to be used more often for public APIs. +#### Kekurangan: RPC -#### Disadvantage(s): RPC - -* RPC clients become tightly coupled to the service implementation. -* A new API must be defined for every new operation or use case. -* It can be difficult to debug RPC. -* You might not be able to leverage existing technologies out of the box. For example, it might require additional effort to ensure [RPC calls are properly cached](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) on caching servers such as [Squid](http://www.squid-cache.org/). +* Klien RPC menjadi lebih terikat pada implementasi layanan. +* API baru perlu didefinisikan untuk setiap operasi atau kasus penggunaan baru. +* Lebih sulit untuk awakutu (debug) RPC. +* Kita mungkin tidak bisa memanfaatkan teknologi yang telah ada secara langsung. Sebagai contoh, usaha tambahakan diperlukan untuk memastikan [pemanggilan RPC disinggahkan secara tepat](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) pada server singgahan seperti [Squid](http://www.squid-cache.org/). ### Representational state transfer (REST) -REST is an architectural style enforcing a client/server model where the client acts on a set of resources managed by the server. The server provides a representation of resources and actions that can either manipulate or get a new representation of resources. All communication must be stateless and cacheable. +REST adalah gaya arsitektur menegakkan model klien/server dimana klien bertindak terhadap sekumpulan sumber daya yang dikelola oleh server. +Server menyediakan penggambaran dari sumber daya dan aksi yang dapat memanipulasi atau menciptakan penggambaran baru dari sumber daya. +Seluruh komunikasi harus nirkeadaan dan dapat disinggahkan. -There are four qualities of a RESTful interface: +Ada 4 kualitas dari antarmuka berbasis REST: -* **Identify resources (URI in HTTP)** - use the same URI regardless of any operation. -* **Change with representations (Verbs in HTTP)** - use verbs, headers, and body. -* **Self-descriptive error message (status response in HTTP)** - Use status codes, don't reinvent the wheel. -* **[HATEOAS](http://restcookbook.com/Basics/hateoas/) (HTML interface for HTTP)** - your web service should be fully accessible in a browser. +* **Identify resources (URI in HTTP)** - Menggunakan URI yang sama terlepas dari operasi apa pun itu. +* **Change with representations (Verbs in HTTP)** - Menggunakan kata kerja, tajuk, dan badan. +* **Self-descriptive error message (status response in HTTP)** - Gunakan kode status, jangan buat ulang sesuatu yang sudah ada. +* **[HATEOAS](http://restcookbook.com/Basics/hateoas/) (HTML interface for HTTP)** - Layanan web kita dapat diakses secara penuh menggunakan peramban. -Sample REST calls: +Contoh pemanggilan REST: ``` GET /someresources/anId @@ -1644,41 +1665,52 @@ PUT /someresources/anId {"anotherdata": "another value"} ``` -REST is focused on exposing data. It minimizes the coupling between client/server and is often used for public HTTP APIs. REST uses a more generic and uniform method of exposing resources through URIs, [representation through headers](https://github.com/for-GET/know-your-http-well/blob/master/headers.md), and actions through verbs such as GET, POST, PUT, DELETE, and PATCH. Being stateless, REST is great for horizontal scaling and partitioning. +REST fokus pada penampakan data. +REST meminimalkan ikatan antara klien/server dan seringkali digunakan untuk API HTTP publik. +REST menggunakan metode yang generik dan seragam untuk penampakan sumber daya melalui URIs, [penggambaran melalui tajuk](https://github.com/for-GET/know-your-http-well/blob/master/headers.md), dan aksi melalui kata kerja seperti GET, POST, PUT, DELETE, dan PATCH. +Karena nirkeadaan, REST sangat bagus untuk penyekalaan horizontal dan pemecahan. -#### Disadvantage(s): REST +#### Kekurangan: REST -* With REST being focused on exposing data, it might not be a good fit if resources are not naturally organized or accessed in a simple hierarchy. For example, returning all updated records from the past hour matching a particular set of events is not easily expressed as a path. With REST, it is likely to be implemented with a combination of URI path, query parameters, and possibly the request body. -* REST typically relies on a few verbs (GET, POST, PUT, DELETE, and PATCH) which sometimes doesn't fit your use case. For example, moving expired documents to the archive folder might not cleanly fit within these verbs. -* Fetching complicated resources with nested hierarchies requires multiple round trips between the client and server to render single views, e.g. fetching content of a blog entry and the comments on that entry. For mobile applications operating in variable network conditions, these multiple roundtrips are highly undesirable. -* Over time, more fields might be added to an API response and older clients will receive all new data fields, even those that they do not need, as a result, it bloats the payload size and leads to larger latencies. +* REST berfokus pada penampakan data. + hal ini mungkin tidak cocok ketika sumber daya tidak teratur secara alamiah atau tidak bisa diakses dalam hierarki sederhana. + Sebagai contoh, pengembalian seluruh catatan yang diperbarui beberapa jam yang lalu yang sesuai dengan sekumpulan peristiwa tertentu tidak bisa dinyatakan dengan mudah menggunakan jalan URI. + Dengan REST, contoh di atas kemungkinan besar dilaksanakan menggunakan kombinasi jalan URI, parameter kueri, dan tubuh permintaan. +* REST umumnya bergantung pada beberapa kata kerja (GET, POST, PUT, DELETE, dan PATCH) yang kadangkala tidak sesuai dengan kasus penggunaan kita. + Sebagai contoh, memindahkan dokumen kedaluarsa ke folder arsip mungkin tidak pas sepenuhnya menggunakan kata kerja tersebut. +* Pengambilan sumber daya rumit dengan hierarki bersarang memerlukan beberapa perjalanan bolak-balik antara klien dan server. + Contohnya mengambil isi dari butir blog dan komentar yang akan ditampilkan dalam satu halaman. + Untuk aplikasi ponsel yang beroperasi diberbagai keadaan jaringan, kebutuhan beberapa perjalanan bolak-balik sangat tidak dinginkan. +* Seiring waktu, ekstra bagian kemungkinan ditambahkan ke dalam tanggapan API. + Klien lama akan menerima seluruh bagian data baru, bahkan klien yang tidak memerlukannya. + Hal ini berdampak pada membesarnya ukuran muatan dan membesarnya latensi. -### RPC and REST calls comparison +### Perbandingan pemanggilan RPC dan REST -| Operation | RPC | REST | +| Operasi | RPC | REST | |---|---|---| -| Signup | **POST** /signup | **POST** /persons | -| Resign | **POST** /resign
{
"personid": "1234"
} | **DELETE** /persons/1234 | -| Read a person | **GET** /readPerson?personid=1234 | **GET** /persons/1234 | -| Read a person’s items list | **GET** /readUsersItemsList?personid=1234 | **GET** /persons/1234/items | -| Add an item to a person’s items | **POST** /addItemToUsersItemsList
{
"personid": "1234";
"itemid": "456"
} | **POST** /persons/1234/items
{
"itemid": "456"
} | -| Update an item | **POST** /modifyItem
{
"itemid": "456";
"key": "value"
} | **PUT** /items/456
{
"key": "value"
} | -| Delete an item | **POST** /removeItem
{
"itemid": "456"
} | **DELETE** /items/456 | +| Pendaftaran | **POST** /signup | **POST** /persons | +| Pengunduran diri | **POST** /resign
{
"personid": "1234"
} | **DELETE** /persons/1234 | +| Pengambilan info diri | **GET** /readPerson?personid=1234 | **GET** /persons/1234 | +| Pengambilan daftar butir seseorang | **GET** /readUsersItemsList?personid=1234 | **GET** /persons/1234/items | +| Penambahan butir baru ke butir sesorang | **POST** /addItemToUsersItemsList
{
"personid": "1234";
"itemid": "456"
} | **POST** /persons/1234/items
{
"itemid": "456"
} | +| Penambahan butir | **POST** /modifyItem
{
"itemid": "456";
"key": "value"
} | **PUT** /items/456
{
"key": "value"
} | +| Penghapusan butir | **POST** /removeItem
{
"itemid": "456"
} | **DELETE** /items/456 |

- Source: Do you really know why you prefer REST over RPC + Sumber: Apakah Anda benar-benar tahu mengapa anda memilih REST dibandingkan RPC

-#### Source(s) and further reading: REST and RPC +#### Sumber dan bacaan lanjutan: REST dan RPC -* [Do you really know why you prefer REST over RPC](https://apihandyman.io/do-you-really-know-why-you-prefer-rest-over-rpc/) -* [When are RPC-ish approaches more appropriate than REST?](http://programmers.stackexchange.com/a/181186) +* [Apakah Anda benar-benar tahu mengapa anda memilih REST dibandingkan RPC](https://apihandyman.io/do-you-really-know-why-you-prefer-rest-over-rpc/) +* [Kapan pendekatan ke-RPC-an lebih cocok dibandingkan dengan REST?](http://programmers.stackexchange.com/a/181186) * [REST vs JSON-RPC](http://stackoverflow.com/questions/15056878/rest-vs-json-rpc) -* [Debunking the myths of RPC and REST](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) -* [What are the drawbacks of using REST](https://www.quora.com/What-are-the-drawbacks-of-using-RESTful-APIs) -* [Crack the system design interview](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview) +* [Menyanggah mitos RPC dan REST](http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) +* [Apakah kekurangan penggunan REST](https://www.quora.com/What-are-the-drawbacks-of-using-RESTful-APIs) +* [Memecahkan wawancara perancangan sistem](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview) * [Thrift](https://code.facebook.com/posts/1468950976659943/) -* [Why REST for internal use and not RPC](http://arstechnica.com/civis/viewtopic.php?t=1190508) +* [Kenapa REST untuk penggunaan internal dan bukan RPC](http://arstechnica.com/civis/viewtopic.php?t=1190508) ## Security From 31d8efeadbfbce3bdb8ad5fa62abcc067d47d4bd Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Mon, 10 Feb 2020 18:05:44 +0700 Subject: [PATCH 26/32] Translate section 24: Security --- README-id.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/README-id.md b/README-id.md index 61a04bf4..e4d1355b 100644 --- a/README-id.md +++ b/README-id.md @@ -1714,20 +1714,22 @@ Karena nirkeadaan, REST sangat bagus untuk penyekalaan horizontal dan pemecahan. ## Security -This section could use some updates. Consider [contributing](#contributing)! +Bagian ini memerlukan pembaruan. +Pertimbangkan untuk [berkontribusi](#kontribusi)! -Security is a broad topic. Unless you have considerable experience, a security background, or are applying for a position that requires knowledge of security, you probably won't need to know more than the basics: +Keamanan merupakan topik yang luas. +Kecuali Anda memiliki pengalaman yang cukup, latar belakang keamanan, atau melamar posisi yang membutuhkan pengetahuan keamanan, Anda mungkin tidak perlu mengetahui lebih dari pengetahuan dasar: -* Encrypt in transit and at rest. -* Sanitize all user inputs or any input parameters exposed to user to prevent [XSS](https://en.wikipedia.org/wiki/Cross-site_scripting) and [SQL injection](https://en.wikipedia.org/wiki/SQL_injection). -* Use parameterized queries to prevent SQL injection. -* Use the principle of [least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege). +* Enkripsi saat transit dan saat istirahat. +* Bersihkan seluruh masukan pengguna atau parameter masukan yang terekspos ke pengguna untuk mencegah [XSS](https://en.wikipedia.org/wiki/Cross-site_scripting) dan [Injeksi SQL](https://en.wikipedia.org/wiki/SQL_injection). +* Gunakan kueri terparameter untuk mencegah injeksi SQL. +* Gunakan prinsip [least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege). -### Source(s) and further reading +### Sumber dan bacaan lanjutan -* [API security checklist](https://github.com/shieldfy/API-Security-Checklist) -* [Security guide for developers](https://github.com/FallibleInc/security-guide-for-developers) -* [OWASP top ten](https://www.owasp.org/index.php/OWASP_Top_Ten_Cheat_Sheet) +* [Daftar periksa keamanan API](https://github.com/shieldfy/API-Security-Checklist) +* [Panduan keamanan untuk pengembang](https://github.com/FallibleInc/security-guide-for-developers) +* [sepuluh teratas OWASP](https://www.owasp.org/index.php/OWASP_Top_Ten_Cheat_Sheet) ## Appendix From e4a8bafad78275d3dcd781ec768926a5948593f5 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Mon, 10 Feb 2020 19:19:20 +0700 Subject: [PATCH 27/32] Translate section 25: Appendix --- README-id.md | 275 ++++++++++++++++++++++++++------------------------- 1 file changed, 138 insertions(+), 137 deletions(-) diff --git a/README-id.md b/README-id.md index e4d1355b..c0b4f915 100644 --- a/README-id.md +++ b/README-id.md @@ -1731,33 +1731,35 @@ Kecuali Anda memiliki pengalaman yang cukup, latar belakang keamanan, atau melam * [Panduan keamanan untuk pengembang](https://github.com/FallibleInc/security-guide-for-developers) * [sepuluh teratas OWASP](https://www.owasp.org/index.php/OWASP_Top_Ten_Cheat_Sheet) -## Appendix +## Lampiran -You'll sometimes be asked to do 'back-of-the-envelope' estimates. For example, you might need to determine how long it will take to generate 100 image thumbnails from disk or how much memory a data structure will take. The **Powers of two table** and **Latency numbers every programmer should know** are handy references. +Kita kadang diminta untuk melakukan estimasi 'kalkulasi di belakang amplop'. +Sebagai contoh, kita mungkin perlu menentukan berapa lama waktu yang diperlukan untuk menghasilkan 100 keluku dari disk atau berapa banyak memori yang akan digunakan oleh struktur data. +**Tabel perpangkatan dua** dan **Nilai latensi yang perlu diketahui oleh setiap pemrogram** merupakan referensi yang berguna. -### Tabel Perpangkatan dua +### Tabel perpangkatan dua ``` -Power Exact Value Approx Value Bytes +Pangkat Nilai tepat Nilai kisaran Byte --------------------------------------------------------------- 7 128 8 256 -10 1024 1 thousand 1 KB +10 1024 seribu 1 KB 16 65,536 64 KB -20 1,048,576 1 million 1 MB -30 1,073,741,824 1 billion 1 GB -32 4,294,967,296 4 GB -40 1,099,511,627,776 1 trillion 1 TB +20 1,048,576 1 juta 1 MB +30 1,073,741,824 1 miliar 1 GB +32 4,294,967,296 4 GB +40 1,099,511,627,776 1 triliun 1 TB ``` -#### Source(s) and further reading +#### Sumber dan bacaan lanjutan * [Powers of two](https://en.wikipedia.org/wiki/Power_of_two) -### Nilai latensi yang perlu diketahui oleh setiap pemrogram] +### Nilai latensi yang perlu diketahui oleh setiap pemrogram ``` -Latency Comparison Numbers +Nilai Perbandingan Latensi -------------------------- L1 cache reference 0.5 ns Branch mispredict 5 ns @@ -1775,14 +1777,14 @@ Read 1 MB sequentially from 1 Gbps 10,000,000 ns 10,000 us 10 ms 40x mem Read 1 MB sequentially from disk 30,000,000 ns 30,000 us 30 ms 120x memory, 30X SSD Send packet CA->Netherlands->CA 150,000,000 ns 150,000 us 150 ms -Notes +Catatan ----- 1 ns = 10^-9 seconds 1 us = 10^-6 seconds = 1,000 ns 1 ms = 10^-3 seconds = 1,000 us = 1,000,000 ns ``` -Handy metrics based on numbers above: +Metrik yang berguna berdasarkan nilai di atas: * Read sequentially from disk at 30 MB/s * Read sequentially from 1 Gbps Ethernet at 100 MB/s @@ -1791,165 +1793,164 @@ Handy metrics based on numbers above: * 6-7 world-wide round trips per second * 2,000 round trips per second within a data center -#### Latency numbers visualized +#### Gambaran nilai latensi ![](https://camo.githubusercontent.com/77f72259e1eb58596b564d1ad823af1853bc60a3/687474703a2f2f692e696d6775722e636f6d2f6b307431652e706e67) -#### Source(s) and further reading +#### Sumber dan bacaan lanjutan -* [Latency numbers every programmer should know - 1](https://gist.github.com/jboner/2841832) -* [Latency numbers every programmer should know - 2](https://gist.github.com/hellerbarde/2843375) -* [Designs, lessons, and advice from building large distributed systems](http://www.cs.cornell.edu/projects/ladis2009/talks/dean-keynote-ladis2009.pdf) -* [Software Engineering Advice from Building Large-Scale Distributed Systems](https://static.googleusercontent.com/media/research.google.com/en//people/jeff/stanford-295-talk.pdf) +* [Nilai latensi yang perlu diketahui oleh setiap pemrogram - 1](https://gist.github.com/jboner/2841832) +* [Nilai latensi yang perlu diketahui oleh setiap pemrogram - 2](https://gist.github.com/hellerbarde/2843375) +* [Rancangan, pelajaran, dan anjuran dari pembangunan sistem terdistribusi besar](http://www.cs.cornell.edu/projects/ladis2009/talks/dean-keynote-ladis2009.pdf) +* [Anjuran rekayasa perangkat lunak dari pembangunan sisterm terdistribusi skala besar](https://static.googleusercontent.com/media/research.google.com/en//people/jeff/stanford-295-talk.pdf) ### Tambahan pertanyaan wawancara perancangan sistem -> Common system design interview questions, with links to resources on how to solve each. +> Pertanyaan umum wawancara perancangan sistem, dengan tautan ke sumber daya untuk menyelesaikannya. -| Question | Reference(s) | +| Pertanyaan | Referensi | |---|---| -| Design a file sync service like Dropbox | [youtube.com](https://www.youtube.com/watch?v=PE4gwstWhmc) | -| Design a search engine like Google | [queue.acm.org](http://queue.acm.org/detail.cfm?id=988407)
[stackexchange.com](http://programmers.stackexchange.com/questions/38324/interview-question-how-would-you-implement-google-search)
[ardendertat.com](http://www.ardendertat.com/2012/01/11/implementing-search-engines/)
[stanford.edu](http://infolab.stanford.edu/~backrub/google.html) | -| Design a scalable web crawler like Google | [quora.com](https://www.quora.com/How-can-I-build-a-web-crawler-from-scratch) | -| Design Google docs | [code.google.com](https://code.google.com/p/google-mobwrite/)
[neil.fraser.name](https://neil.fraser.name/writing/sync/) | -| Design a key-value store like Redis | [slideshare.net](http://www.slideshare.net/dvirsky/introduction-to-redis) | -| Design a cache system like Memcached | [slideshare.net](http://www.slideshare.net/oemebamo/introduction-to-memcached) | -| Design a recommendation system like Amazon's | [hulu.com](https://web.archive.org/web/20170406065247/http://tech.hulu.com/blog/2011/09/19/recommendation-system.html)
[ijcai13.org](http://ijcai13.org/files/tutorial_slides/td3.pdf) | -| Design a tinyurl system like Bitly | [n00tc0d3r.blogspot.com](http://n00tc0d3r.blogspot.com/) | -| Design a chat app like WhatsApp | [highscalability.com](http://highscalability.com/blog/2014/2/26/the-whatsapp-architecture-facebook-bought-for-19-billion.html) -| Design a picture sharing system like Instagram | [highscalability.com](http://highscalability.com/flickr-architecture)
[highscalability.com](http://highscalability.com/blog/2011/12/6/instagram-architecture-14-million-users-terabytes-of-photos.html) | -| Design the Facebook news feed function | [quora.com](http://www.quora.com/What-are-best-practices-for-building-something-like-a-News-Feed)
[quora.com](http://www.quora.com/Activity-Streams/What-are-the-scaling-issues-to-keep-in-mind-while-developing-a-social-network-feed)
[slideshare.net](http://www.slideshare.net/danmckinley/etsy-activity-feeds-architecture) | -| Design the Facebook timeline function | [facebook.com](https://www.facebook.com/note.php?note_id=10150468255628920)
[highscalability.com](http://highscalability.com/blog/2012/1/23/facebook-timeline-brought-to-you-by-the-power-of-denormaliza.html) | -| Design the Facebook chat function | [erlang-factory.com](http://www.erlang-factory.com/upload/presentations/31/EugeneLetuchy-ErlangatFacebook.pdf)
[facebook.com](https://www.facebook.com/note.php?note_id=14218138919&id=9445547199&index=0) | -| Design a graph search function like Facebook's | [facebook.com](https://www.facebook.com/notes/facebook-engineering/under-the-hood-building-out-the-infrastructure-for-graph-search/10151347573598920)
[facebook.com](https://www.facebook.com/notes/facebook-engineering/under-the-hood-indexing-and-ranking-in-graph-search/10151361720763920)
[facebook.com](https://www.facebook.com/notes/facebook-engineering/under-the-hood-the-natural-language-interface-of-graph-search/10151432733048920) | -| Design a content delivery network like CloudFlare | [figshare.com](https://figshare.com/articles/Globally_distributed_content_delivery/6605972) | -| Design a trending topic system like Twitter's | [michael-noll.com](http://www.michael-noll.com/blog/2013/01/18/implementing-real-time-trending-topics-in-storm/)
[snikolov .wordpress.com](http://snikolov.wordpress.com/2012/11/14/early-detection-of-twitter-trends/) | -| Design a random ID generation system | [blog.twitter.com](https://blog.twitter.com/2010/announcing-snowflake)
[github.com](https://github.com/twitter/snowflake/) | -| Return the top k requests during a time interval | [cs.ucsb.edu](https://www.cs.ucsb.edu/sites/cs.ucsb.edu/files/docs/reports/2005-23.pdf)
[wpi.edu](http://davis.wpi.edu/xmdv/docs/EDBT11-diyang.pdf) | -| Design a system that serves data from multiple data centers | [highscalability.com](http://highscalability.com/blog/2009/8/24/how-google-serves-data-from-multiple-datacenters.html) | -| Design an online multiplayer card game | [indieflashblog.com](http://www.indieflashblog.com/how-to-create-an-asynchronous-multiplayer-game.html)
[buildnewgames.com](http://buildnewgames.com/real-time-multiplayer/) | -| Design a garbage collection system | [stuffwithstuff.com](http://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/)
[washington.edu](http://courses.cs.washington.edu/courses/csep521/07wi/prj/rick.pdf) | -| Design an API rate limiter | [https://stripe.com/blog/](https://stripe.com/blog/rate-limiters) | -| Add a system design question | [Contribute](#contributing) | +| Rancang layanan sinkronisasi file seperti Dropbox | [youtube.com](https://www.youtube.com/watch?v=PE4gwstWhmc) | +| Rancang mesin pencari seperti Google | [queue.acm.org](http://queue.acm.org/detail.cfm?id=988407)
[stackexchange.com](http://programmers.stackexchange.com/questions/38324/interview-question-how-would-you-implement-google-search)
[ardendertat.com](http://www.ardendertat.com/2012/01/11/implementing-search-engines/)
[stanford.edu](http://infolab.stanford.edu/~backrub/google.html) | +| Rancang perayap web terskala seperti Google | [quora.com](https://www.quora.com/How-can-I-build-a-web-crawler-from-scratch) | +| Rancang docs | [code.google.com](https://code.google.com/p/google-mobwrite/)
[neil.fraser.name](https://neil.fraser.name/writing/sync/) | +| Rancang gudang nilai-kunci seperti Redis | [slideshare.net](http://www.slideshare.net/dvirsky/introduction-to-redis) | +| Rancang sistem penyinggahan seperti Memcached | [slideshare.net](http://www.slideshare.net/oemebamo/introduction-to-memcached) | +| Rancang sistem rekomendasi seperti Amazon | [hulu.com](https://web.archive.org/web/20170406065247/http://tech.hulu.com/blog/2011/09/19/recommendation-system.html)
[ijcai13.org](http://ijcai13.org/files/tutorial_slides/td3.pdf) | +| Rancang sistem url kecil seperti Bitly | [n00tc0d3r.blogspot.com](http://n00tc0d3r.blogspot.com/) | +| Rancang aplikasi obrolan seperti WhatsApp | [highscalability.com](http://highscalability.com/blog/2014/2/26/the-whatsapp-architecture-facebook-bought-for-19-billion.html) +| Rancang sistem berbagi gambar seperti Instagram | [highscalability.com](http://highscalability.com/flickr-architecture)
[highscalability.com](http://highscalability.com/blog/2011/12/6/instagram-architecture-14-million-users-terabytes-of-photos.html) | +| Rancang fungsi umpan berita Facebook | [quora.com](http://www.quora.com/What-are-best-practices-for-building-something-like-a-News-Feed)
[quora.com](http://www.quora.com/Activity-Streams/What-are-the-scaling-issues-to-keep-in-mind-while-developing-a-social-network-feed)
[slideshare.net](http://www.slideshare.net/danmckinley/etsy-activity-feeds-architecture) | +| Rancang fungsi linimasa Facebook | [facebook.com](https://www.facebook.com/note.php?note_id=10150468255628920)
[highscalability.com](http://highscalability.com/blog/2012/1/23/facebook-timeline-brought-to-you-by-the-power-of-denormaliza.html) | +| Rancang fungsi obrolan Facebook | [erlang-factory.com](http://www.erlang-factory.com/upload/presentations/31/EugeneLetuchy-ErlangatFacebook.pdf)
[facebook.com](https://www.facebook.com/note.php?note_id=14218138919&id=9445547199&index=0) | +| Rancang fungsi pencarian graf seperti Facebook | [facebook.com](https://www.facebook.com/notes/facebook-engineering/under-the-hood-building-out-the-infrastructure-for-graph-search/10151347573598920)
[facebook.com](https://www.facebook.com/notes/facebook-engineering/under-the-hood-indexing-and-ranking-in-graph-search/10151361720763920)
[facebook.com](https://www.facebook.com/notes/facebook-engineering/under-the-hood-the-natural-language-interface-of-graph-search/10151432733048920) | +| Rancang jaringan pengiriman konten seperti CloudFlare | [figshare.com](https://figshare.com/articles/Globally_distributed_content_delivery/6605972) | +| Rancang sistem topik terkini seperti Twitter | [michael-noll.com](http://www.michael-noll.com/blog/2013/01/18/implementing-real-time-trending-topics-in-storm/)
[snikolov .wordpress.com](http://snikolov.wordpress.com/2012/11/14/early-detection-of-twitter-trends/) | +| Rancang sistem penghasilan ID acak | [blog.twitter.com](https://blog.twitter.com/2010/announcing-snowflake)
[github.com](https://github.com/twitter/snowflake/) | +| Kembalikan permintaan k teratas selama interval tertentu | [cs.ucsb.edu](https://www.cs.ucsb.edu/sites/cs.ucsb.edu/files/docs/reports/2005-23.pdf)
[wpi.edu](http://davis.wpi.edu/xmdv/docs/EDBT11-diyang.pdf) | +| Rancang sistem yang menyajikan data dari berbagai pusat data | [highscalability.com](http://highscalability.com/blog/2009/8/24/how-google-serves-data-from-multiple-datacenters.html) | +| Rancang permainan kartu banyak pemain daring | [indieflashblog.com](http://www.indieflashblog.com/how-to-create-an-asynchronous-multiplayer-game.html)
[buildnewgames.com](http://buildnewgames.com/real-time-multiplayer/) | +| Rancang sistem pemungut sampah | [stuffwithstuff.com](http://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/)
[washington.edu](http://courses.cs.washington.edu/courses/csep521/07wi/prj/rick.pdf) | +| Rancang pembatas laju API | [https://stripe.com/blog/](https://stripe.com/blog/rate-limiters) | +| Tambahkan pertanyaan perancangan sistem | [Kontribusi](#kontribusi) | ### Arsitektu dunia nyata -> Articles on how real world systems are designed. +> Artikel tentang bagaiman sistem dirancang pada dunia nyata.


- Source: Twitter timelines at scale + Sumber: Lini masa Twitter terskala

-**Don't focus on nitty gritty details for the following articles, instead:** +**Jangan fokus pada detail seluk beluk artikel berikut, fokus lah pada:** -* Identify shared principles, common technologies, and patterns within these articles -* Study what problems are solved by each component, where it works, where it doesn't -* Review the lessons learned +* Kenali prinsip bersama, teknologi umum, dan pola dalam artikel +* Pelajari masalah yang diselesaikan oleh setiap komponen, dimana komponen dapat dan tidak dapat bekerja +* Ulas pelajaran yang dipetik -|Type | System | Reference(s) | +|Tipe | Sistem | Referensi | |---|---|---| -| Data processing | **MapReduce** - Distributed data processing from Google | [research.google.com](http://static.googleusercontent.com/media/research.google.com/zh-CN/us/archive/mapreduce-osdi04.pdf) | -| Data processing | **Spark** - Distributed data processing from Databricks | [slideshare.net](http://www.slideshare.net/AGrishchenko/apache-spark-architecture) | -| Data processing | **Storm** - Distributed data processing from Twitter | [slideshare.net](http://www.slideshare.net/previa/storm-16094009) | +| Pemrosesan data | **MapReduce** - Pemrosesan data terdistribusi dari Google | [research.google.com](http://static.googleusercontent.com/media/research.google.com/zh-CN/us/archive/mapreduce-osdi04.pdf) | +| Pemrosesan data | **Spark** - Pemrosesan data terdistribusi dari Databricks | [slideshare.net](http://www.slideshare.net/AGrishchenko/apache-spark-architecture) | +| Pemrosesan data | **Storm** - Pemrosesan data terdistribusi dari Twitter | [slideshare.net](http://www.slideshare.net/previa/storm-16094009) | | | | | -| Data store | **Bigtable** - Distributed column-oriented database from Google | [harvard.edu](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/chang06bigtable.pdf) | -| Data store | **HBase** - Open source implementation of Bigtable | [slideshare.net](http://www.slideshare.net/alexbaranau/intro-to-hbase) | -| Data store | **Cassandra** - Distributed column-oriented database from Facebook | [slideshare.net](http://www.slideshare.net/planetcassandra/cassandra-introduction-features-30103666) -| Data store | **DynamoDB** - Document-oriented database from Amazon | [harvard.edu](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/decandia07dynamo.pdf) | -| Data store | **MongoDB** - Document-oriented database | [slideshare.net](http://www.slideshare.net/mdirolf/introduction-to-mongodb) | -| Data store | **Spanner** - Globally-distributed database from Google | [research.google.com](http://research.google.com/archive/spanner-osdi2012.pdf) | -| Data store | **Memcached** - Distributed memory caching system | [slideshare.net](http://www.slideshare.net/oemebamo/introduction-to-memcached) | -| Data store | **Redis** - Distributed memory caching system with persistence and value types | [slideshare.net](http://www.slideshare.net/dvirsky/introduction-to-redis) | +| Gudang data | **Bigtable** - Basis data berorintasi kolom terdistribusi dari Google | [harvard.edu](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/chang06bigtable.pdf) | +| Gudang data | **HBase** - Implementasi sumber terbuka dari Bigtable | [slideshare.net](http://www.slideshare.net/alexbaranau/intro-to-hbase) | +| Gudang data | **Cassandra** - Basis data berorientasi kolom terdistribusi dari Facebook | [slideshare.net](http://www.slideshare.net/planetcassandra/cassandra-introduction-features-30103666) +| Gudang data | **DynamoDB** - Basis data berorientasi dokumen dari Amazon | [harvard.edu](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/decandia07dynamo.pdf) | +| Gudang data | **MongoDB** - Basis data berorientasi dokumen | [slideshare.net](http://www.slideshare.net/mdirolf/introduction-to-mongodb) | +| Gudang data | **Spanner** - Basis data terdistribusi secara global dari Google | [research.google.com](http://research.google.com/archive/spanner-osdi2012.pdf) | +| Gudang data | **Memcached** - Sistem persinggahan memori terdistribusi | [slideshare.net](http://www.slideshare.net/oemebamo/introduction-to-memcached) | +| Gudang data | **Redis** - Sistem persinggahan memori terdistribusi dengan persistensi dan tipe nilai | [slideshare.net](http://www.slideshare.net/dvirsky/introduction-to-redis) | | | | | -| File system | **Google File System (GFS)** - Distributed file system | [research.google.com](http://static.googleusercontent.com/media/research.google.com/zh-CN/us/archive/gfs-sosp2003.pdf) | -| File system | **Hadoop File System (HDFS)** - Open source implementation of GFS | [apache.org](http://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) | +| Sistem berkas | **Google File System (GFS)** - Sistem berkas terdistribusi | [research.google.com](http://static.googleusercontent.com/media/research.google.com/zh-CN/us/archive/gfs-sosp2003.pdf) | +| Sistem berkas | **Hadoop File System (HDFS)** - Implementasi sumber terbuka dari GFS | [apache.org](http://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) | | | | | -| Misc | **Chubby** - Lock service for loosely-coupled distributed systems from Google | [research.google.com](http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en/us/archive/chubby-osdi06.pdf) | -| Misc | **Dapper** - Distributed systems tracing infrastructure | [research.google.com](http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/36356.pdf) -| Misc | **Kafka** - Pub/sub message queue from LinkedIn | [slideshare.net](http://www.slideshare.net/mumrah/kafka-talk-tri-hug) | -| Misc | **Zookeeper** - Centralized infrastructure and services enabling synchronization | [slideshare.net](http://www.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper) | -| | Add an architecture | [Contribute](#contributing) | +| Tambahan | **Chubby** - Layanan penguncian untuk sistem terdistribusi hubungan renggang dari Google | [research.google.com](http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en/us/archive/chubby-osdi06.pdf) | +| Tambahan | **Dapper** - Infrastruktur telusuran sistem terdistribusi | [research.google.com](http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/36356.pdf) +| Tambahan | **Kafka** - Antrian pesan pub/sub dari LinkedIn | [slideshare.net](http://www.slideshare.net/mumrah/kafka-talk-tri-hug) | +| Tambahan | **Zookeeper** - Infrastruktur dan layanan terpusat untuk sinkronisasi | [slideshare.net](http://www.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper) | +| | Tambahkan arsitektur | [Kontribusi](#kontribusi) | -### Company architectures +### Arsitektur perusahaan -| Company | Reference(s) | +| Perusahaan | Referensi | |---|---| -| Amazon | [Amazon architecture](http://highscalability.com/amazon-architecture) | -| Cinchcast | [Producing 1,500 hours of audio every day](http://highscalability.com/blog/2012/7/16/cinchcast-architecture-producing-1500-hours-of-audio-every-d.html) | -| DataSift | [Realtime datamining At 120,000 tweets per second](http://highscalability.com/blog/2011/11/29/datasift-architecture-realtime-datamining-at-120000-tweets-p.html) | -| DropBox | [How we've scaled Dropbox](https://www.youtube.com/watch?v=PE4gwstWhmc) | -| ESPN | [Operating At 100,000 duh nuh nuhs per second](http://highscalability.com/blog/2013/11/4/espns-architecture-at-scale-operating-at-100000-duh-nuh-nuhs.html) | -| Google | [Google architecture](http://highscalability.com/google-architecture) | -| Instagram | [14 million users, terabytes of photos](http://highscalability.com/blog/2011/12/6/instagram-architecture-14-million-users-terabytes-of-photos.html)
[What powers Instagram](http://instagram-engineering.tumblr.com/post/13649370142/what-powers-instagram-hundreds-of-instances) | -| Justin.tv | [Justin.Tv's live video broadcasting architecture](http://highscalability.com/blog/2010/3/16/justintvs-live-video-broadcasting-architecture.html) | -| Facebook | [Scaling memcached at Facebook](https://cs.uwaterloo.ca/~brecht/courses/854-Emerging-2014/readings/key-value/fb-memcached-nsdi-2013.pdf)
[TAO: Facebook’s distributed data store for the social graph](https://cs.uwaterloo.ca/~brecht/courses/854-Emerging-2014/readings/data-store/tao-facebook-distributed-datastore-atc-2013.pdf)
[Facebook’s photo storage](https://www.usenix.org/legacy/event/osdi10/tech/full_papers/Beaver.pdf)
[How Facebook Live Streams To 800,000 Simultaneous Viewers](http://highscalability.com/blog/2016/6/27/how-facebook-live-streams-to-800000-simultaneous-viewers.html) | -| Flickr | [Flickr architecture](http://highscalability.com/flickr-architecture) | -| Mailbox | [From 0 to one million users in 6 weeks](http://highscalability.com/blog/2013/6/18/scaling-mailbox-from-0-to-one-million-users-in-6-weeks-and-1.html) | -| Netflix | [A 360 Degree View Of The Entire Netflix Stack](http://highscalability.com/blog/2015/11/9/a-360-degree-view-of-the-entire-netflix-stack.html)
[Netflix: What Happens When You Press Play?](http://highscalability.com/blog/2017/12/11/netflix-what-happens-when-you-press-play.html) | -| Pinterest | [From 0 To 10s of billions of page views a month](http://highscalability.com/blog/2013/4/15/scaling-pinterest-from-0-to-10s-of-billions-of-page-views-a.html)
[18 million visitors, 10x growth, 12 employees](http://highscalability.com/blog/2012/5/21/pinterest-architecture-update-18-million-visitors-10x-growth.html) | -| Playfish | [50 million monthly users and growing](http://highscalability.com/blog/2010/9/21/playfishs-social-gaming-architecture-50-million-monthly-user.html) | -| PlentyOfFish | [PlentyOfFish architecture](http://highscalability.com/plentyoffish-architecture) | -| Salesforce | [How they handle 1.3 billion transactions a day](http://highscalability.com/blog/2013/9/23/salesforce-architecture-how-they-handle-13-billion-transacti.html) | -| Stack Overflow | [Stack Overflow architecture](http://highscalability.com/blog/2009/8/5/stack-overflow-architecture.html) | -| TripAdvisor | [40M visitors, 200M dynamic page views, 30TB data](http://highscalability.com/blog/2011/6/27/tripadvisor-architecture-40m-visitors-200m-dynamic-page-view.html) | -| Tumblr | [15 billion page views a month](http://highscalability.com/blog/2012/2/13/tumblr-architecture-15-billion-page-views-a-month-and-harder.html) | -| Twitter | [Making Twitter 10000 percent faster](http://highscalability.com/scaling-twitter-making-twitter-10000-percent-faster)
[Storing 250 million tweets a day using MySQL](http://highscalability.com/blog/2011/12/19/how-twitter-stores-250-million-tweets-a-day-using-mysql.html)
[150M active users, 300K QPS, a 22 MB/S firehose](http://highscalability.com/blog/2013/7/8/the-architecture-twitter-uses-to-deal-with-150m-active-users.html)
[Timelines at scale](https://www.infoq.com/presentations/Twitter-Timeline-Scalability)
[Big and small data at Twitter](https://www.youtube.com/watch?v=5cKTP36HVgI)
[Operations at Twitter: scaling beyond 100 million users](https://www.youtube.com/watch?v=z8LU0Cj6BOU)
[How Twitter Handles 3,000 Images Per Second](http://highscalability.com/blog/2016/4/20/how-twitter-handles-3000-images-per-second.html) | -| Uber | [How Uber scales their real-time market platform](http://highscalability.com/blog/2015/9/14/how-uber-scales-their-real-time-market-platform.html)
[Lessons Learned From Scaling Uber To 2000 Engineers, 1000 Services, And 8000 Git Repositories](http://highscalability.com/blog/2016/10/12/lessons-learned-from-scaling-uber-to-2000-engineers-1000-ser.html) | -| WhatsApp | [The WhatsApp architecture Facebook bought for $19 billion](http://highscalability.com/blog/2014/2/26/the-whatsapp-architecture-facebook-bought-for-19-billion.html) | -| YouTube | [YouTube scalability](https://www.youtube.com/watch?v=w5WVu624fY8)
[YouTube architecture](http://highscalability.com/youtube-architecture) | +| Amazon | [Arsitektur Amazon](http://highscalability.com/amazon-architecture) | +| Cinchcast | [Penghasilan 1.500 jam suara setiap hari](http://highscalability.com/blog/2012/7/16/cinchcast-architecture-producing-1500-hours-of-audio-every-d.html) | +| DataSift | [Penambangan data secara waktu nyata dengan 120.000 kicauan setiap detik](http://highscalability.com/blog/2011/11/29/datasift-architecture-realtime-datamining-at-120000-tweets-p.html) | +| DropBox | [Bagaimana kami menyekala Dropbox](https://www.youtube.com/watch?v=PE4gwstWhmc) | +| ESPN | [Pengoperasi 100.000 duh nuh nuhs per detik](http://highscalability.com/blog/2013/11/4/espns-architecture-at-scale-operating-at-100000-duh-nuh-nuhs.html) | +| Google | [Arsitektur Google](http://highscalability.com/google-architecture) | +| Instagram | [14 juta pengguna, terabyte foto](http://highscalability.com/blog/2011/12/6/instagram-architecture-14-million-users-terabytes-of-photos.html)
[Apa kekuatan Instagram](http://instagram-engineering.tumblr.com/post/13649370142/what-powers-instagram-hundreds-of-instances) | +| Justin.tv | [Arsitektur penyiaran video langsung Justin.Tv](http://highscalability.com/blog/2010/3/16/justintvs-live-video-broadcasting-architecture.html) | +| Facebook | [Penyekalaan Memcached di Facebook](https://cs.uwaterloo.ca/~brecht/courses/854-Emerging-2014/readings/key-value/fb-memcached-nsdi-2013.pdf)
[TAO: Gudang data terdistribusi Facebook untuk graf sosial](https://cs.uwaterloo.ca/~brecht/courses/854-Emerging-2014/readings/data-store/tao-facebook-distributed-datastore-atc-2013.pdf)
[Penyimpanan foto Facebook](https://www.usenix.org/legacy/event/osdi10/tech/full_papers/Beaver.pdf)
[Cara Facebook siaran langsung ke 800.0000 penonton serentak](http://highscalability.com/blog/2016/6/27/how-facebook-live-streams-to-800000-simultaneous-viewers.html) | +| Flickr | [Arsitektur Flickr](http://highscalability.com/flickr-architecture) | +| Mailbox | [Drai 0 sampai 1 juta pengguna dalam 6 minggu](http://highscalability.com/blog/2013/6/18/scaling-mailbox-from-0-to-one-million-users-in-6-weeks-and-1.html) | +| Netflix | [Pandangan 360 derajat dari seluruh tumpukan teknologi Netflix](http://highscalability.com/blog/2015/11/9/a-360-degree-view-of-the-entire-netflix-stack.html)
[Netflix: Apa yang terjadi ketika kita menekan tombol mulai?](http://highscalability.com/blog/2017/12/11/netflix-what-happens-when-you-press-play.html) | +| Pinterest | [Dari 0 sampai puluhan miliar tampilan halaman sebulan](http://highscalability.com/blog/2013/4/15/scaling-pinterest-from-0-to-10s-of-billions-of-page-views-a.html)
[18 juta pengunjung, 10x pertumbuhan, 12 karyawan](http://highscalability.com/blog/2012/5/21/pinterest-architecture-update-18-million-visitors-10x-growth.html) | +| Playfish | [50 juta pengguna bulanan dan semakin bertumbuh](http://highscalability.com/blog/2010/9/21/playfishs-social-gaming-architecture-50-million-monthly-user.html) | +| PlentyOfFish | [Arsitektur PlentyOfFish](http://highscalability.com/plentyoffish-architecture) | +| Salesforce | [Cara mereka menangani 1,3 miliar transaksi sehari](http://highscalability.com/blog/2013/9/23/salesforce-architecture-how-they-handle-13-billion-transacti.html) | +| Stack Overflow | [Arsitektur Stack Overflow](http://highscalability.com/blog/2009/8/5/stack-overflow-architecture.html) | +| TripAdvisor | [40 juta pengunjung, 200 juta tampilan halaman dinamis, 30TB data](http://highscalability.com/blog/2011/6/27/tripadvisor-architecture-40m-visitors-200m-dynamic-page-view.html) | +| Tumblr | [15 miliar tampilan halaman sebulan](http://highscalability.com/blog/2012/2/13/tumblr-architecture-15-billion-page-views-a-month-and-harder.html) | +| Twitter | [Mempercepat Twitter 10000 persen kali](http://highscalability.com/scaling-twitter-making-twitter-10000-percent-faster)
[Penyimpanan 250 juta cuitan sehari menggunakan MySQL](http://highscalability.com/blog/2011/12/19/how-twitter-stores-250-million-tweets-a-day-using-mysql.html)
[150 juta pengguna aktif, 300 ribu kueri per detik, a 22 MB/S firehose](http://highscalability.com/blog/2013/7/8/the-architecture-twitter-uses-to-deal-with-150m-active-users.html)
[Skalabilitas lini masa](https://www.infoq.com/presentations/Twitter-Timeline-Scalability)
[Data besar dan kecil di Twitter](https://www.youtube.com/watch?v=5cKTP36HVgI)
[Operasional di Twitter: penyekalaan di atas 100 juta pengguna](https://www.youtube.com/watch?v=z8LU0Cj6BOU)
[Cara Twitter menangani 30000 gambar per detik](http://highscalability.com/blog/2016/4/20/how-twitter-handles-3000-images-per-second.html) | +| Uber | [Cara Uber menyekala platform pasar waktu nyata mereka](http://highscalability.com/blog/2015/9/14/how-uber-scales-their-real-time-market-platform.html)
[Pelajaran yang dipetik dari menyekala Uber menjadi 2000 perekayasa, 1000 layanan, dan 8000 repositori Git](http://highscalability.com/blog/2016/10/12/lessons-learned-from-scaling-uber-to-2000-engineers-1000-ser.html) | +| WhatsApp | [Arsitektur WhatsApp yang dibeli Facebook senilai $19 milliar](http://highscalability.com/blog/2014/2/26/the-whatsapp-architecture-facebook-bought-for-19-billion.html) | +| YouTube | [Skalabilitas YouTube](https://www.youtube.com/watch?v=w5WVu624fY8)
[Arsitektur YouTube](http://highscalability.com/youtube-architecture) | ### Blog teknik perusahaan -> Architectures for companies you are interviewing with. +> Arsitektur perusahaan tempat Anda wawancara. > -> Questions you encounter might be from the same domain. +> Pertanyaan yang mungkin ditanyakan dari domain yang sama. -* [Airbnb Engineering](http://nerds.airbnb.com/) -* [Atlassian Developers](https://developer.atlassian.com/blog/) -* [AWS Blog](https://aws.amazon.com/blogs/aws/) -* [Bitly Engineering Blog](http://word.bitly.com/) -* [Box Blogs](https://blog.box.com/blog/category/engineering) -* [Cloudera Developer Blog](http://blog.cloudera.com/) -* [Dropbox Tech Blog](https://tech.dropbox.com/) -* [Engineering at Quora](http://engineering.quora.com/) -* [Ebay Tech Blog](http://www.ebaytechblog.com/) -* [Evernote Tech Blog](https://blog.evernote.com/tech/) +* [Rekayasa Airbnb](http://nerds.airbnb.com/) +* [Pengembang Atlassian](https://developer.atlassian.com/blog/) +* [Blog AWS](https://aws.amazon.com/blogs/aws/) +* [Blog Rekayawa Bitly](http://word.bitly.com/) +* [Blog Box](https://blog.box.com/blog/category/engineering) +* [Blog Pengembang Cloudera](http://blog.cloudera.com/) +* [Blog Teknik Dropbox](https://tech.dropbox.com/) +* [Rekayasa di Quora](http://engineering.quora.com/) +* [Blog Teknik Ebay](http://www.ebaytechblog.com/) +* [Blog Teknik Evernote](https://blog.evernote.com/tech/) * [Etsy Code as Craft](http://codeascraft.com/) -* [Facebook Engineering](https://www.facebook.com/Engineering) -* [Flickr Code](http://code.flickr.net/) -* [Foursquare Engineering Blog](http://engineering.foursquare.com/) -* [GitHub Engineering Blog](http://githubengineering.com/) -* [Google Research Blog](http://googleresearch.blogspot.com/) -* [Groupon Engineering Blog](https://engineering.groupon.com/) -* [Heroku Engineering Blog](https://engineering.heroku.com/) -* [Hubspot Engineering Blog](http://product.hubspot.com/blog/topic/engineering) +* [Rekayasa Facebook](https://www.facebook.com/Engineering) +* [Kode Flickr](http://code.flickr.net/) +* [Blog Rekayasa Foursquare](http://engineering.foursquare.com/) +* [Blog Rekayasa GitHub Engineering Blog](http://githubengineering.com/) +* [Blog Penelitian Google](http://googleresearch.blogspot.com/) +* [Blog Rekayasa Groupon](https://engineering.groupon.com/) +* [Blog Rekayasa Heroku](https://engineering.heroku.com/) +* [Blog Rekayasa Hubspot](http://product.hubspot.com/blog/topic/engineering) * [High Scalability](http://highscalability.com/) -* [Instagram Engineering](http://instagram-engineering.tumblr.com/) -* [Intel Software Blog](https://software.intel.com/en-us/blogs/) -* [Jane Street Tech Blog](https://blogs.janestreet.com/category/ocaml/) -* [LinkedIn Engineering](http://engineering.linkedin.com/blog) -* [Microsoft Engineering](https://engineering.microsoft.com/) -* [Microsoft Python Engineering](https://blogs.msdn.microsoft.com/pythonengineering/) -* [Netflix Tech Blog](http://techblog.netflix.com/) -* [Paypal Developer Blog](https://devblog.paypal.com/category/engineering/) -* [Pinterest Engineering Blog](https://medium.com/@Pinterest_Engineering) -* [Quora Engineering](https://engineering.quora.com/) -* [Reddit Blog](http://www.redditblog.com/) -* [Salesforce Engineering Blog](https://developer.salesforce.com/blogs/engineering/) -* [Slack Engineering Blog](https://slack.engineering/) -* [Spotify Labs](https://labs.spotify.com/) -* [Twilio Engineering Blog](http://www.twilio.com/engineering) -* [Twitter Engineering](https://blog.twitter.com/engineering/) -* [Uber Engineering Blog](http://eng.uber.com/) -* [Yahoo Engineering Blog](http://yahooeng.tumblr.com/) -* [Yelp Engineering Blog](http://engineeringblog.yelp.com/) -* [Zynga Engineering Blog](https://www.zynga.com/blogs/engineering) +* [Rekayasa Instagram](http://instagram-engineering.tumblr.com/) +* [Blog Perangkat Lunak Intel](https://software.intel.com/en-us/blogs/) +* [Blog Teknik Jane Street](https://blogs.janestreet.com/category/ocaml/) +* [Rekayasa LinkedIn](http://engineering.linkedin.com/blog) +* [Rekayasa Microsoft](https://engineering.microsoft.com/) +* [Rekayasa Python Microsoft](https://blogs.msdn.microsoft.com/pythonengineering/) +* [Blog Teknik Netflix](http://techblog.netflix.com/) +* [Blog Pengembang Paypal](https://devblog.paypal.com/category/engineering/) +* [Blog Rekayasa Pinterest](https://medium.com/@Pinterest_Engineering) +* [Blog Reddit](http://www.redditblog.com/) +* [Blog Rekayasa Salesforce](https://developer.salesforce.com/blogs/engineering/) +* [Blog Rekayasa Slack](https://slack.engineering/) +* [Lab Spotify](https://labs.spotify.com/) +* [Blog Rekayasa Twilio](http://www.twilio.com/engineering) +* [Rekayasa Twitter](https://blog.twitter.com/engineering/) +* [Blog Rekayasa Uber](http://eng.uber.com/) +* [Blog Rekayasa Yahoo](http://yahooeng.tumblr.com/) +* [Blog Rekayasa Yelp](http://engineeringblog.yelp.com/) +* [Blog Rekayasa Zynga](https://www.zynga.com/blogs/engineering) -#### Source(s) and further reading +#### Sumber dan bacaan lanjutan -Looking to add a blog? To avoid duplicating work, consider adding your company blog to the following repo: +Ingin menambahkan blog? Untuk menghindari duplikasi kerjaan, pertimbangkan untuk menambahkan blog perusahaan ke repo berikut: * [kilimchoi/engineering-blogs](https://github.com/kilimchoi/engineering-blogs) From 65cbfb3959d5e122499731cdb05d4ac589e51597 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Mon, 10 Feb 2020 19:23:37 +0700 Subject: [PATCH 28/32] Translate section 26: Under development --- README-id.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README-id.md b/README-id.md index c0b4f915..91437da9 100644 --- a/README-id.md +++ b/README-id.md @@ -1956,12 +1956,12 @@ Ingin menambahkan blog? Untuk menghindari duplikasi kerjaan, pertimbangkan untuk ## Dalam pengembangan -Interested in adding a section or helping complete one in-progress? [Contribute](#contributing)! +Berminta menambahkan bagian atau membantu menyelesaikan bagian yang sedang dalam tahap pengerjaan? [Ayo kontribusi](#kontribusi)! -* Distributed computing with MapReduce -* Consistent hashing -* Scatter gather -* [Contribute](#contributing) +* Komputasi terdistribusi dengan MapReduce +* Hashing konsisten +* _Scatter gather_ +* [Kontribusi](#kontribusi) ## Credits From 1091ce154adf3c36a015e34fecf777a9b80cd43a Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Mon, 10 Feb 2020 20:13:39 +0700 Subject: [PATCH 29/32] Update table of content --- README-id.md | 146 +++++++++++++++++++++++++-------------------------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/README-id.md b/README-id.md index 91437da9..ad06fc97 100644 --- a/README-id.md +++ b/README-id.md @@ -97,83 +97,83 @@ Tinjau kembali [Pedomain Kontribusi](CONTRIBUTING.md).

-* [System design topics: start here](#system-design-topics-start-here) - * [Step 1: Review the scalability video lecture](#step-1-review-the-scalability-video-lecture) - * [Step 2: Review the scalability article](#step-2-review-the-scalability-article) - * [Next steps](#next-steps) -* [Performance vs scalability](#performance-vs-scalability) -* [Latency vs throughput](#latency-vs-throughput) -* [Availability vs consistency](#availability-vs-consistency) - * [CAP theorem](#cap-theorem) - * [CP - consistency and partition tolerance](#cp---consistency-and-partition-tolerance) - * [AP - availability and partition tolerance](#ap---availability-and-partition-tolerance) -* [Consistency patterns](#consistency-patterns) - * [Weak consistency](#weak-consistency) - * [Eventual consistency](#eventual-consistency) - * [Strong consistency](#strong-consistency) -* [Availability patterns](#availability-patterns) +* [Topik perancangan sistem: Mulai dari sini](#topik-perancangan-sistem-mulai-dari-sini) + * [Langkah 1: Tonton kuliah video skalabilitas](#langkah-1-tonton-kuliah-video-skalabilitas) + * [Langkah 2: Baca artikel skalabilitas](#langkah-2-baca-artikel-skalabilitas) + * [Langkah selanjutnya](#langkah-selanjutnya) +* [Kinerja vs skalabilitas](#kinerja-vs-skalabilitas) +* [Latensi vs lewatan](#latensi-vs-lewatan) +* [Ketersediaan vs konsistensi](#ketersediaan-vs-konsistensi) + * [Teorema CAP](#teorema-cap) + * [CP - konsistensi dan toleransi penyekatan](#cp---konsistensi-dan-toleransi-penyekatan) + * [AP - ketersediaan dan toleransi penyekatan](#ap---ketersediaan-dan-toleransi-penyekatan) +* [Pola konsistensi](#pola-konsistensi) + * [Konsistensi lemah](#konsistensi-lemah) + * [Konsistensi yang mungkin terjadi (eventual consistency)](#konsistensi-yang-mungkin-terjadi-eventual-consistency) + * [Konsisten kuat](#konsisten-kuat) +* [Pola ketersediaan](#pola-ketersediaan) * [Fail-over](#fail-over) - * [Replication](#replication) - * [Availability in numbers](#availability-in-numbers) + * [Replikasi](#replikasi) + * [Ketersediaan dalam angka](#ketersediaan-dalam-angka) * [Domain name system](#domain-name-system) * [Content delivery network](#content-delivery-network) - * [Push CDNs](#push-cdns) - * [Pull CDNs](#pull-cdns) -* [Load balancer](#load-balancer) - * [Active-passive](#active-passive) - * [Active-active](#active-active) - * [Layer 4 load balancing](#layer-4-load-balancing) - * [Layer 7 load balancing](#layer-7-load-balancing) - * [Horizontal scaling](#horizontal-scaling) -* [Reverse proxy (web server)](#reverse-proxy-web-server) - * [Load balancer vs reverse proxy](#load-balancer-vs-reverse-proxy) -* [Application layer](#application-layer) - * [Microservices](#microservices) - * [Service discovery](#service-discovery) -* [Database](#database) - * [Relational database management system (RDBMS)](#relational-database-management-system-rdbms) - * [Master-slave replication](#master-slave-replication) - * [Master-master replication](#master-master-replication) - * [Federation](#federation) - * [Sharding](#sharding) - * [Denormalization](#denormalization) - * [SQL tuning](#sql-tuning) + * [CDN setor](#cdn-setor) + * [CDN tarik](#cdn-tarik) +* [Penyeimbang beban](#penyeimbang-beban) + * [Aktif-pasif](#aktif-pasif) + * [Aktif-aktif](#aktif-aktif) + * [Penyeimbangan beban lapisan ke-4](#penyeimbangan-beban-lapisan-ke-4) + * [Penyeimbang beban lapisan ke-7](#penyeimbang-beban-lapisan-ke-7) + * [Penyekalaan horizontal](#penyekalaan-horizontal) +* [Proksi terbalik (server web)](#proksi-terbalik-server-web) + * [Penyeimbang beban vs proksi terbalik](#penyeimbang-beban-vs-proksi-terbalik) +* [Lapisan aplikasi](#lapisan-aplikasi) + * [Layanan mikro (Microservices)](#layanan-mikro-microservices) + * [Penemuan layanan (Service Discovery)](#penemuan-layanan-service-discovery-) +* [Basis data](#basis-data) + * [Sistem pengelolaan basis data relasional](#sistem-pengelolaan-basis-data-relasional) + * [Replikasi master-slave](#replikasi-master-slave) + * [Replikasi master-master](#replikasi-master-master) + * [Federasi](#federasi) + * [Pecahan (Sharding)](#pecahan-sharding) + * [Denormalisasi](#denormalisasi) + * [Penyetelan SQL](#penyetelan-sql) * [NoSQL](#nosql) - * [Key-value store](#key-value-store) - * [Document store](#document-store) - * [Wide column store](#wide-column-store) - * [Graph Database](#graph-database) - * [SQL or NoSQL](#sql-or-nosql) -* [Cache](#cache) - * [Client caching](#client-caching) - * [CDN caching](#cdn-caching) - * [Web server caching](#web-server-caching) - * [Database caching](#database-caching) - * [Application caching](#application-caching) - * [Caching at the database query level](#caching-at-the-database-query-level) - * [Caching at the object level](#caching-at-the-object-level) - * [When to update the cache](#when-to-update-the-cache) - * [Cache-aside](#cache-aside) + * [Gudang kunci-nilai](#gudang-kunci-nilai) + * [Gudang dokumen (document store)](#gudang-dokumen-document-store) + * [Gudang kolom lebar (Wide column store)](#gudang-kolom-lebar-wide-column-store) + * [Basis data graf](#basis-data-graf) + * [SQL atau NoSQL](#sql-atau-nosql) +* [Singgahan](#singgahan) + * [Singgahan klien](#singgahan-klien) + * [Singgahan CDN](#singgahan-cdn) + * [Singgahan server web](#singgahan-server-web) + * [Singgahan basis data](#singgahan-basis-data) + * [Singgahan aplikasi](#singgahan-aplikasi) + * [Singgahan pada level kueri basis data](#singgahan-pada-level-kueri-basis-data) + * [Singgahan pada level objek](#singgahan-pada-level-objek) + * [Kapan singgahan diperbarui](#kapan-singgahan-diperbarui) + * [Singgahan sampingan (Cache-aside)](#singgahan-sampingan-cache-aside) * [Write-through](#write-through) * [Write-behind (write-back)](#write-behind-write-back) * [Refresh-ahead](#refresh-ahead) -* [Asynchronism](#asynchronism) - * [Message queues](#message-queues) - * [Task queues](#task-queues) - * [Back pressure](#back-pressure) -* [Communication](#communication) +* [Asinkronisme](#asinkronisme) + * [Antrian pesan](#antrian-pesan) + * [Antrian tugas](#antrian-tugas) + * [Tekanan balik (Back pressure)](#tekanan-balik-back-pressure) +* [Komunikasi](#komunikasi) * [Transmission control protocol (TCP)](#transmission-control-protocol-tcp) * [User datagram protocol (UDP)](#user-datagram-protocol-udp) * [Remote procedure call (RPC)](#remote-procedure-call-rpc) * [Representational state transfer (REST)](#representational-state-transfer-rest) -* [Security](#security) -* [Appendix](#appendix) - * [Powers of two table](#powers-of-two-table) - * [Latency numbers every programmer should know](#latency-numbers-every-programmer-should-know) - * [Additional system design interview questions](#additional-system-design-interview-questions) - * [Real world architectures](#real-world-architectures) - * [Company architectures](#company-architectures) - * [Company engineering blogs](#company-engineering-blogs) +* [Keamanan](#keamanan) +* [Lampiran](#lampiran) + * [Tabel perpangkatan dua](#tabel-perpangkatan-dua) + * [Nilai latensi yang perlu diketahui oleh setiap pemrogram](#nilai-latensi-yang-perlu-diketahui-oleh-setiap-pemrogram) + * [ambahan pertanyaan wawancara perancangan sistem](#tambahan-pertanyaan-wawancara-perancangan-sistem) + * [Arsitektu dunia nyata](#arsitektu-dunia-nyata) + * [Arsitektur perusahaan](#arsitektur-perusahaan) + * [Blog teknik perusahaan](#blog-teknik-perusahaan) * [Dalam pengembangan](#dalam-pengembangan) * [Credits](#credits) * [Contact info](#contact-info) @@ -874,7 +874,7 @@ Baik Consul dan Etcd keduanya memiliki [gudang kunci-nilai](#gudang-kunci-nilai) Sumber: Penyekalaan untuk 10 juta pengguna pertama

-### Sistem pengelolaan basis data relasional (Relational database management system / RDBMS) +### Sistem pengelolaan basis data relasional Basis data relasional seperti SQL merupakan sekumpulan butir data yang diorganisasi ke dalam tabel. @@ -935,7 +935,7 @@ Jika salah satu master mati, sistem tetap bisa beroperasi untuk baca dan tulis. * [Skalabilitas, Ketersediaan, Kestabilan, Pola-pola](http://www.slideshare.net/jboner/scalability-availability-stability-patterns/) * [Replikasi multi master](https://en.wikipedia.org/wiki/Multi-master_replication) -#### Federation +#### Federasi

@@ -992,7 +992,7 @@ Cara umum memecah sebuah tabel pengguna adalah salah satunya dengan memanfaat in * [Arsitektur basis data pecahan](https://en.wikipedia.org/wiki/Shard_(database_architecture)) * [Consistent hashing](http://www.paperplanes.de/2011/12/9/the-magic-of-consistent-hashing.html) -#### Denormalisasi (Denormalization) +#### Denormalisasi Denormalisasi mencoba memperbaiki kinerja operasi baca dengan mengorbankan operasi tulis. Salinan data yang berlebihan ditulis di beberapa tabel untuk menghindari operasi penggabungan yang mahal. @@ -1014,7 +1014,7 @@ Operasi baca yang memerlukan penggabungan basis data yang kompleks bisa menjadi * [Denormalisasi](https://en.wikipedia.org/wiki/Denormalization) -#### Penyetelan SQL (SQL tuning) +#### Penyetelan SQL Penyetelah SQL merupakan topik yang luas dan banyak [buku](https://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=sql+tuning) yang sudah dituliskan sebagai referensi. @@ -1154,7 +1154,7 @@ Mereka sering kali digunakan untuk penyimpanan himpunan data yang sangat besar. * [Arsitektur HBase](https://www.mapr.com/blog/in-depth-look-hbase-architecture) * [Arsitektur Cassandra](http://docs.datastax.com/en/cassandra/3.0/cassandra/architecture/archIntro.html) -#### Basis data Graf (graph database) +#### Basis data graf

@@ -1446,7 +1446,7 @@ _Refresh-ahead_ bisa menghasilkan pengurangan latensi dibandingkan _read-through Alur kerja asinkron membantu mengurangi waktu permintaan untuk operasi mahal yang sebaliknya dilakukan dalam barisan. Alur kerja ini juga dapat membantu terlebih dahulu mengerjakan pekerjaan yang memakan waktu seperti agregasi data berkala. -### Antrian pesan (Message queues) +### Antrian pesan Antrian pesan menerima, menahan, dan mengirimkan pesan. Jika operasi terlalu lambat dilakukan secara berurutan, kita dapat menggunakan antrian pesan dengan alur kerja sebagai berikut: @@ -1712,7 +1712,7 @@ Karena nirkeadaan, REST sangat bagus untuk penyekalaan horizontal dan pemecahan. * [Thrift](https://code.facebook.com/posts/1468950976659943/) * [Kenapa REST untuk penggunaan internal dan bukan RPC](http://arstechnica.com/civis/viewtopic.php?t=1190508) -## Security +## Keamanan Bagian ini memerlukan pembaruan. Pertimbangkan untuk [berkontribusi](#kontribusi)! From 793ee5d678b1af40857d5b0451f4bcd38cf296f2 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Mon, 10 Feb 2020 20:15:56 +0700 Subject: [PATCH 30/32] Translate section 27: Credits --- README-id.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README-id.md b/README-id.md index ad06fc97..ec56522c 100644 --- a/README-id.md +++ b/README-id.md @@ -175,7 +175,7 @@ Tinjau kembali [Pedomain Kontribusi](CONTRIBUTING.md). * [Arsitektur perusahaan](#arsitektur-perusahaan) * [Blog teknik perusahaan](#blog-teknik-perusahaan) * [Dalam pengembangan](#dalam-pengembangan) -* [Credits](#credits) +* [Kredit](#kredit) * [Contact info](#contact-info) * [License](#license) @@ -1963,11 +1963,11 @@ Berminta menambahkan bagian atau membantu menyelesaikan bagian yang sedang dalam * _Scatter gather_ * [Kontribusi](#kontribusi) -## Credits +## Kredit -Credits and sources are provided throughout this repo. +Kredit dan sumber tersedia di sepanjang repo ini. -Special thanks to: +Terima kasih khusus kepada: * [Hired in tech](http://www.hiredintech.com/system-design/the-system-design-process/) * [Cracking the coding interview](https://www.amazon.com/dp/0984782850/) @@ -1975,9 +1975,9 @@ Special thanks to: * [checkcheckzz/system-design-interview](https://github.com/checkcheckzz/system-design-interview) * [shashank88/system_design](https://github.com/shashank88/system_design) * [mmcgrana/services-engineering](https://github.com/mmcgrana/services-engineering) -* [System design cheat sheet](https://gist.github.com/vasanthk/485d1c25737e8e72759f) -* [A distributed systems reading list](http://dancres.github.io/Pages/) -* [Cracking the system design interview](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview) +* [Contekan perancangan sistem](https://gist.github.com/vasanthk/485d1c25737e8e72759f) +* [Daftar baca sistem terdistribusi](http://dancres.github.io/Pages/) +* [Pemecahan wawancara perancangan sistem](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview) ## Contact info From f2db578956727325b6a18668e5b7074c6928b3cc Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Mon, 10 Feb 2020 20:33:59 +0700 Subject: [PATCH 31/32] Update translation on Panduan Belajar --- README-id.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README-id.md b/README-id.md index ec56522c..1d4dfed8 100644 --- a/README-id.md +++ b/README-id.md @@ -209,15 +209,15 @@ Sesuaikan panduan berikut berdasarkan waktu, pengalaman, posisi yang dilamar, da * **Garis waktu sedang** - Bidik topik-topik perancangan sistem secara luas dan perdalam dibeberapa bagian tertentu. Latih dengan cara menjawab banyak pertanyaan wawancara. * **Garis waktu panjang** - Bidik topik-topik perancangan sistem secara laus dan mendalam. Latih dengan cara menyelesaikan seluruh pertanyaan wawancara. -| | Short | Medium | Long | +| | Pendek | Menengah | Panjang | |---|---|---|---| | Baca sampai habis [Indeks topik perancangan sistem](#indeks-topik-perancangan-sistem) untuk pemahaman secara luas bagaimana cara kerja suatu sistem | :+1: | :+1: | :+1: | | Baca sampai habis beberapa artikel di [Blog teknik perusahaan](#blog-teknik-perusahaan) untuk perusahaan tempat Anda wawancara | :+1: | :+1: | :+1: | | Baca sampai habis beberapa [Arsitektur dunia nyata](#arsitektur-dunia-nyata) | :+1: | :+1: | :+1: | | Ulas [Pendekatan menjawab pertanyaan wawancara perancangan sistem](#pendekatan-menjawab-pertanyaan-wawancara-perancangan-sistem) | :+1: | :+1: | :+1: | -| Tinjau [Pertanyaan wawancara perancangan sistem beserta solusinya](#pertanyaan-wawancara-perancangan-sistem-beserta-solusinya) | Some | Many | Most | -| Teliti [Pertanyaan wawancara perancangan berbasis objek beserta solusinya](#pertanyaan-wawancara-perancangan-berbasis-objek-beserta-solusinya) | Some | Many | Most | -| Periksa [Tambahan pertanyaan wawancara perancangan sistem](#tambahan-pertanyaan-wawancara-perancangan-sistem) | Some | Many | Most | +| Tinjau [Pertanyaan wawancara perancangan sistem beserta solusinya](#pertanyaan-wawancara-perancangan-sistem-beserta-solusinya) | Sebagian | Banyak | Sebagian besar | +| Teliti [Pertanyaan wawancara perancangan berbasis objek beserta solusinya](#pertanyaan-wawancara-perancangan-berbasis-objek-beserta-solusinya) | Sebagaian | Banyak | Sebagian besar | +| Periksa [Tambahan pertanyaan wawancara perancangan sistem](#tambahan-pertanyaan-wawancara-perancangan-sistem) | Sebagian | Banyak | Sebagian besar | ## Pendekatan menjawab pertanyaan wawancara perancangan sistem From e30d6959667cc073acc4a1f533772a4eb6cca2e3 Mon Sep 17 00:00:00 2001 From: Roy Ginting Date: Tue, 10 Mar 2020 16:19:50 +0700 Subject: [PATCH 32/32] Fix typo arsitektu --- README-id.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-id.md b/README-id.md index 1d4dfed8..d5c5d40a 100644 --- a/README-id.md +++ b/README-id.md @@ -1834,7 +1834,7 @@ Metrik yang berguna berdasarkan nilai di atas: | Rancang pembatas laju API | [https://stripe.com/blog/](https://stripe.com/blog/rate-limiters) | | Tambahkan pertanyaan perancangan sistem | [Kontribusi](#kontribusi) | -### Arsitektu dunia nyata +### Arsitektur dunia nyata > Artikel tentang bagaiman sistem dirancang pada dunia nyata.