Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Modular Monolith + Go @ newmo

Modular Monolith + Go @ newmo

Yuki Ito

June 07, 2024

More Decks by Yuki Ito

Other Decks in Programming


  1. Modular Monolith Almost all the cases where I've heard of

    a system that was built as a microservice system from scratch, it has ended up in serious trouble. ... you shouldn't start a new project with microservices, even if you're sure your application will be big enough to make it worthwhile. MonolithFirst Martin Fowler https://martinfowler.com/bliki/MonolithFirst.html
  2. Modular Monolith ... splitting applications into independently deployable microservices is

    not without its challenges, some of which directly contradict the bene fi ts. Towards Modern Development of Cloud Applications Google (ServiceWeaver) https://dl.acm.org/doi/10.1145/3593856.3595909 ... Write monolithic applications that are modularized into logically distinct components.
  3. Modular Monolith - Component func Component(ctx context.Context, c *app.Component) error

    { env := new(environments) err := c.LoadEnvironments(env) db, err := c.GetDatabase(ctx) // ... c.AddGraphQLHandler(/*...*/) c.AddGRPCService(/*...*/) return c.Run(ctx) }
  4. Modular Monolith - Application func main() { app.Run(application) } func

    application(ctx context.Context, a *app.Application) error { a.AddComponent("driver", driver.Component) a.AddComponent("passenger", passenger.Component) return a.Run(ctx) }