preface

There is no connection between card games and micro-services, just because the author is engaged in the development of card games industry. Recently, because the old framework encountered many difficult problems with the increase of load, and needed to be adjusted from the framework, I chose micro-services for reconstruction

  • On the linguistic level, golang was chosen
  • Release deployment tool, chose Kubernetes, the main consideration is too few team people, need a tool that gets twice the result with half the effort, also wrote a bit related blog before, Kubernetes study notes (two) : K8S initial experience
  • Micro service framework, the choice of micro, the main consideration is to believe that the big bull from Google, the framework is quite good
  • The data serialization protocol uses Protobuf instead of JSON
  • On RPC framework, Google’S GRPC was chosen, mainly considering language neutrality and high performance, which is more suitable for games
  • Service discovery, service registration, consul was selected for simplicity and convenience. In a formal environment, the k8S built-in service is used for discovery, which will be described in details later
  • Service mesh has not been considered for the time being, mainly because I didn’t have a good command of it after reading this book, so I gave it up for the time being. Access service is hard-coded by micro (actually very convenient).

In addition to micro-services, the game itself has also been optimized in terms of business, mainly including:

  • The separation of the game room from the game itself makes it easy to expand both the room and the gameplay
  • Games are separate from algorithms and can be written and tested independently
  • Poker Game Design
  • Mahjong Game Design
  • A generic Websocket gateway that uses PROto binary data transfer

Blog content

Micro Framework Introduction: Micro Toolkit Brand games using microservice reconstruction Notes (III) : Micro Framework Introduction GO-Micro brand games using microservice reconstruction notes (IV) : Micro framework using experience card games using microservices reconstruction notes (five) : Micro source reading card games using microservices reconstruction notes (six) : Protobuf pit climbing card games using microservices reconstruction notes (seven) : using GRPC to build games bidirectional streaming card games using microservices reconstruction notes (eight) : Gateway server game card games using micro service refactoring notes (9) : the game more versions compatible with hot update card games using micro service refactoring notes (10) : mahjong design card games using micro service refactoring notes (11) : poker card game design using micro service refactoring notes (12) : in k8s deployment

.

I have learned golang, Micro, K8S, GRPC, Protobuf and other knowledge for a short time, if there is any misunderstanding, welcome criticism and correction, you can add my wechat to discuss learning