tlanslation_ja Consistency patterns
parent
1470f91b50
commit
4f5657bc09
134
README-jp.md
134
README-jp.md
|
@ -465,43 +465,43 @@
|
|||
* [平易な英語でのCAP 理論のイントロ](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.
|
||||
同じデータの複製が複数ある状態では、クライアントが一貫したデータ表示を受け取るために、どのようにそれらを同期すればいいのかという課題があります。 [CAP 理論](#cap-theorem) における一貫性の定義を思い出してみましょう。全ての読み取りは最新の書き込みデータもしくはエラーを受け取るはずです。
|
||||
|
||||
### 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.
|
||||
メムキャッシュなどのシステムにおいてこのアプローチは取られる。弱い一貫性はリアルタイム性が必要な使用例、例えばVoIP、ビデオチャット、リアルタイムマルチプレイヤーゲームなどと相性がいいでしょう。例えば、電話に出ていて、受信を数秒受け取れなかったとして、その後に接続回復してもその接続が切断されていた間に話されていたことは聞き取れないというような感じです。
|
||||
|
||||
### 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.
|
||||
このアプローチはDNSやメールシステムなどに採用されています。結果整合性は多くのリクエストを捌くサービスと相性がいいでしょう。
|
||||
|
||||
### 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.
|
||||
このアプローチはファイルシステムやRDBMなどで採用されています。トランザクションを扱うサービスでは強い一貫性が必要でしょう。
|
||||
|
||||
### その他の参考資料、ページ
|
||||
|
||||
* [Transactions across data centers](http://snarfed.org/transactions_across_datacenters_io.html)
|
||||
* [データセンター間でのトランザクション](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.
|
||||
アクティブ・パッシブフェイルオーバーにおいては、周期信号はアクティブもしくはスタンバイ中のパッシブなサーバーに送られます。周期信号が中断された時には、パッシブだったサーバーがアクティブサーバーのIPアドレスを引き継いでサービスを再開します。
|
||||
|
||||
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.
|
||||
|
||||
|
@ -511,23 +511,23 @@ In active-active, both servers are managing traffic, spreading the load between
|
|||
|
||||
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:
|
||||
このトピックは [Database](#database) セクションにおいてより詳細に解説されています:
|
||||
|
||||
* [Master-slave replication](#master-slave-replication)
|
||||
* [Master-master replication](#master-master-replication)
|
||||
* [マスター・スレーブ レプリケーション](#master-slave-replication)
|
||||
* [マスター・マスター レプリケーション](#master-master-replication)
|
||||
|
||||
## Domain name system
|
||||
## ドメインネームシステム
|
||||
|
||||
<p align="center">
|
||||
<img src="http://i.imgur.com/IOyLj4i.jpg">
|
||||
|
@ -535,37 +535,37 @@ This topic is further discussed in the [Database](#database) section:
|
|||
<i><a href=http://www.slideshare.net/srikrupa5/dns-security-presentation-issa>Source: DNS security presentation</a></i>
|
||||
</p>
|
||||
|
||||
A Domain Name System (DNS) translates a domain name such as www.example.com to an IP address.
|
||||
ドメインネームシステム (DNS) は www.example.com などのドメインネームを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は少数のオーソライズされたサーバーが上位に位置する階層的構造です。あなたのルーターもしくはISPは検索をする際にどのDNSサーバーに接続するかという情報を提供します。低い階層のDNSサーバーはその経路マップをキャッシュします。ただ、この情報は伝搬遅延によって陳腐化する可能性があります。DNSの結果はあなたのブラウザもしくはOSに一定期間([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.
|
||||
* **NS record (name server)** - あなたのドメイン・サブドメインでのDNSサーバーを特定します。
|
||||
* **MX record (mail exchange)** - メッセージを受け取るメールサーバーを特定します。
|
||||
* **A record (address)** - IPアドレスに名前をつけます。
|
||||
* **CNAME (canonical)** - 他の名前もしくは `CNAME` (example.com を www.example.com) もしくは `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:
|
||||
[CloudFlare](https://www.cloudflare.com/dns/) や [Route 53](https://aws.amazon.com/route53/) などのサービスはマネージドDNSサービスを提供しています。いくつかのDNSサービスでは様々な手法を使ってトラフィックを捌くことができます:
|
||||
|
||||
* [Weighted round robin](http://g33kinfo.com/info/archives/2657)
|
||||
* Prevent traffic from going to servers under maintenance
|
||||
* Balance between varying cluster sizes
|
||||
* A/B testing
|
||||
* Latency-based
|
||||
* Geolocation-based
|
||||
* [加重ラウンドロビン](http://g33kinfo.com/info/archives/2657)
|
||||
* トラフィックがメンテナンス中のサーバーに行くのを防ぎます
|
||||
* 様々なクラスターサイズに応じて調整します
|
||||
* A/B テスト
|
||||
* レイテンシーベース
|
||||
* 地理ベース
|
||||
|
||||
### Disadvantage(s): DNS
|
||||
### 欠点: DNS
|
||||
|
||||
* Accessing a DNS server introduces a slight delay, although mitigated by caching described above.
|
||||
* DNS server management could be complex, although they are 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).
|
||||
* 上記で示されているようなキャッシングによって緩和されているとはいえ、DNSサーバーへの接続には少し遅延が生じる。
|
||||
* DNSサーバーは、[政府、ISP企業,そして大企業](http://superuser.com/questions/472695/who-controls-the-dns-servers/472729)に管理されているが、それらの管理は複雑である。
|
||||
* DNSサービスは[DDoS attack](http://dyn.com/blog/dyn-analysis-summary-of-friday-october-21-attack/)の例で、IPアドレスなしにユーザーがTwitterなどにアクセスできなくなったように、攻撃を受ける可能性がある。
|
||||
|
||||
### Source(s) and further reading
|
||||
### その他の参考資料、ページ
|
||||
|
||||
* [DNS architecture](https://technet.microsoft.com/en-us/library/dd197427(v=ws.10).aspx)
|
||||
* [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/)
|
||||
* [DNS 記事](https://support.dnsimple.com/categories/dns/)
|
||||
|
||||
## Content delivery network
|
||||
## コンテントデリバリーネットワーク(Content delivery network)
|
||||
|
||||
<p align="center">
|
||||
<img src="http://i.imgur.com/h9TAuGI.jpg">
|
||||
|
@ -573,37 +573,37 @@ Services such as [CloudFlare](https://www.cloudflare.com/dns/) and [Route 53](ht
|
|||
<i><a href=https://www.creative-artworks.eu/why-use-a-content-delivery-network-cdn/>Source: Why use a CDN</a></i>
|
||||
</p>
|
||||
|
||||
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.
|
||||
コンテントデリバリーネットワーク(CDN)は世界中に配置されたプロキシサーバーのネットワークがユーザーに一番地理的に近いサーバーからコンテンツを配信するシステムのことです。AmazonのCloudFrontなどは例外的にダイナミックなコンテンツも配信しますが、一般的に、HTML/CSS/JS、写真、そして動画などの静的ファイルがCDNを通じて配信されます。そのサイトのDNSがクライアントにどのサーバーと交信するかという情報を伝えます。
|
||||
|
||||
Serving content from CDNs can significantly improve performance in two ways:
|
||||
CDNを用いてコンテンツを配信することで以下の二つの理由でパフォーマンスが劇的に向上します:
|
||||
|
||||
* Users receive content at data centers close to them
|
||||
* Your servers do not have to serve requests that the CDN fulfills
|
||||
* ユーザーは近くにあるデータセンターから受信できる
|
||||
* バックエンドサーバーはCDNが処理してくれるリクエストに関しては処理する必要がなくなります
|
||||
|
||||
### Push CDNs
|
||||
### プッシュCDN
|
||||
|
||||
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ではサーバーデータに更新があった時には必ず、新しいコンテンツを受け取る方式です。コンテンツを配信し、CDNに直接アップロードし、URLをCDNを指すように指定するところまで全ての責任を負う形です。コンテンツがいつ期限切れになるのか更新されるのかを設定することができます。コンテンツは新規作成時、更新時のみアップロードされることでトラフィックは最小化される一方、ストレージは最大限費消されてしまいます。
|
||||
|
||||
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.
|
||||
トラフィックの少ない、もしくは頻繁にはコンテンツが更新されないサイトの場合にはプッシュCDNと相性がいいでしょう。コンテンツは定期的に再びプルされるのではなく、CDNに一度のみ配置されます。
|
||||
|
||||
### Pull CDNs
|
||||
### プル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.
|
||||
プルCDNでは一人目のユーザーがリクエストした時に、新しいコンテンツをサービスのサーバーから取得します。コンテンツは自分のサーバーに保存して、CDNを指すURLを書き換えます。結果として、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.
|
||||
[time-to-live (TTL)](https://en.wikipedia.org/wiki/Time_to_live) はコンテンツがどれだけの期間キャッシュされるかを規定します。プルCDNはCDN 上でのストレージスペースを最小化しますが、有効期限が切れたファイルが更新前にプルされてしまうことで冗長なトラフィックに繋がってしまう可能性があります。
|
||||
|
||||
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.
|
||||
大規模なトラフィックのあるサイトではプルCDNが相性がいいでしょう。というのも、トラフィックの大部分は最近リクエストされ、CDNに残っているコンテンツにアクセスするものであることが多いからです。
|
||||
|
||||
### Disadvantage(s): CDN
|
||||
### 欠点: 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.
|
||||
* CDNのコストはトラフィック量によって変わります。もちろん、CDNを使わない場合のコストと比較するべきでしょう。
|
||||
* TTLが切れる前にコンテンツが更新されると陳腐化する恐れがあります。
|
||||
* CDNでは静的コンテンツがCDNを指すようにURLを更新する必要があります。
|
||||
|
||||
### Source(s) and further reading
|
||||
### その他の参考資料、ページ
|
||||
|
||||
* [Globally distributed content delivery](http://repository.cmu.edu/cgi/viewcontent.cgi?article=2112&context=compsci)
|
||||
* [The differences between push and pull CDNs](http://www.travelblogadvice.com/technical/the-differences-between-push-and-pull-cdns/)
|
||||
* [グローバルに分散されたコンテンツデリバリーネットワーク](http://repository.cmu.edu/cgi/viewcontent.cgi?article=2112&context=compsci)
|
||||
* [プッシュCDNとプルCDNの違い](http://www.travelblogadvice.com/technical/the-differences-between-push-and-pull-cdns/)
|
||||
* [Wikipedia](https://en.wikipedia.org/wiki/Content_delivery_network)
|
||||
|
||||
## Load balancer
|
||||
|
|
Loading…
Reference in New Issue