warpedvoxels / java-edition

🚧 An open-source, modern, and modular network of Minecraft: Java Edition servers.
https://discord.gg/gRFnmxHkFb
Other
38 stars 6 forks source link

Moving to a RPC server #28

Open axyiee opened 2 years ago

axyiee commented 2 years ago

Moving to a RPC server

Table of contents:

  1. 📰 Summary
  2. 🤔 Motivations and the proposed solution
  3. 🤷 Final considerations

Summary

We should use a RPC server instead of a REST server for our internal CRUD operations.

Motivations and the proposed solution

We recently proposed the usage of a REST server for both internal and public operations, but in fact, REST is about 7 times slower than a gRPC server for data receiving and 10 times slower than gRPC for data sending, so that's the main reason for avoiding REST in our network.

Another reason for avoiding the REST usage in our server is it requires many workarounds for adding the possibility of internal calls and it is way more insecure. It is obvious that the Public API will still be available for the Rest API, but internally it will access our RPC server though. In other words, internally we will use gRPC directly, and a REST server will be available for public consumption of our services.

The main reason for using gRPC specifically and not another RPC framework is it gRPC is available for our target programming languages (Kotlin is officially supported, and Rust is supported by the community), and it is fast enough. It is also updated very frequently, so we don't expect to be using outdated technologies.

Final considerations

Suggestions are appreciated for new sections in this issue, or if you have a better idea about how to structure or improve our RPC server, feel free to comment down below. Thank you for the attention.

axyiee commented 2 years ago

Progress available on stronghold