跪拜 Guibai
← Back to the summary

Frontend Architecture Isn't About Code Sorting; It's About Lifecycle, Boundaries, and Organizational Reality

Postscript: Some Thoughts on Frontend Engineering Architecture Design

Author: verohh

Tags: 前端

Writing this far, this column has come to an end.

When I first planned this column, my understanding of frontend engineering architecture was actually relatively simple. Many of the projects I had worked on in the past did not have particularly well-designed foundational engineering. As projects ran longer and business features kept stacking up, the originally simple engineering structures gradually became complex. Problems such as code coupling, difficulty maintaining shared components, and messy dependency relationships began to appear.

This feeling became even stronger after participating in the maintenance and secondary development of some older projects that had been under construction for a long time.

Sometimes, a seemingly simple functional adjustment requires spending a lot of time first understanding historical code; modifying a shared component may affect multiple business pages; upgrading a third-party dependency may affect the compatibility of other components. Add to that restrictions from different project deployment environments, security policies of the client, and management of internal network dependencies. Many technical adjustments that seem simple in a normal development environment become complicated in actual projects.

These experiences gradually made me realize that frontend engineering architecture is not simply about categorizing code. It requires starting from the long-term construction and maintenance of the project, considering in advance the engineering structure, module boundaries, dependency relationships, and future changes that may occur.

1. Personal experience is limited, and architectural thinking has limitations

First, I must admit that many of the thoughts in this column have certain limitations.

From a personal experience perspective, I was mainly exposed to internet products in the early days, and later projects focused more on ERP, enterprise-level SaaS, and government/enterprise information systems. Compared to large internet platforms, ultra-high-concurrency systems, complex distributed architectures, and other technical fields such as blockchain and Web3.0, I do not have enough rich practical project experience.

Therefore, the architectural designs in this column are more based on the industry scenarios I am familiar with, actual project experiences, and problems encountered during daily R&D, organized and extended.

For example, in daily development, I have also considered issues such as request serialization, duplicate request interception, failure retries under network fluctuations, and the order of resource loading after bundling. Some of these problems have been solved in actual projects, while others remain more at the stage of designing and thinking about potential scenarios.

But I have gradually realized that different types of projects can have very different focuses in architectural design.

An enterprise-level SaaS system may pay more attention to business module division, customer differentiation, permission systems, and long-term maintenance; a large internet platform may face more complex problems such as high concurrency, distributed services, data consistency, and system disaster recovery.

Engineering practices in these different fields all have things worth learning and referencing.

So I do not think that what I have put together is a complete frontend architecture system. On the contrary, limited by the industries and project types I have been exposed to, many issues may not be comprehensively considered, and there may also be cognitive shortcomings.

I hope that through this column, I can share my thinking process and also hope to continuously enrich my technical perspective through exchanges with developers from different fields.

2. Frontend architecture design needs to consider the long-term lifecycle of the project

In my view, what really matters in frontend engineering architecture design is not making the project look standardized in the early stages, but ensuring that the project maintains good maintainability and extensibility after experiencing long-term business changes.

In the early stages of many projects, the business scale is not large, and the development cycle is tight. For rapid delivery, the focus is often on feature implementation, while engineering structure, shared modules, and dependency management are not fully planned.

In the early stages of a project, these problems may not noticeably affect development efficiency.

But as the project continues running for two or three years, business modules keep increasing, shared components are repeatedly modified, third-party dependencies undergo multiple upgrades, and developers may also change. Problems that were not fully considered early on will gradually surface.

Especially for enterprise-level SaaS and government/enterprise projects, they are often not one-time development and delivery, but require years of continuous construction, maintenance, and upgrades.

In such projects, early architectural design cannot only consider how current features are implemented. It also needs to appropriately consider:

These problems do not necessarily need to be fully realized in the early stages, but they should be considered as much as possible during the design phase.

Of course, architecture design is not about being as complex as possible. Over-engineering also increases development costs and maintenance burden. Projects of different scales, lifecycles, and business characteristics should adopt different design methods.

I prefer to think that the meaning of early architectural design is to leave room for the future.

We cannot accurately predict what changes will happen to a project in the future, but through reasonable engineering planning, we can give the project room to adjust and evolve when changes do occur.

