Skip to Content
Go言語による分散サービス ―信頼性、拡張性、保守性の高いシステムの構築
book

Go言語による分散サービス ―信頼性、拡張性、保守性の高いシステムの構築

by Travis Jeffery, 柴田 芳樹
August 2022
Beginner to intermediate
280 pages
3h 50m
Japanese
O'Reilly Japan, Inc.
Content preview from Go言語による分散サービス ―信頼性、拡張性、保守性の高いシステムの構築

4章gRPCによるリクエスト処理

プロジェクトとプロトコルバッファを設定し、ログライブラリを作成しました。現在、私たちのライブラリは、一度に一人が1台のコンピュータ上でしか使えません。さらに、その人はライブラリのAPIを学び、私たちのコードを実行し、ログを自分のディスクに保存しなければなりません。ほとんどの人はそのようなことはしないでしょうから、私たちのライブラリの利用者は限られます。多くの人にアピールするには、ライブラリをウェブサービス化する必要があります。1台のコンピュータ上で動作するプログラムに比べて、ネットワークサービスには三つの大きな利点があります。

  • 可用性と拡張性のために、複数のコンピュータで実行できます。
  • 複数の人が同じデータを扱えます。
  • 人々にとって使いやすいアクセス可能なインタフェースを提供します。

このような利点を得るためにサービスを作りたい状況としては、フロントエンドが利用する公開APIの提供、社内サービス基盤ツールの構築、自分のビジネスを構築するためのサービスの構築などが挙げられます(ライブラリだけを利用するためにお金を払う人はほとんどいません)。

この章では、私たちのライブラリを使って、複数の人が同じデータを扱い、複数のコンピュータで動作するサービスを作成します。この章では、クラスタのサポートはまだ行いません。「8章 合意形成によるサービス連携」で行います。私が、分散サービスでリクエストを提供するために見つけた最良のツールは、GoogleのgRPCです。

4.1 gRPCとは何か

以前、分散サービスを構築したとき、私を悩ませたのは、クライアントとサーバ間の互換性の維持とパフォーマンスの維持でした。

私は、クライアントとサーバで常に互換性があることを保証したかったのです。つまり、クライアントはサーバが理解できるリクエストを送信し、その逆にサーバのレスポンスも理解できることを保証したかったのです。互換性のない変更をサーバに行う際には、古いクライアントも継続して動作できるようにする必要があったので、APIをバージョン管理することで実現しました。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

エンジニアリングマネージャーのしごと ―チームが必要とするマネージャーになる方法

エンジニアリングマネージャーのしごと ―チームが必要とするマネージャーになる方法

James Stanier, 吉羽 龍太郎, 永瀬 美穂, 原田 騎郎, 竹葉 美沙
サイトリライアビリティワークブック ―SREの実践方法

サイトリライアビリティワークブック ―SREの実践方法

Betsy Beyer, Niall Richard Murphy, David K. Rensin, Kent Kawahara, Stephen Thorne, 澤田 武男, 関根 達夫, 細川 一茂, 矢吹 大輔, 玉川 竜司
スクラム実践者が知るべき97のこと

スクラム実践者が知るべき97のこと

Gunther Verheyen, 吉羽 龍太郎, 原田 騎郎, 永瀬 美穂
生成AI時代の価値のつくりかた ―実践者のマインド、スキル、データ、ユースケース

生成AI時代の価値のつくりかた ―実践者のマインド、スキル、データ、ユースケース

Rob Thomas, Paul Zikopoulos, Kate Soule, 本多 真二郎, オライリー・ジャパン編集部

Publisher Resources

ISBN: 9784873119977Other