Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    I am not sure what a playback service is. What does it do? Seems to me you already have a player in the UI, and what you need on the backend is a media data retrieval service. And of course, that could easily be stateless. Commented Jun 30, 2018 at 9:21
  • Playback service implements the business logic to carry out various operations related to playback, like load track, play, pause, resume etc. UI doesn't have any playback logic, rather it only has the logic related to the UI display and forwarding the user input to the lower layer (playback service or browser). Commented Jun 30, 2018 at 13:26
  • That strikes me as a very unusual separation of concerns, but if that is the architecture, the playback service must be stateful. Which is not the end of the world. Commented Jun 30, 2018 at 19:18
  • Well I guess you could store the state somewhere else, e.g. a signed token held by the client and passed with each request, sort of like a browser cookie. Commented Jul 2, 2018 at 7:54
  • It should be perfectly fine for the browser to maintain state related to the user session. Keeping the servers stateless helps with scaling out by simply adding more instances. The question is where in your architecture you intend to keep state. Usual choices are in a database or in the client. You just need a way of identifying which player you are working with. That can be looked up using the user's token. Commented Jul 10, 2018 at 19:55