Slide 1

Slide 1 text

Modular Monolith + Go @ newmo @yuki.ito

Slide 2

Slide 2 text

newmo Architect Yuki Ito @mrno110

Slide 3

Slide 3 text

GraphQL Federation + gRPC

Slide 4

Slide 4 text

Architecture

Slide 5

Slide 5 text

Architecture

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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.

Slide 8

Slide 8 text

Modular Monolith Application Component Component Component

Slide 9

Slide 9 text

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) }

Slide 10

Slide 10 text

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) }

Slide 11

Slide 11 text

Modular Monolith ໌೔ͷ εϙϯαʔϒʔεͰʂʂʂ ৄ͘͠͸...