DroidKaigi 2018 gRPC/Protobuf

Bf527d0cc0376f104c772a94bdf38889?s=47 k-mats
February 07, 2018
4.4k

DroidKaigi 2018 gRPC/Protobuf

Bf527d0cc0376f104c772a94bdf38889?s=128

k-mats

February 07, 2018
Tweet

Transcript

  1. H31$ͱ1SPUPDPM#V⒎FSTͰ Ұຯҧ͏"OESPJE௨৴ Kohei Matsumoto @ DroidKaigi 2018

  2. Kohei Matsumoto Android/iOS Developer Twitter: kmats_ Github: k-mats

  3. Outline • RPC ͱ͸ • gRPC ͱ͸ • Protocol Buffers

    ͱ͸ • gRPC + Protocol Buffers ͷಋೖ • ։ൃ্ͷ޻෉ • protoϑΝΠϧͷڞ༗ํ๏ͷྫ
  4. RPC?

  5. RPC? REST -> JSON? RPC -> XML?

  6. RPC? REST -> JSON? RPC -> XML?

  7. RPC > Remote procedure call is the synchronous language-level transfer

    of control between programs in disjoint address spaces whose primary communication medium is a narrow channel. ଞͷΞυϨεۭؒʢe.g. ωοτϫʔΫ্ͷαʔόʣʹ͋ΔॲཧΛ ࣮ߦ͢Δ͜ͱɻ Bruce Jay Nelson. 1981. Remote Procedure Call. Ph.D. Dissertation. Carnegie Mellon Univ., Pittsburgh, PA, USA. AAI8204168. https://dl.acm.org/citation.cfm?id=910306
  8. RPC as HTTP API APIͷઃܭํ਑ σʔλͷදݱܗࣜ JSON, XML, Protocol Buffers,

    … REST, RPC, …
  9. RPC as HTTP API σʔλͷදݱܗࣜ JSON, XML, Protocol Buffers, …

    REST, RPC, … APIͷઃܭํ਑
  10. REST vs RPC as HTTP API • ҧ͍ͷ1ͭ:ʮAPIઃܭ࣌ʹͲ͜ʹண໨͢Δ͔ʯ • Ϧιʔεʢૢ࡞ର৅ʣͱΞΫγϣϯʢૢ࡞ํ

    ๏ʣΛͲ͏΍ͬͯදݱ͢Δ͔ • REST: ϦιʔεΛத৺ʹߟ͑Δ • RPC: ΞΫγϣϯΛத৺ʹߟ͑Δ
  11. RESTͷํ͕޲͍͍ͯΔέʔε • e.g. ϒϩάαʔϏεͷAPI • APIͷओͳ໾ׂ͸ϒϩάهࣄʹରͯ͠CRUD ૢ࡞Λ͢Δ͜ͱ • هࣄͱ͍͏ϦιʔεΛத৺ʹߟ͑ͨํ͕ྑ͍ •

    ΞΫγϣϯ͸HTTPϝιουͰදݱ https://www.smashingmagazine.com/2016/09/understanding-rest-and-rpc-for-http-apis/
  12. ϒϩάAPI: RESTͷ৔߹ • Create: • POST https://example.com/api/articles • body: {“title”:

    “New post”, “author”: “John”, “description”: “…”} • Read: • GET https://example.com/api/articles/123 • Update: • PATCH https://example.com/api/articles/123 • body: {“title”: “Revised”} • Delete: • DELETE https://example.com/api/articles/123 https://www.smashingmagazine.com/2016/09/understanding-rest-and-rpc-for-http-apis/
  13. ϒϩάAPI: RPCͷ৔߹ • Create: • https://example.com/api/createArticle • body: {“title”: “New

    post”, “author”: “John”, “description”: “…”} • Read: • https://example.com/api/getArticle • Update: • https://example.com/api/updateArticle • body: {“article_id”: 123, “title”: “Revised”} • Delete: • https://example.com/api/deleteArticle https://www.smashingmagazine.com/2016/09/understanding-rest-and-rpc-for-http-apis/
  14. RPCͷํ͕޲͍͍ͯΔέʔε • e.g. SlackͷΑ͏ͳνϟοταʔϏεͷAPI • APIΛ௨ͯ͡ҎԼͷػೳΛఏڙ͍ͨ͠ͱ͢Δ • ͋Δνϟϯωϧʹ͍ΔϢʔβ͕νϟϯωϧ͔Βୀग़ ͢Δ (leave)

    • ͋Δνϟϯωϧʹ͍ΔϢʔβΛνϟϯωϧ͔Β௥͍ ग़͠ɺ࠶ࢀՃΛې͡Δʢkickʣ https://www.smashingmagazine.com/2016/09/understanding-rest-and-rpc-for-http-apis/
  15. νϟοτAPI: RESTͷ৔߹ • leaveͱkickͷҧ͍Λ៉ྷͳRESTͰදݱ͢Δͷ͕೉͍͠ • e.g. bodyʹԿ͔͠Βͷ৘ใΛ௥Ճ͢Δ౳ͷ޻෉͕ඞཁ • leave: •

    PATCH https://example.com/api/channels/123/users/456 • body: {“status”: “left”} • kick: • PATCH https://example.com/api/channels/123/users/456 • body: {“status”: “kicked”} https://www.smashingmagazine.com/2016/09/understanding-rest-and-rpc-for-http-apis/
  16. νϟοτAPI: RESTͷ৔߹ • ҎԼͷΑ͏ʹ͢ΔͱRESTͱRPCͷதؒͷΑ͏ͳ΋ͷʹͳͬͯ͠·͏ • leave: • POST https://example.com/api/channels/123/users/456/leave •

    kick: • POST https://example.com/api/channels/123/users/456/kick https://www.smashingmagazine.com/2016/09/understanding-rest-and-rpc-for-http-apis/
  17. νϟοτAPI: RPCͷ৔߹ • leave: • https://example.com/api/leaveFromChannel • body: {“channel_id”: 123,

    “user_id”: 456} • kick: • https://example.com/api/kickFromChannel • body: {“channel_id”: 123, “user_id”: 456} https://www.smashingmagazine.com/2016/09/understanding-rest-and-rpc-for-http-apis/
  18. Slackͷweb API͸RPC > The Web API is a collection of

    HTTP RPC-style methods, all with URLs in the form `https://slack.com/api/METHOD_FAMILY.method`. https://api.slack.com/web Web API͸HTTP RPCελΠϧͷϝιουͷू·ΓͰ͋ΓɺશͯҎ ԼͷϑΥʔϜͰද͞Ε·͢ɻ `https://slack.com/api/METHOD_FAMILY.method`.
  19. ͦͷଞͷAPI • Dropbox API v2ͷେ൒͸RPC • AWS APIͷҰ෦͸RPC • Discord

    API͸REST https://www.dropbox.com/developers/documentation/http/documentation https://docs.aws.amazon.com/Route53/latest/APIReference/requests-rpc.html https://github.com/discordapp/discord-api-docs/blob/master/docs/Reference.md
  20. ͜ͷ߲ͷ·ͱΊ • RESTͱRPC͸దࡐదॴ • ϦιʔεΛத৺ʹߟ͑Δͱྑ͍ͳΒREST • ΞΫγϣϯΛத৺ʹߟ͑Δͱྑ͍ͳΒRPC

  21. ͦͷଞͷREST, RPCͷൺֱݕ౼ʹ ؔ͢Δࢀߟ • https://speakerdeck.com/petitviolet/web-api- design • https://www.slideshare.net/disc99_/apirestgrpc • https://apihandyman.io/do-you-really-know-why-

    you-prefer-rest-over-rpc/ • https://philsturgeon.uk/api/2017/12/18/rest- confusion-explained/
  22. gRPC?

  23. gRPC • Google͕։ൃΛ࢝ΊͨΦʔϓϯιʔεͷRPCϑϨʔϜϫʔΫ • ݩ͸Googleࣾ಺ͷϚΠΫϩαʔϏεΛͭͳ͛ΔͨΊʹ10 ೥Ҏ্࢖ΘΕ͍ͯͨRPCϑϨʔϜϫʔΫ”Stubby” • HTTP/2 • ૒ํ޲ετϦʔϛϯά

    • ެࣜʹ͸Android JavaؚΊ10ݴޠʹରԠ https://grpc.io/blog/principles
  24. gRPCͷσʔλදݱܗࣜ • σϑΥϧτͰ͸Protocol Buffers (Protobuf) • C++ͱGoͰ͸FlatBuffers΋αϙʔτ͞Εͯ ͍Δͱͷ͜ͱ • ଞͷϑΥʔϚοτ΋ٕज़తʹ͸ରԠՄೳͱ

    ॻ͍ͯ͋Δ͕ɺݱ࣌఺ͰରԠࡁΈ͔͸ผ https://grpc.io/blog/flatbuffers https://grpc.io/faq/
  25. grpc-gateway: gRPC/ProtobufͱREST/JSONΛม׵ https://github.com/grpc-ecosystem/grpc-gateway

  26. ͍ͪAndroid։ൃऀ͔Βݟͨ gRPCͷϝϦοτ • ௨৴ʹඞཁͳίʔυ͕ࣗಈੜ੒͞ΕΔ • RPCϑϨʔϜϫʔΫͱͯ͠ແ೉ͳબ୒ • Google͕࣮ࡍʹ࢖͍ͬͯΔͱ͍͏҆৺ײ • ૒ํ޲ετϦʔϛϯά͕ඞཁͳαʔϏεͰಛ

    ʹ໾ཱͭ͸ͣ
  27. ͍ͪAndroid։ൃऀ͔Βݟͨ gRPCͷσϝϦοτ • ੈͷதͷ৘ใ͕·ͩे෼Ͱ͸ͳ͍ • e.g. TLS 1.2͕ຊ౰ʹͪΌΜͱ࢖ΘΕ͍ͯΔͷ͔Λௐ΂ΔͨΊʹ grpc-javaͷιʔείʔυΛಡΜͩΓ •

    https://github.com/grpc/grpc-java/blob/master/ SECURITY.md ͳͲެࣜͷࢿྉ͸͋Γ·͢ • e.g. AndroidΫϥΠΞϯτ͸Java, GoͰॻ͔Εͨαʔόͱ͸௨৴Ͱ ͖ΔͷʹNode.js, RubyͰॻ͔Εͨαʔόͱ͸௨৴Ͱ͖ͳ͍ࣄ৅ʹ ૺ۰ͨ͠Γʢ2017೥ͷ࿩ʣ
  28. Twitchͷݴ͏gRPCͷσϝϦοτ • ಺෦࣮૷ͷෳࡶ͞ʹىҼ͢Δ໰୊ • HTTP/1.1Λ࢖͑ͳ͍͜ͱʹΑΔޓ׵ੑͷ໰୊ • ProtobufͷΤϯίʔυܗ͕ࣜόΠφϦͰѻ͍ ͮΒ͍ • etc

    https://blog.twitch.tv/twirp-a-sweet-new-rpc-framework-for-go-5f2febbf35f
  29. gRPCͷର߅അ”Twirp” • 2018೥1݄ެ։ͷTwitch੡RPCϑϨʔϜϫʔΫ • γϯϓϧ͔ͭHTTP/1.1Λ࢖͑ΔʢHTTP/2΋Մʣ • ࣮૷ʹProtobufΛ࢖͏͕ɺbodyͷΤϯίʔυܗࣜ͸ProtobufʢόΠφϦʣ͚ͩͰͳ͘ JSON΋Մ • ࣮͸Protobufࣗମ͕JSON΁ΤϯίʔσΟϯάͰ͖ΔʢJSON

    Mappingʣ • gRPCͰ͸ඇαϙʔτͷ໛༷ • ૒ํ޲ετϦʔϛϯά͸ඇαϙʔτ • Twitch੡͸GoɺαʔυύʔςΟ੡͸Java, Lua, JS, RubyͳͲ https://blog.twitch.tv/twirp-a-sweet-new-rpc-framework-for-go-5f2febbf35f https://groups.google.com/forum/#!topic/grpc-io/ncVgOlp16F8
  30. Android JavaͰͷgRPCͷ࢖͍ํ • ProtobufͱҰॹʹ࢖͏ͨΊɺઌʹProtobufʹ ͍ͭͯઆ໌͠·͢

  31. ͜ͷ߲ͷ·ͱΊ • gRPC͸GoogleൃͷRPCϑϨʔϜϫʔΫ • HTTP/2, ૒ํ޲ετϦʔϛϯάͳͲ • σϑΥϧτͰ͸ProtobufͱҰॹʹ࢖͏ • ௨৴ʹඞཁͳίʔυΛࣗಈੜ੒

  32. Protocol Buffers?

  33. Protocol Buffers (Protobuf) • XML౳ͷΑ͏ʹߏ଄Խ͞Εͨσʔλදݱܗࣜɺ ͳ͍͠͸IDL (Interface Description Language) •

    ݱࡏͷ࠷৽͸ver.3 (proto3) > think XML, but smaller, faster, and simpler. https://developers.google.com/protocol-buffers/docs/overview
  34. .protoϑΝΠϧ syntax = "proto3"; message Bank { int32 code =

    1; string name = 2; string name_kana = 3; } https://developers.google.com/protocol-buffers/docs/overview
  35. Protobufͱ͸ • .protoϑΝΠϧΛαʔόɾΫϥΠΞϯτؒͰڞ༗ • Protobuf compilerʹΑͬͯ.protoϑΝΠϧ͔ΒγϦΞϥΠζɾσγϦΞϥΠ ζ༻ͷΫϥε͕ੜ੒͞ΕΔ • όΠφϦʹΤϯίʔυͯ͠ૹ৴ •

    JSON΁Τϯίʔυ͢Δ͜ͱ΋Մ • ͨͩ͠ઌड़ͷ௨ΓgRPCͰ͸ະαϙʔτɺTwirpͰ͸αϙʔτ͍ͯ͠Δ໛༷ • ެࣜɾαʔυύʔςΟ߹Θͤͯ10छྨҎ্ͷݴޠʹରԠ https://developers.google.com/protocol-buffers/docs/overview
  36. γϦΞϥΠζ (Java) Bank bank = Bank.newBuilder() .setCode(123) .setName("υϩΠυۜߦ") .setNameKana("υϩΠυΪϯί΢") .build();

    output = new FileOutputStream(path); bank.writeTo(output); https://developers.google.com/protocol-buffers/docs/overview
  37. σγϦΞϥΠζ (C++) Bank bank; fstream input(path, ios::in | ios::binary); bank.ParseFromIstream(&input);

    int code = bank.code(); string name = bank.name(); string nameKana = bank.nameKana(); https://developers.google.com/protocol-buffers/docs/overview
  38. େ·͔ͳ։ൃͷྲྀΕ 1.protoϑΝΠϧΛॻ͘ 2.αʔόɾΫϥΠΞϯτؒͰ.protoϑΝΠϧΛڞ༗͢Δ 3.֤ݴޠ༻ͷίϯύΠϥͰ.protoΛίϯύΠϧ͢Δ • Androidͷ৔߹ɺbuild࣌ʹࣗಈతʹίϯύΠϧ͕ ࣮ߦ͞ΕΔΑ͏.gradleΛॻ͍͓ͯ͘ 4.ੜ੒͞ΕͨΫϥεΛ֤ίʔυͰ࢖͏

  39. ഑ྻͱmessageͷೖΕࢠ message GetBanksResponse { repeated Bank bank = 1; }

    message Bank { int32 code = 1; string name = 2; string name_kana = 3; } https://developers.google.com/protocol-buffers/docs/overview
  40. Enum enum BankAccountType { SAVING = 0; // ී௨ CHECKING

    = 1; // ౰࠲ } https://developers.google.com/protocol-buffers/docs/overview
  41. Enum enum BankAccountType { option allow_alias = true; SAVING =

    0; // ී௨ CHECKING = 1; // ౰࠲ CURRENT = 1; // ౰࠲ʢผ໊ʣ } https://developers.google.com/protocol-buffers/docs/overview
  42. @Deprecated message Bank { int32 code = 1; string name

    = 2; string name_kana = 3 [deprecated=true]; string name_katakana = 4; } https://developers.google.com/protocol-buffers/docs/overview
  43. RPC service BankListService { rpc GetBanks (GetBanksRequest) returns (GetBanksResponse); }

    message GetBanksRequest {} message GetBanksResponse { repeated Bank bank = 1; } https://developers.google.com/protocol-buffers/docs/overview
  44. ͍ͪAndroid։ൃऀ͔Βݟͨ ProtobufͷϝϦοτ • ܕ͕͋Δɹ • messageʹ૬౰͢ΔΫϥε͕ࣗಈੜ੒͞ΕΔͷͰࣗ෼Ͱॻ͘ඞཁ͕ͳ͍ • αʔόαΠυͷ։ൃऀͱίϛϡχέʔγϣϯ͠΍͍͢ • protoϑΝΠϧ͕ͦͷ··࢓༷ʹͳΔ

    • protoϑΝΠϧ͕؆қͳͷͰཉ͍͠Ϋϥε΍API͕͋ͬͨΒprotoϑΝ ΠϧΛॻ͍ͯPRΛૹΕ͹ྑ͍ • ΋ͪΖΜαʔόαΠυͷ࣮૷͕ඞཁʹͳΔ
  45. ͍ͪAndroid։ൃऀ͔Βݟͨ ProtobufͷσϝϦοτ • όΠφϦͰ௨৴͞ΕΔͷͰhuman readableͰ͸ͳ͍ • ※ JSON Mappingػೳ͸͋Δ͕ɺgRPCͰ͸ඇαϙʔτͷ໛༷ •

    curl΍charlesͳͲͰσόοάͰ͖ͳ͍ɺϒϥ΢βͰΞΫηεͯ͠Ϩεϙϯ εΛݟΔ͜ͱ͕Ͱ͖ͳ͍ • ͪΌΜͱ௨৴Ͱ͖͍ͯΔ͔Ͳ͏͔Λ֬ೝ͢ΔͨΊʹ؆୯ͳΫϥΠΞϯτΛ ॻ͍͓ͯ͘ඞཁ͕͋Δ • αʔόɾΫϥΠΞϯτؒͷprotoϑΝΠϧΛྑ͍ײ͡ʹಉظ͢Δ࢓૊Έ͕ඞཁ • ҰྫΛޙड़͠·͢
  46. ͜ͷ߲ͷ·ͱΊ • Protocol Buffers͸ߏ଄Խ͞Εͨσʔλදݱܗࣜͳ͍͠͸ IDL (Interface Description Language) • protoϑΝΠϧΛॻ͍ͯαʔόɾΫϥΠΞϯτؒͰڞ༗

    • Ϧονͳදݱྗ • ProtobufίϯύΠϥͰmessageʹ૬౰͢ΔΫϥεͷࣗ ಈੜ੒
  47. gRPC + Protocol BuffersΛ AndroidΞϓϦʹಋೖ͢Δ

  48. खॱ 1.gRPCͱProtobufΛΠϯετʔϧ͢Δ 2.Ϗϧυ࣌ʹProtobuf͔ΒίʔυΛࣗಈੜ੒͢ΔλεΫΛ ॻ͘ 3.protoϑΝΠϧΛॻ͘ 4.Ϗϧυͯ͠ίʔυੜ੒ 5.ΞϓϦ಺Ͱੜ੒͞ΕͨίʔυΛॻ͘

  49. ஫: ඞͣެࣜͷREADMEΛ֬ೝ • gRPC-Java: • https://github.com/grpc/grpc-java • Android޲͚ͱͦͷଞͷJava؀ڥ޲͚Ͱ಺༰͕ҟͳΔͷͰࠞಉ͠ͳ͍ཁ ஫ҙ •

    Protobuf: • https://github.com/google/protobuf-gradle-plugin • αϯϓϧ: • https://github.com/grpc/grpc-java/tree/master/examples/android
  50. // build.gradle buildscript { ... dependencies { ... classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'

    } } // app/build.gradle apply plugin: ‘com.android.application’ apply plugin: 'com.google.protobuf' dependencies { ... compile 'io.grpc:grpc-okhttp:1.9.0' compile 'io.grpc:grpc-protobuf-lite:1.9.0' compile 'io.grpc:grpc-stub:1.9.0' }
  51. // app/build.gradle protobuf { protoc { artifact = ‘com.google.protobuf:protoc:3.5.1-1’ }

    plugins { javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" } grpc { artifact = “io.grpc:protoc-gen-grpc-java:1.9.0” } } generateProtoTasks { all().each { task -> task.plugins { javalite {} grpc { option 'lite' } } } } }
  52. 3. protoϑΝΠϧΛॻ͘ • src/main/proto ΍ src/test/proto ҎԼʹproto ϑΝΠϧΛஔ͘ • ҎԼͷίϚϯυͰprotoϑΝΠϧ͕ίϯύΠ

    ϧՄೳ͔֬ೝͰ͖Δ • $ protoc —java_out=<PATH> foo.proto
  53. 4. Ϗϧυͯ͠ίʔυੜ੒ • ASͰϏϧυΛ࣮ߦ͢ΔͱҎԼʹprotoϑΝΠϧ ͔Βੜ੒͞ΕͨJavaίʔυ͕ஔ͔ΕΔ • app/build/generated/source/proto/

  54. service BankListService { rpc GetBanks (GetBanksRequest) returns (GetBanksResponse); } message

    GetBanksRequest {} message GetBanksResponse { repeated Bank bank = 1; }
  55. ManagedChannel channel = OkHttpChannelBuilder .forAddress("example.com", "443") .build(); BankListServiceStub stub =

    BankListServiceGrpc.newStub(channel); GetBanksRquest request = GetBanksRequest .newBuilder() .build(); stub.getBanks(request, new StreamObserver<GetBanksResponse>() { @Override public void onNext(GetBanksResponse response) { List<Bank> banks = response.getBankList() ... } @Override public void onError(Throwable throwable) { ... } @Override public void onCompleted() { ... } );
  56. ͜ͷ߲ͷ·ͱΊ • AndroidͰ͸gRPC-JavaͱProtocol Buffers Gradle Plugin͕ඞཁ • gRPC + Protocol

    Buffersͷಋೖ࣌͸ඞͣެࣜ ϦϙδτϦͷREADMEΛ֬ೝʂʂ
  57. ։ൃ্ͷ޻෉

  58. ֤repoͷprotoϑΝΠϧͷಉظ proto files repo iOS app repo Android app repo

    API server repo proto files proto files proto files ྑ͍ײ͡ʹprofo files repoΛίϐʔ or ࢀর͍ͨ͠
  59. proto files repo Digdag GCP Cloud Functions iOS app repo

    Android app repo API server repo 1. PRϚʔδͰwebhookૹ৴ 2. DigdagϫʔΫϑϩʔIDΛ ɹࢦఆͯ͠ϫʔΫϑϩʔىಈ 3. ֤repoͷprofo filesΛ ɹߋ৽͢ΔPRΛ࡞੒ 4. PRͷࠩ෼ΛݟͯϚʔδʢखಈʣ
  60. proto files repo Digdag GCP Cloud Functions iOS app repo

    Android app repo API server repo 1. PRϚʔδͰwebhookૹ৴ 2. DigdagϫʔΫϑϩʔIDΛ ɹࢦఆͯ͠ϫʔΫϑϩʔىಈ 3. ֤repoͷprofo filesΛ ɹߋ৽͢ΔPRΛ࡞੒ 4. PRͷࠩ෼ΛݟͯϚʔδʢखಈʣ
  61. GitHubͷwebhookઃఆը໘

  62. proto files repo Digdag GCP Cloud Functions iOS app repo

    Android app repo API server repo 1. PRϚʔδͰwebhookૹ৴ 2. DigdagϫʔΫϑϩʔIDΛ ɹࢦఆͯ͠ϫʔΫϑϩʔىಈ 3. ֤repoͷprofo filesΛ ɹߋ৽͢ΔPRΛ࡞੒ 4. PRͷࠩ෼ΛݟͯϚʔδʢखಈʣ
  63. exports.syncTheoProto = function syncTheoProto (req, res) { ... postData =

    { "workflowId": settings.workflowId, ... } req.write(JSON.stringify(postData)); req.end(); ... }; POSTϦΫΤετʹ༧Ί࡞͓͍ͬͯͨ DigdagϫʔΫϑϩʔͷIDΛ෇Ճ͢Δ
  64. proto files repo Digdag GCP Cloud Functions iOS app repo

    Android app repo API server repo 1. PRϚʔδͰwebhookૹ৴ 2. DigdagϫʔΫϑϩʔIDΛ ɹࢦఆͯ͠ϫʔΫϑϩʔىಈ 3. ֤repoͷprofo filesΛ ɹߋ৽͢ΔPRΛ࡞੒ 4. PRͷࠩ෼ΛݟͯϚʔδʢखಈʣ
  65. proto files repo Digdag GCP Cloud Functions iOS app repo

    Android app repo API server repo 1. PRϚʔδͰwebhookૹ৴ 2. DigdagϫʔΫϑϩʔIDΛ ɹࢦఆͯ͠ϫʔΫϑϩʔىಈ 3. ֤repoͷprofo filesΛ ɹߋ৽͢ΔPRΛ࡞੒ 4. PRͷࠩ෼ΛݟͯϚʔδʢखಈʣ
  66. None
  67. ͜ͷ߲ͷ·ͱΊ • protoϑΝΠϧΛαʔόɾΫϥΠΞϯτؒͰಉ ظ͢Δ࢓૊Έ͕͋Δͱศར • ࠓͷͱ͜Ζwebhook, αʔόʔϨεΞϓϦ έʔγϣϯ, ϫʔΫϑϩʔΤϯδϯΛ૊Έ߹ Θͤͯӡ༻͍ͯ͠·͢

  68. ࠷ޙʹ… Swagger or GraphQL or gRPC??? • গͳ͘ͱ΋ݱ࣌఺ͰͲΕ͔͕ઈରతʹྑ͍ͱ͍͏͜ͱ͸ແͦ͞͏ • ൺֱهࣄ͕୔ࢁ͋Δ

    • e.g. https://brandur.org/api-paradigms • ͜ͷهࣄʹର͢Δٞ࿦: https://news.ycombinator.com/item?id=14003134 • DroidKaigi 2018Ͱ΋ൃද͞Εͨʂ • Swagger: https://speakerdeck.com/magiepooh/madaapiding-yi-guan-li- dexiao-hao-siterufalse-swaggerwoyong-itada-gui-mo-apurishi-dai-falseapiding- yi-guan-li-tokodozienereto • GraphQL: https://speakerdeck.com/gfx/subarasikigraphqlfalsesekaiheyoukoso
  69. ൃදͷ·ͱΊ • RESTͱRPC͸దࡐదॴ • gRPC͸GoogleൃͷRPCϑϨʔϜϫʔΫ • Protobuf͸ߏ଄Խ͞Εͨσʔλදݱܗࣜͳ͍͠͸IDL • gRPC +

    ProtobufͰίʔυΛࣗಈੜ੒ • ಋೖ࣌͸ඞͣ࠷৽ͷެࣜREADMEΛ֬ೝ • ProtobufΛαʔόɾΫϥΠΞϯτؒͰಉظ͢Δ࢓૊ΈΛ࡞Ζ͏ • Swagger΍GraphQLʹ͍ͭͯ΋ௐ΂ͯΈΑ͏
  70. THANK YOU!