We’ve all been there. Adding yet another call to your backend-for-frontend system. Trying to figure out how to get the response from one API to another without making your business logic a 2000 line file. You’ve tried the traditional DAG frameworks. Maybe you’ve even tried a workflow engine. They’re all bulky, complicated, and not really fit for what you’re trying to do.
BFF APIs are all the rage these days. But it’s so difficult to stop them from turning your codebase into a mess of conditional logic and data being passed all over the place. Mosaic is a new framework for Kotlin designed exclusively to handle the business logic of your big, complicated orchestration APIs. It enables you to break down your logic into simple, composable, individually testable, and fully decoupled chunks.
Think of Mosaic like React for the backend. Decide what you want your response to look like and then build increasingly specific components up to your data sources. Mosaic allows you to write simple “tiles” in natural kotlin which will be run in parallel, prevent call duplication, and bring their own dependencies by relying on eachother. It’s a request tree that is dynamically assembled for every request without you needing to think about it.
Mosaic doesn’t replace your favorite web framework. It works with Ktor, Micronaut, Spring, anything. It is a lightweight complement to these tools to make your business logic clean and understandable.
Spend less time thinking about how to write your code and more time actually implementing the features. Let Mosaic handle the messy orchestration part.
Check out our examples or our quick start guide and enjoy a cleaner and more maintainable codebase today.
Top comments (0)