3. Jump out of a single technical perspective and think about architecture from multiple dimensions

During the process of writing this column, another feeling became increasingly clear: in the past, when doing frontend development, we easily thought about problems from the technology itself.

When encountering component reuse, we consider component encapsulations; when encountering module coupling, we consider module splitting; when encountering performance issues, we consider caching, lazy loading, and rendering optimization.

These thoughts are not wrong themselves, but if we always stay limited to frontend technology, architectural thinking easily becomes a continuous accumulation of technical solutions.

In fact, a complete engineering architecture needs to consider far more than just the code.

Business requirements determine what capabilities the system needs, deployment environment determines whether a technical solution can actually be implemented, team size affects module division and collaboration methods, technical ecosystem affects subsequent maintenance and upgrade costs, and project lifecycle determines what kind of extensibility the architecture needs.

For example, the encapsulation of shared components: in ordinary internet products, you may only need to consider component reuse and unified maintenance; but in some government/enterprise projects, you also need to consider internal network dependencies, component localization, third-party code security review, and version compatibility across different projects.

If you only think from the perspective of technical implementation, you may ignore these issues that actually affect project landing.

Therefore, I believe architecture design needs to continuously broaden the dimensions of thinking.

Not only consider how to implement, but also why implement, whether it is necessary to implement, whether the actual environment allows implementation, who will maintain it later, and how to adjust when future changes occur.

Technical solutions themselves are neither absolutely good nor bad; they are only suitable for the current scenario.

Sometimes, a more advanced-looking architecture may not bring higher actual returns; while a relatively simple design with clear boundaries and controllable maintenance costs may be more suitable for the long-term development of a project.

Truly valuable architectural thinking is not about mastering how many technical solutions, but about being able to combine information from different dimensions and judge which solution is more suitable for current actual needs.

4. Organizational factors and architectural compromises in real projects

Besides technology and business, I think there is another very realistic factor that often affects the design and implementation of project architecture: the company's organizational structure, departmental collaboration methods, and project decision-making mechanisms.

Especially in some government/enterprise projects and customized projects, the company's project focus tends to lean more toward customer needs and project delivery rather than the long-term design of the product itself.

A customer raises a requirement, and the project department needs to satisfy it as much as possible; the business department, to push the project forward, may ask R&D to add some special features to the original system; and different departments may have their own business demands.

These needs may not all conform to the original product design philosophy, and they may not be suitable for the current engineering architecture.

But the reality is that R&D teams do not always have full product decision-making power and technical decision-making power.

Some requirements are known to increase system complexity, but because of customer relations, project delivery, commercial interests, or company management decisions, they still end up being implemented.

Over time, the originally unified business process may see more and more special branches, shared components may start to contain many judgments specific to certain customers, and the originally clear module boundaries may be constantly broken due to temporary needs.

This kind of problem cannot be simply attributed to insufficient R&D capability.

Because architectural design itself is constrained by organizational decisions and business goals. When R&D teams cannot participate in early requirement planning, or when management lacks sufficient technical decision-making power, relying solely on technical refactoring cannot solve all problems.

Facing unavoidable requirements, learn to compromise and isolate reasonably

I believe the ideal architectural design is, of course, to have all business follow unified design specifications, but real projects often make that difficult.

When unreasonable requirements cannot be refused, instead of forcibly integrating them into the original core architecture, consider how to isolate these special requirements.

For example:

I like to use a simple metaphor to understand this approach.

It's like adding a temporarily unmatched accessory to an already well-matched outfit. It may not look beautiful, and it may not conform to the original overall design, but since it is unavoidable in reality, at least it should be kept independent so that it can be removed at any time when needed, rather than redesigning the whole outfit because of this accessory.

Software architecture is similar.

Not all unreasonable requirements can be refused, but we should at least try to control their impact on the core architecture as much as possible.

Of course, isolation does not mean ignoring technical debt. For accepted special requirements, the maintenance cost, dependency relationships, and future exit methods still need to be clearly defined.

Architecture design also needs to consider the actual decision-making power of the R&D team

Another realistic issue: if the management of the R&D team itself does not have enough technical decision-making power, and cannot even participate in early requirement planning, then the role that architecture design can play is greatly limited.

