unity – Leaderboard and Matchmaking

tldr: What architecture is advisable for a cross-platform game for a leaderboard and matchmaking system?

Context: New graduate software engineer starting on a project and am unsure on an issue. The game itself is already complete but requires some community upgrade. Unity game engine. Would like to use Azure if at all possible.

I’ve been doing some research into how to implement a leaderboard using Azure services (trying to avoid playfab) but either don’t know enough about the subject to research correctly or resources are limited (I’m more inclined to lean to the former).

I would like to implement a leaderboard system that would eventually be extended into a matchmaking system for my game and need some guidance on the correct path to take, do I:

  1. Create a direct hook-up from client to cloud DB, where the logic of matchmaking rating is done on the client via GET -> logic client side -> POST (this I have the knowledge and resources to do, but I think may have security issues?)

  2. Create a cloud hosted app with an API where the clients POST data at game end and the cloud app process everything. (This I can’t find resources on for Azure, or don’t know what I am looking for. I feel like this has less security issues.)

  3. Some other option that I have not mentioned or some best practice that developers follow.

Any help at all would be great.