Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: An easy / optimal way to get Server Time #1150

Open
vg-swift opened this issue Nov 18, 2024 · 6 comments
Open

[FR]: An easy / optimal way to get Server Time #1150

vg-swift opened this issue Nov 18, 2024 · 6 comments

Comments

@vg-swift
Copy link

Description

We have a custom Firebase Function implemented ot request Server Time, and the app always requests it at least once per hour (or whenever something happens in the game).

Our current issues:

  • We have millions of players
  • As you can see from the graph below, when all active players request time at hour intervals, the request can timeout, due to servers not scaling fast enough.
  • It's hard to find optimal configuration for this function, also in terms of pricing
    image

If you have any other ideas, please let us know.

API Proposal

No response

Firebase Product(s)

All

Targeted Platform(s)

Apple Platforms, Android, Desktop

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@argzdev
Copy link

argzdev commented Nov 18, 2024

Hey @vg-swift, thanks for reaching out. This seems more of an architectural design problem. I'd recommend posting this question in Stack Overflow to get better help. There are likely more engineers that have best practices and useful advices regarding this topic in Stack Overflow. That said, I'll go ahead and close this thread. Thanks!

@argzdev argzdev closed this as completed Nov 18, 2024
@vg-swift
Copy link
Author

vg-swift commented Nov 18, 2024

It would still be nice if it would be a default feature from Firebase, that's why I submitted this as Feature Request.

There are already a couple of threads like this on StackOverflow & Reddit, but they all mostly suggest using the ServerValue from RealtimeDatabase, which has its own drawbacks.

@argzdev
Copy link

argzdev commented Nov 18, 2024

Thanks for the getting back to us. I'm not exactly sure what optimization are we looking for here. Could you share more details of what specific feature you'd like to have? Usually for the most parts, the Server Timestamp should be enough. I'm curious to know more about the drawbacks, could you also share some details about that too?

@vg-swift
Copy link
Author

@argzdev, thanks for reopening this thread. as per this thread, it returns the client time. Our main concern is that ServerValue.TIMESTAMP can be manipulated on the client side, leading to potential exploits in time-sensitive scenarios like multiplayer events or timed rewards.

We’re looking for a built-in Firebase feature that provides an accurate, secure server timestamp that scales well and is cost-effective. Current custom Firebase Function solutions struggle with high request volumes and costs.

Would it be possible for Firebase to include a feature that offers reliable, tamper-proof server time with better performance and scalability?

Thanks!

@argzdev
Copy link

argzdev commented Nov 19, 2024

That does sound like a cause for concern. I'll see if I can bring this up during our engineering syncs. That said, we are unable to promise any timeline for this, but we'll definitely keep this under our radar.

P.S. For folks who find this useful, adding an emoji thumbs up on the original post can help us prioritize adding this to the roadmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants