Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rustとtonicで始める gRPC入門(GENIEE Edit)

Rustとtonicで始める gRPC入門(GENIEE Edit)

Tsubasa SEKIGUCHI

October 05, 2024
Tweet

More Decks by Tsubasa SEKIGUCHI

Other Decks in Programming

Transcript

  1. gRPCͱ͸ʁ GoogleࣾͷߟҊͨ͠RPCϓϩτίϧ RPC͸Remote Procedure Call(ԕִखଓ͖ݺͼग़͠ ͷུͰ͢ gRPC͸ࣗࣾϚΠΫϩαʔϏεؒͰͷ಺੡γεςϜʮStubbyʯ͕લ਎  IDL͔Β༷ʑͳݴޠͷίʔυ͕ੜ੒Ͱ͖Δ ΋ͪΖΜJavaScript΋ՄೳͰ͢

    gRPC-webͰWebϒϥ΢β͔ΒgRPCαʔόʔΛୟ͚Δ 8FCϒϥ΢βͰͷ࢖༻Ͱ͸੍ݶ͕͋Δ αʔόʔͱͷʮ௚઀ʯ௨৴͸Ͱ͖ͳ͍ʢجຊతʹ&OWPZ౳ͷϓϩΩγͷ༻ҙ͕ඞཁʣ  Bi-directional streaming(C/SؒͰ೚ҙͷλΠϛϯάͰ௨৴͕Ͱ͖Δ)ʹରԠ͍ͯ͠ͳ͍
  2. gRPCͷϖΠϩʔυ͸όΠφϦ όΠφϦͰ΍ΓऔΓ͢ΔͷͰɺઌ΄Ͳઆ໌ͨ͠ʮϨεϙϯεσʔλͷංେԽʯʹ͸ޮՌతͦ͏Ͱ͢ΑͶɻ ChromeͷDevToolsͰ͸όΠφϦͷͨΊ֬ೝ͕͠ΜͲ͔ͬͨΓ͠·͢ɻ Protocol Bu ff ersͰλΠϓηʔϑ ͪ͜Β͸REST APIͱͷൺֱͰ͕͢ɺ gRPC

    APIͱ௨৴͢Δ࣌ʹඞͣProtocol Bu ff ersͷεΩʔϚఆٛΛ࢖༻͢ΔͷͰ ௨৴͢Δલ͔ΒϦΫΤετͱϨεϙϯεͷܕ͕Θ͔Βͳ͍ɺͱ͍͏͜ͱ͸ͳ͘ͳΔ͸ͣͰ͢ɻ ཁ͢ΔʹREST APIͰ͍͏Swagger͕࠷ॳ͔Β࢖͑Δͱ͍ͬͨΠϝʔδͰ͢ɻ StationAPIϑϧεΫϥονͷϞνϕʔγϣϯ(3/3)
  3.  Protocol Bu ff ersͰεΩʔϚఆٛΛߦ͏  RustͰ࣮૷  AWSʹσϓϩΠ 

    PostmanͰୟ͍ͯΈΔ  ΞϓϦʹͭͳ͗͜Ή ͬ͟ͱ΍ͬͨ͜ͱ
  4. gRPC APIΛσϓϩΠ ελοΫʹ͍ͭͯ StationAPI͸AWSʹ৐͔ͬͬͯ·͢ɻ࢖͍ͬͯΔαʔϏε͸ - Elastic Container Service(ECS)
 - Elastic

    Container Registry(ECR)
 - Elastic Load Balancing(ELB)
 
 ΄͔ʹ΋GCPͷج൫΋࢖͍ͬͯ·͢
 - Text-to-Speech AI Firebase
 - Firestore/Storage/Messaging/Authentication/Functions