• Pieisawesome@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    4 days ago

    If the Java monolith used 6 gb of ram and each Go service uses 500mb of ram, but now there are 16 micro services, which uses more memory?

    Monoliths are more efficient, but hav other issues.

    • fruitycoder@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      ·
      4 days ago

      Can be more efficient, but it’s not always. You can scale those services more too. Do you need all 16 running on idle? Lazy load then as needed. Also does it really need a whole 500mb? Why? If its just a cache made that’s better handles with another shared service (redis, etc). If it’s software, why? A full “fat” Suse Base Container image uncompressed is 94.8mb and not all of that will be loaded in RAM. Going down to a micro at 23mb. All this and now you can deploy it on the shared infra, no separate OS, Management/security/logging/networking solution.

      • Pieisawesome@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 days ago

        Sure, but they also have duplication, IE database connections. Each service needs at least 1 connection versus one for a monolith.

        There are pros and cons to any architecture.

        • fruitycoder@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          3 days ago

          The IPC increase is the most sure tradeoff for sure.

          Agreed, engineering is deciding what trade offs are acceptable. Cargo culting any pattern is a good way to build runaway junk