• frezik@midwest.social
    link
    fedilink
    arrow-up
    0
    ·
    6 months ago

    If object oriented design is fundamentally about components sending messages to each other, then microservices are a different route to OO design. If people are bad at OO design, then they’re likely bad at designing microservices, as well. The two aren’t so separate.

    All these programs now need to talk over the network instead of simply communicating in the same process.

    This is where things go really wrong. Separating components over the network can be useful, but needs careful consideration. The end result can easily be noticeably slower than the original, and I’m surprised anybody thought otherwise.

    • 1984@lemmy.today
      link
      fedilink
      arrow-up
      0
      ·
      6 months ago

      It’s absolutely slower. There is no way to make a network request faster than a function call. It’s slower by probably thousands of times.

      • namingthingsiseasy@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        6 months ago

        There is no way to make a network request faster than a function call.

        Apologies in advance if this it too pedantic, but this isn’t necessarily true. If you’re talking about an operation call that takes ~seconds to run, then the network overhead is negligible. And if you need specialized hardware for it, then it definitely could be delegate it out to a separate machine over the network. Examples could include requiring a GPU, more RAM, or even a faster CPU if your main application is running on more power-efficient CPUs.

        I’m not saying that this is true in every case - they are definitely niche cases. But I definitely wouldn’t say that network requests are never faster than local function calls.

        • Corbin@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          6 months ago

          Well put. And this is a generic pattern; for example, GPUs are only faster than CPUs if the cost of preparing the GPU and retrieving the result is faster than directly evaluating the algorithm on the CPU. This also applies to main memory! Anything outside of the CPU can incur a latency/throughput/scaling tradeoff.