11 Communicating Between Servers
Before you begin: Join our book community on Discord
Give your feedback straight to the author himself and chat to other early readers on our Discord server (find the "rust-web-programming-3e" channel under EARLY ACCESS SUBSCRIPTION).
At this point in the book, we have two servers which are the authentication server and to-do server, however, they are not talking to each other yet. In microservices, we must be able to get our servers sending messages between each other. For our system, we must get our to-do server making requests to out authentication server. This request checks that the user is valid before we perform a database transaction on to-do items. As these items are related to the user ID passed in the request requesting the database transaction. To achieve this, the chapter will cover the following:
Getting users from auth with the unique ID
Making auth accessible to other servers
Tethering users...