Answer the question
In order to leave comments, you need to log in
How to design a large vue application?
I would like to get an answer from the developers who made large enterprise applications on vue.
Today there was a discussion about what needs to be designed in the spirit of "microservices", where each individual product module is a separate vue application, but connected into one interface using nginx proxying. Roughly speaking, we have a bunch of sites in one site.
That is, each module has its own vuex, router, dependencies, and so on. But, according to colleagues, if new frameworks are released, we will painlessly rewrite one module after another, if necessary. Is this really so, and are the expenditures of resources justified for this?
I opposed this approach. It seems heavy, complicated, and no one seems to do that. I personally have not seen this practice. SPA framework for that and SPA.
Actually, I stand for the "classic" spa - yes, at the output we will get a huge bundle of all modules, where each specific user needs only a small part of it (for example, different modules for different departments, where everyone uses their own functionality, and he does not does not overlap). This is the main counter-argument of my approach - that it is likely that certain code can fall into unwanted hands and in general.
I would like to discuss this case, and how best to approach the design of the application.
For greater clarity, as an example, you can disassemble the CRM application, where one needs only a report upload page, and the second, say, sales analytics.
Answer the question
In order to leave comments, you need to log in
We did large projects with vue, but it was not a full-fledged spa and not a microservice architecture. We just had multiple entries that we used for different sections.
My opinion, if none of you have dealt with microservices before, then don’t take it on the go. Threaten a lot of time just for one frame and not the fact that everything will work well in terms of reliability and safety.
I would start with a monolith, but with the expectation that later it could be broken into parts at minimal cost. Firstly, get the first version faster, secondly, over time, the boundaries of the modules will be more visible, it will be easier to understand what exactly can or should be allocated to the microservice, you will see with your own eyes what and what it communicates with. In order to correctly define these boundaries during the first design, you need to have some experience with microservices. I understand that you do not have it or it is minimal.
In my opinion, the most important plus of microservices is that the cost of an error in an architecture decision (microservice) is reduced, because it is easier to rewrite it than to edit and refactor. Well, it’s also good that you can update in parts, not to rebuild everything at once with each calculation. In a monolith, the further, the more difficult it is to change something globally and it is very important not to make a mistake at the initial stage.
Painlessly rewriting the module to vue is no problem in any case. Only if you don’t decide to switch to Angular, then I doubt that it can be used pointwise in the project. We once had a big legacy project, a monolith that was on jq, we first decided to add knockout, we didn’t like it, then continued on vue.
It would be nice to know what kind of project you have and what tasks it solves.
at the output we will get a huge bundle of all modules- why is that so?
That is, each module has its own vuex, router- Well, who's stopping you from splitting the storage and the router into files?
I wrote this way and that. There are always problems, different of course. IMHO, microservices are a little easier, because isolation of modules and their interaction must be thought through. And so, large means it’s hard to maintain in any way, due to the large flow of requirements. I would start with a monolith, and if a convenient module comes up, I would take it out into a separate service.
Colleagues do not understand that rewriting simply will not work. You will have to do a ui kit and a binding for working with api at least for each framework from scratch, but this is usually the most labor-intensive, and the rest is in most cases a stupidly routine modeling of a system from these bricks. They just think that a different framework is like a different orm and a router, and the rest is plus or minus the same, and they say all that needs to be done is to replace the calls in the repository.
Microservices at the front do not work well in a complex system, problems of transparent gluing during the transition, problems of including pieces of another service (analysts and users do not care that this is a different system). Specifically, vue with a monolith has another problem, when it becomes really large, then problems with hot-reload and assembly begin, all this starts to take a hefty amount of time, there are no noticeable performance drops in runtime.
From my own experience, I can say that you need to start with a monolith, when it is clear what the system is like, then you can start to take out ui-kit / abstractions for working with api, etc. things. The problem of including the left code is solved with the help of ordinary Git submodules. That is, for customer 1, repo with 1/2 submodules, for customer 2, repo with 1/3 submodules, that is, there is a split only at the git level, but in fact it is a monolith. Yes, there is a lot of hemorrhoids, but it will work. If the assembled files are supplied, then everything is even simpler, you can replace the router and store file during the assembly, and only what is required will get into the final assembly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question