question

Baljeet Singh avatar image
Baljeet Singh asked

Existing entity model to PlayFab

Hi

So much confusion to start with PlayFab.

1. I have checked events how can I implement
2. I have tested default play stream events with webhooks
3. I have to save entities in Players objects

but want to clear the confusion below

1. I have already an application
2. Backend is like .net core and cosmo DB using entity framework
3. It's very easy to log in from one player and he can host game challenges, simply I am saving records in DB tables
4. Another user can see the hosted games easily by logging in because we can just fetch records from DB tables
5. THE CONFUSION IS: How can I replace those tables into PlayFab data and players can see others' challenges and can send invites to their hosted game challenges and how I can modify that hosted data by another player login?

I want to see the whole entity's data in one place like other DBs.

We need to share data of players across multiple games and across all players in the same game as well.

Is it possible to access data by just logging in to every user into the PlayFab by passing an access token?

please suggest the docs or Ideas.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

The thing to understand is that PlayFab was designed to be a whitelabel backend service, with many of the generic base components games (and other apps - it's just that we designed for games) need in the cloud, while minimizing the Ops load on the developer. So, when you use our data systems, commerce service, leaderboads, etc., our team is your Ops team. You're not having to run a 24/7 Ops center with engineers on-call because we monitor and maintain all those core services. We also specifically chose to have PlayFab be a monolithic service, with all titles cleanly separated in terms of security, but all running in a single service cluster. That way a) we can keep the pricing as low as possible (economy of scale), b) scale improvements benefit everyone (we operate well over 1B MAU and 125K RPS regularly), and c) the team prioritizes any work needed due to alerts for everyone.

As you can imagine, that also means we cannot allow open query to our data tables, as one pathological query could cause performance issues for literally thousands of titles. So if you're approaching PlayFab as a data table service, that's not the right way to think about it. Instead, I'd recommend a top-down approach, taking the features you want to enable from the view of what the player sees in their experience, and thinking about how you can implement that using the features we provide. For data systems, I'd recommend reading through our docs and quickstarts here: PlayFab Data documentation - PlayFab | Microsoft Docs

Specific to challenges, you could certainly update a player's Entity Object or File with some data from another player, and use a polling system to check for those, but it would be more efficient to use a PubSub (publish/subscribe) model. We have a sample showing a SignalR implementation of this here (PlayFab-Samples/Samples/CSharp/MessagingClient at master PlayFab/PlayFab-Samples (github.com)), and we'll be providing a built-in PubSub service down the road (date TBD, so keep an eye on our Roadmap page: PlayFab Roadmap - PlayFab | Microsoft Docs).

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Baljeet Singh avatar image Baljeet Singh commented ·

Is that mean PlayFab pub/sub feature has launched?

0 Likes 0 ·
brendan avatar image brendan Baljeet Singh commented ·

No, what I said immediately above is that we will provide an integrated PubSub feature in the future, but that we do not have a date we can announce for that yet. But we also have a sample showing how to use SignalR, if you have an urgent need for a system like that.

0 Likes 0 ·
Baljeet Singh avatar image Baljeet Singh brendan commented ·

Ok, Thanks for sharing Brendan. I am using currently AzureSignalR with AzureApp functon. CloudScript will trigger AzureFuncApp and AzureFuncApp is triggering to connected clients.

Do you think we can Sync cosmos DB with PlayFab? I am trying currently CosmoDb with PlayFab as below.

1. Register with email, password in PlayFab.
2. User has other many fields and related objects as well so, I am saving all other fields in Cosmo after getting PlayFabId from PlayFab registration.

Can I continue this way? If yes, will I able to sync all cosmo DB tables data with PlayFab?

0 Likes 0 ·
Show more comments
Baljeet Singh avatar image
Baljeet Singh answered

Is that mean PlayFab pub/sub feature has launched?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.