• ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
    link
    fedilink
    arrow-up
    2
    ·
    7 months ago

    There is data that gets persisted and needs to be stored somewhere, and then there’s the UI state that’s ephemeral. The amount of data that gets persisted tends to be small, and the logic around it is often trivial.

        • areyouevenreal@lemm.ee
          link
          fedilink
          arrow-up
          1
          ·
          7 months ago

          How am I being obtuse? You have been trying to trivialise the backend and now frontend as well. Backend isn’t just writing PHP or whatever, it’s setting up database servers, authentication proxies, and all that stuff. Not everything can be stateless.

          • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
            link
            fedilink
            arrow-up
            4
            ·
            7 months ago

            I’m not trivializing anything here. What I actually said was that when all the UI logic lives on the frontend, then the backend just has dumb fetch and store operations along with an auth layer. In this scenario, the backend code can indeed be largely stateless. Specifically, it doesn’t care about the state of the user session or the UI. The only one trivializing things here is you by completely ignoring the nuance of what’s being explained to you.

            • areyouevenreal@lemm.ee
              link
              fedilink
              arrow-up
              1
              ·
              7 months ago

              The only nuances here seem to be: a) very simple websites need little state (but still aren’t stateless) and b) that you can move the state around to make something look stateless within a narrow view.

                  • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
                    link
                    fedilink
                    arrow-up
                    1
                    ·
                    7 months ago

                    Evidently you don’t understand what people mean when they talk about stateless backend, so let me explain. The point there is regarding horizontal scaling. If your backend code is stateful then it has user context in memory, and requests for a particular user session have to be handled by the same instance of the service. With a stateless backend all the context lives on the client, and the requests can be handled by any instance on the backend. So now you can spin up as many instances of the service as you need, and you don’t need to care which one picks up the request. The fact that you might be persisting some data to the db in the process of handling the request is neither here nor there. Hope that helps you.