I know that Lemmy is open source and it can only get better from here on out, but I do wonder if any experts can weigh in whether the foundation is well written? Or are we building on top of 4 years worth of tech debt?

  • BURN@lemmy.world
    link
    fedilink
    arrow-up
    32
    arrow-down
    7
    ·
    1 year ago

    It’s decent, but it isn’t scalable, at least not yet.

    Right now the entire Lemmy backend is one big “monolith”. One app does everything from logins and signups to posting and commenting. This makes it a little harder to scale, and I wouldn’t be surprised to see it split out into multiple micro services sooner rather than later so some of the bigger instances can scale better.

    I’d love to know where the higher level dev stuff is being discussed and if they’ve made a decision on why or why not microservices.

    • sosodev@lemmy.world
      link
      fedilink
      arrow-up
      33
      arrow-down
      4
      ·
      1 year ago

      There’s no reason that a monolith can’t scale. In fact you scale a monolith the same way you scale micro services.

      The real reason to use micro services is because you can have individual teams own a small set of services. Lemmy isn’t built by a huge corporation though so that doesn’t really make sense.

      • psilves1@lemmy.world
        link
        fedilink
        arrow-up
        12
        arrow-down
        4
        ·
        1 year ago

        You definitely can’t scale a monolith the same way you can scale a micro service

        • sosodev@lemmy.world
          link
          fedilink
          arrow-up
          2
          arrow-down
          1
          ·
          1 year ago

          You can easily scale a monolith. You typically horizontally replicate any web server (monolith or not) to handle whatever traffic you’re getting. It shouldn’t really matter what type of traffic it is. Plenty of the world’s biggest websites run monoliths in production. You know how people used to say “rails doesn’t scale”? Well they were wrong because Rails monoliths are behind some huge companies like GitHub and Shopify.

          The lemmy backend is also quite lightweight and parallel so it’s cheap and effective to replicate.

          In my professional experience microservices are usually a dumpster fire from both the dev perspective and an ops perspective (I’m a Site Reliability Engineer).

          • boeman@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            1 year ago

            I can’t say I disagree… Poorly implemented microservice architecture is the bane of my existence. Well implemented, though, and it makes my job so much easier.

            Granted, my SRE team has all public facing production infrastructure built using an IAC process, if something causes too much trouble, it’s easier to quarantine and rebuild the offending node(s), and can be complete in under 10 minutes.

            The biggest problem is far too many developers ignore the best practices and just shift existing code into smaller services. That will never give you either performance or stability benefits. Honestly, it will probably make any issues worse. Microservice architecture is a huge shift in thinking. The services need to be fairly independent of each other to really make any gains. To get to that point will always take a whole lot of work. That being said, there is nothing inherently wrong with some monoliths, but the benefits of splitting out as much of the higher traffic and resource intensive work should never be overlooked.

      • Fauzruk@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Exactly, and nothing prevent a monolith from doing vertical slicing at the database level as long as the monolith is not crossing its boundaries. This is the only scaling part that is inherent to microservices. If the issue is the horizontal scaling, microservices doesn’t solve anything in this case.

        Also specifically on what I understand of the Fediverse, you want something easy to host and monitor since a lot of people will roll out their own instances which are known issues when running microservices.

    • platypus_plumba@sh.itjust.works
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      1 year ago

      This is a discussion I’m also interested in. Migrating a monolith to microservices is a big decision that can have serious performance, maintainability and development impact.

      Microservices can be very complex and hard to maintain compared to a monolith. Just the deployment and monitoring could turn into a hassle for instance maintainers. Ease of deployment and maintenance is a big deal in a federated environment. Add too much complexity and people won’t want to be part of it.

      I’ve seen some teams do hybrids. Like allowing the codebase to be a single artifact or allowing it to be broken by functionalities. That way people can deploy it the easy way or the performant way, as their needs change.

      • BURN@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        That’s what I’m thinking. Microservices could be a huge pain in the ass, but a hybrid approach would make things much better. Smaller instances wouldn’t be a problem, but the larger instances would be able to separate out components.

        To keep it possible to run monolithicly would probably need a lot of work, but it’s possible to do and would probably be the best approach.

      • boeman@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Gitlab is a great example of a piece of software that has multiple deployment strategies like that.