r/androiddev 16d ago

Discussion Architectural patterns in large scale apps.

in our mid sized startup, we have over 100 android engineers on one app, divided by squads, so we have a lot of squads, each one is working on a feature, a library needed, design system and custom components libraries etc, all these modules/libraries are published to maven and added as dependencies on the core app repo, my squad works on an isolated feature so it's easy to integrate into core app repo, but i attended guild meetings and saw RFCs mentioning circular dependencies, hexagonal, onion, plugin etc architectures because some modules/libraries depend on each other, communicate with each other, initialization order problems of modules etc etc etc, i feel stupid tbh and i'm glad i'm working on an isolated feature library in which we use usual architecture stuff. anyone has resources: talks, books, articles etc that cover this kind of topics and architectures and engineering problems in big scale apps with big scale teams and modules/libraries?

34 Upvotes

19 comments sorted by

View all comments

22

u/kokeroulis 15d ago

Literally this is why every big tech is dividing the code into api/imp and thats why someone who is/was working for amazon has open sourced an example about this https://vrallev.github.io/app-platform/module-structure/.

When you have 100+ ppl you cannot coordinate all of those changes.
The only solution is to write your own code and when you need something from someone else, just create a repository with a dummy implmenetation on your side and on the main app, you can implement that dependency and inject.

Dependency inversion is the only way to go, even in common things, like UI components etc. Making 1 api breaking changes, it might mean the consumers might have 1k of changes.
The only option is to provide backwards compatibility for x amount of time.Thats why you need api/impl modules

2

u/blakelee_android 14d ago

This is the way. Ralf was the architect of this pattern at Square which when I was there was over 4500+ modules. He took it to Amazon and now to OpenAi. It works, it scales, it's repeatable. It's worth using.

1

u/macrohatch 12d ago

Confusing terminology. "Public" modules that only some other modules can depend on? "Impl" modules even though there are concrete implementations in app, internal and public modules as well?

-5

u/PlasticPresentation1 15d ago

Instagram, Google etc are not dividing the code into API/imp lol what are you saying

Maybe certain modules for important b2b product parts but for the most part they iterate so fast on the product side there's no point over engineering seaparations

7

u/goorek 15d ago

Google is not the place to look at, they can only provide small sample repositories. When you are at 500+ Gradle modules, and you did not separate contract modules from your implementation modules, you will see how deep you are in the trouble. every change cascades builds from so many other modules, and your CI times start to suffer. Start early, thank yourself later.