Since while horizontal split is functional and helpful, I didn't work in the companies which could benefit from it to full extent. And normally, it's e-commerce companies because they can render their micro-fountains on the back-ends. They can ship the resulting bundle as HTML. Since we are building our micro-fountains on the UI, we cannot afford ourselves to have 30 megabytes bundle size. It was important for us to be more reasonable about it.
In both FreshBooks and Persona, we opted to use vertical split micro-fountain architecture. Now, let's talk about challenges. First challenge is defining migration strategy. If you have a large product, you cannot suddenly decide that you have a new thing. You have to restart the previous thing and get three years of development efforts out of somewhere and build the thing. If you are reasonable about that, there is a pattern which is called Strongest Pattern, which basically suggests you to wrap the old thing into Facade framework and start growing the new thing next to it until you finally eliminate the old thing. Be realistic, invest in tooling because chances are that you're going to stuck in step 2 forever, so you need to be comfortable to be in this situation.
Another challenge is dividing domains. Domain-driven design isn't extremely simple topics. There are plenty of books about it. It's a challenge on the back-ends, it's also a challenge on the front-ends, and those challenges aren't necessarily answering the same question. It's okay if your front-end domains are going to be different from your back-end domains. If you opt into vertical split architecture, you're going to have pages which have multiple back-end domains displaying data. Nevertheless, you want it to keep as one single micro-fountain. So it's okay to have differences in domain boundaries. Very small domains might cause you building those multiple micro-fountains together just to test them, because one test is going to go through multiple micro-fountains to check the business flow, which is also not perfect, and large quantity of small domains might lead you to the same problem which we started with, with somebody fixing code which nobody exactly owns.
Third challenge is managing dependencies and pipelines. I hate it so much. It's really difficult, and we did it wrong, entirely wrong. So the intuitive approach to building things is like, okay, I have a shelf for this, I have a shelf for this, and we're going to separate things. Separate npm package for our components, design system, separate package for helpers, until you start putting it together and debugging, and until you want to debug your component inside the app, and then you have the process of, okay, I need to update the component. So you go to the component repository, you build, you change the components, you build the components, you deploy it to artifactory or npm, whatever you use. Then you update the package version in your application, and then you reinstall dependencies, and then you can see how did it work. And if you want to debug some simple CSS, it becomes quite painful. There fortunately are solutions, neither of which we found helpful enough for us and convenient enough for us to use.
Comments