FeatureA FeatureB FeatureC FeatureD FeatureZ … Networking DesignSystem Analytics Database Architecture etc… Entity Monolithic Application All features are concentrated in one or a few modules.
Barriers to evolutionary potential: Monolithic Application The introduction of new technology affects the entire app and is pretty costly. And also, it does not have the ability to evolve progressively.
Concepts Create one module for just one functionality. Larger functionalities consist of a composition of these smaller modules. • Fine-grained shared functionality modules
Application Feature Feature Feature Feature Feature Common Common Common Common Modularization Group The modules in this group contain an App Delegate, and that's it. It might also contain DI to feature modules. Applications
Application Feature Feature Feature Feature Feature Common Common Common Common Modularization Group Features Each vertical feature module is independent and can only depend on modules in the Domain and Libraries groups.
Application Feature Feature Feature Feature Feature Common Common Common Common Modularization Group Domain (Library) Contains modules of functionality shared by several feature modules. It also allows modules to have service-specific information.
Application Feature Feature Feature Feature Feature Common Common Common Common Modularization Group Libraries Contains modules of generalized functionality. It cannot have service-specific information.
Bazel • Fast + Reliable + Scalable + Extensible • Multiple language support • Starlark language for build scripts • Remote Caching • Open Source https://github.com/bazelbuild/bazel
Example of Benefits My product completes clean build, unit test, and land to testers in around 1m 30s in the shortest. But it's still too early stage for a sample.
Tokopedia Example of Benefits https://medium.com/tokopedia-engineering/how-tokopedia-achieved-1000-faster-ios-build-time-7664b2d8ae5 Local Clean Build: 56m 31s -> 4m 56s, 91% improved
Build Scripts WORKSPACE Defines external dependencies. BUILD Contains build scripts for 1~N modules. .bazelrc Configuration file for project-specific options. xxx.bzl Defines utility extension for build scripts which will be loaded from the BUILD.
Test How to build load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test") swift_library( name = "TestLib", srcs = glob(["Tests/**/*.swift"]), ) ios_unit_test( name = "Test", deps = [":TestLib"], ) BUILD
index-import by Lyft https://github.com/lyft/index-import Bazel + Xcode Replaces the paths in the index file created by Bazel so that it can be used for Xcode.
Dependency Diagrams Bazel can track all dependency graphs and parse them with the bazel query command. It can be output as a graphical diagram with Graphviz.
• Micro Modular Architecture maximizes the synergy with Bazel, and vice versa. Conclusion • Build speed has room for improvement in software architecture as well as hardware performance. • Bazel will dramatically improve our developer experience.