4 ms·
we are actually doing precisely the same thing at instacart (breaking our 1+ million lines of code monolith into discrete components, which we call "domains"),
by octernion 6y ago
we are actually doing precisely the same thing at instacart (breaking our 1+ million lines of code monolith into discrete components, which we call "domains"), and typing the boundaries and as much of the internals of these domains as possible with sorbet types.
this has the benefit of ruby dynamicism (fast development within domains, you can use all the nice railsy tooling, activerecord, and all the libraries we've built over the years), with type safety at the boundaries (we've also put in timeouts, thread separation, and error handling at the boundaries).
the additional benefit for using sorbet is that it makes making typed RPC calls (over twirp or graphql) much easier as you can introspect the boundaries trivially.
really cool to see other companies evolving similarly given the same starting conditions!
- exterm 6y agoThere are quite a few people talking about this kind of stuff on https://rubymod.slack.com https://rubymod.slack.com. I can send invites, just DM me on twitter https://twitter.com/_exterm https://twitter.com/_exterm
- dragosmocrii 6y agoSlightly off topic, but does anyone know if this "component based" development is what umbrella applications are in Elixir?
- exterm 6y agoIt's certainly related. In very general terms, I would say splitting a Rails app into multiple engines is the same pattern as umbrella applications. However, there are more interesting specifics here about things like all engines sharing a database, but having exclusive ownership of tables, as well as splitting HTTP routing over multiple engines etc.
- Arubis 6y agoI think you'll also find a lot of conceptual overlap with Phoenix Contexts; they'll generally all start as part of the same monolith/app but are sufficiently discrete that you can separate them out more easily than the Rails situation in TFA.
- ravenstine 6y agoAm I the only one who has a distaste for this phrase "component based development"? It just seems like a fancy way of saying object oriented programming without an overarching design pattern.
- aidos 6y agoSounds like the “components” described above are much larger than classes.
- octernion 6y agothat's correct, at least for us a domain encapsulates many response types and dozens of different APIs that wrap various datastores, business logic, etc.
- octernion 6y agowe've actually taken the pattern of making the classes relatively stateless, and explicitly passing around typed state through these explicit apis. it's not really the same design pattern and imo conceptually different.
- IshKebab 6y agoMy god I can't imagine a million lines of untyped code. Must be hell. Presumably you spend all day writing tests?
- octernion 6y agohah, it's not hell but it's not entirely pleasant either. a _lot_ of that is tests, which is essentially how contracts and safety is enforced in ruby (at least prior to types).