Technical personnel can propose more reasonable solutions, can explain the maintenance costs that a requirement may bring, and can design module isolation and extension mechanisms in advance.

But whether to adopt them eventually does not always depend purely on the technology itself.

In this case, I think R&D personnel, in addition to striving for reasonable technical solutions as much as possible, also need to learn to define responsibility boundaries.

What belongs to the core design of the original product, what belongs to customer customization, what is temporary special logic added by the project, and what are technical compromises caused by external decisions: all should be made as clear as possible.

This helps with subsequent maintenance and also prevents special requirements from constantly invading the original architecture, eventually making the whole project lose controllability.

Architecture design does not require R&D personnel to insist on ideal solutions in all situations, but rather to hold the core boundaries as much as possible under realistic constraints, control technical debt, and leave room for future adjustment.

5. In the AI era, architectural thinking remains important

In the past two years, the development of AI programming tools has indeed brought great changes to the entire software R&D industry.

The efficiency of code generation, feature implementation, problem troubleshooting, and historical code refactoring continues to improve. Work that used to take a lot of time can now be done quickly with AI assistance.

But in actual use, I have gradually discovered that AI cannot automatically solve all engineering problems.

Especially for older projects that have been running for many years, complex business coupling, legacy logic, special deployment environments, and long-accumulated technical constraints cannot be solved simply by generating a piece of code.

AI can help us complete implementation, but which solution should be adopted, whether it conforms to the actual project situation, whether it affects other modules, and whether it is easy to maintain in the future, still require R&D personnel to judge themselves.

I believe the AI era does not mean that engineering architecture design has lost its meaning. On the contrary, when the threshold for code implementation keeps lowering, the ability to understand business, identify problems, weigh solutions, and control engineering quality may become even more important.

What we need are not only people who can use AI to quickly develop, but also R&D personnel who can understand the overall project structure, clarify technical boundaries, and take responsibility for final design decisions.

Final words

This column is more of a systematic reorganization of frontend engineering architecture design based on my own project experiences.

Some of it is experience verified in actual projects, and some is extended thinking based on existing knowledge. Limited by the industries and project types I have been exposed to, there are certainly places where my considerations are not comprehensive, and there are many things worth further study and practice.

I do not hope to provide a unified architecture suitable for all projects through this column, but rather to offer some directions for thinking.

For new projects under construction, you can consider engineering structure, module boundaries, and later extensibility in advance; for old projects that have been running for many years, you can also start with shared components, dependency management, and complex business logic, gradually combing through and managing them, rather than blindly pursuing a full rewrite.

For myself, this reorganization has also been a process of re-understanding frontend engineering architecture. From initially focusing on how code is organized and features are implemented, to gradually considering business changes, engineering governance, organizational collaboration, and long-term project maintenance, I hope my thinking can continue to broaden.

The development of technology will not stop, and industries and businesses will continue to change. What we can do is to keep learning based on existing experience, get in touch with technical practices in different fields, enrich our ways of thinking, and continuously verify and correct our judgments in real projects.

Architecture has no universal standard answer. More important than finding a so-called perfect architecture is to continuously broaden your horizons, understand problems from different dimensions, find a balance between technical ideals and realistic constraints, and ultimately design an engineering architecture that truly suits your own project, team, and business.

The above is just my own shallow thinking. I welcome friends from different fields with more project experience to exchange, supplement, and correct me.

Comments

Top 1 of 2 from juejin.cn, machine-translated. The original thread is authoritative.

组合搭配函数

I support grouping by business cohesion rather than by technical layer; code following the business is less likely to scatter. The point that over-engineering is also a burden is on the mark—over-abstracting feels just as bad as not abstracting at all.

verohh

Thanks for the recognition. If business requirements come from internal design, they are controllable; developers can align with the existing architecture to upgrade and optimize. Often, however, a large number of external requirements conflict with the original design. A purely code-centric mindset offers a good development experience for developers, but it often leads to designs driven by developer convenience that drift away from real business needs. Conversely, over-adapting to external requirements through compromise can cause the original architecture to lose control, hurting development efficiency. Good design usually finds a relatively balanced point between the two.