The great Woogles refactor #889
Replies: 2 comments
-
Step 1
|
Beta Was this translation helpful? Give feedback.
-
Copied-and-pasted from closed issue #914: This PR is a draft and will probably be closed. The files in it should likely be merged into #905 This aims to do a few things: First, eliminate the asymmetry between message formats going from the socket server to the API server and from the API server to the socket server. This is eventually because API server messages, or whatever replaces it, will be pushed in a fan-out way to multiple services potentially. They should not have a special length encoding. The goal is to include the message type in the subject name in both directions. i.e. currently socket server pushes to ipc.pb.3.userid.connid.whatever, which the API server picks up. 3 is the message type here. But API server pushes to channels that look like userid.abcdef, which do not contain the message type. Instead, there's an EventWrapper that adds the type and length of the packet to the binary encoding. This is unideal for several reasons: limits packet length artificially Then, the socket server would append the message type and length to the binary encoding right before sending it out to websocket consumers. It can also split it up into pieces, or even turn it into plain text, etc. The socket server should be modified to be able to handle both types of messages. If pb.x is in the topic name, it would add the length/type encoding before forwarding it on, otherwise, it just forwards the message on. Later on we can remove the legacy encoding. |
Beta Was this translation helpful? Give feedback.
-
We have a lot of backend tech debt that we want to fix this year. The major tech debt is as follows, but this is not an exhaustive list:
The following is a proposed architecture redesign.
This is a circle of services with NATS in the middle.
Each "service"/module communicates through NATS. Each module is easily testable, deployable, and independent. Each only has inputs/outputs.
Communication between services and NATS should be protobuf. Communication to user doesn't need to be protobuf. Socket comms can even be plain text with a translation layer. Twirp API can maybe be replaced with something more RESTful if desired. See OpenAPI.
Sample requests
Make a move in a game
Request last games in a profile
Help needed
If you are a developer and are excited to help us build this new architecture, please get in touch with us via Discord, or here. We would love your help.
Beta Was this translation helpful? Give feedback.
All reactions