
============ 正文分隔线 ============
Software development is like building houses and bridges, which can be the towering palaces in the north, the elegant courtyards in the south, and even the precipitous and isolated bridges beyond mountains. Then, different languages and frameworks attract a group of fans by their inherent qualities. They work tirelessly to create different ecosystems and present different development styles and experiences. Just as Rails to Ruby, Lavaral to PHP, Django to Python, and Spring Boot to Java. So, what will be to Javascript? There is no doubt that Javascript faces more usage scenarios, such as front-end, back-end, mobile, IOT, etc. Different scenarios have excellent solutions. Moreover, based on different usage habits, the Javascript ecosystem is split into two style systems, which are Javascript and Typescript. So, based on business development, in terms of the current node ecology, we can say that Nest to Typescript, and Cabloy to Javascript
Because different languages and frameworks will have different solutions and styles. Therefore, whether you use CabloyJS or not, it is necessary to come in and see what kind of flowers can grow on the soil of sticking to the pure Javascript (Vanilla JS). Therefore, whether you are a fan of front-end development, back-end development, full stack development, or other languages, or a technical manager, product manager, or project manager, you can learn different ideas and methods for solving problems from the documents and videos provided by CabloyJS, communicate with each other, learn from each other, and make progress together!
| Language | Framework |
|---|---|
| Ruby | Rails |
| PHP | Lavaral |
| Python | Django |
| Java | Spring Boot |
| Typescript | Nest |
| Javascript | Cabloy |
CabloyJS is a NodeJS full-stack framework with workflow engine, a low-code development platform for developers, is also a PAAS platform with both out-of-the-box and flexible-customization. Only one set of codes is needed to realize the admin management system at backend and the applications at frontend at the same time. Only one set of codes is needed to adapt to PC and mobile at the same time, and the mobile is close to the native experience
brief-but-not-simpleout-of-the-box + flexible-customizationMany friends feedback that they are unfamiliar with the concepts of CabloyJS, so they don’t know where to start?
Different languages and architecture concepts determine the style of a framework. In order to create a truly easy-to-use full stack business framework, CabloyJS abstracts and refines the concepts behind the real business requirements, which not only achieves the effect of out-of-the-box, but also can be customized flexibly
Therefore, this also determines that the overall style of CabloyJS framework is: brief-but-not-simple. When you are familiar with this style, you will find that the really comfortable development experience should be like this
If you want to implement the CRUD features, the codes can be designed very simply, and you can even know how to use it without referencing the documents
We can recall that most of the other backend MVC frameworks or backend API frameworks provide the
CRUDfeatures, while often stop there steps here?
Then, let’s introduce some real business requirements:
Add a draft copy of the data. When we modify the draft, the original data that has been formally submitted will not be affected
Add some history copies of the data, so as to record the historical version of the data
Add a approval workflow. Business data will be approved after the draft is submitted, and will be transferred to the formal copy only after it is approved
Add cms static rendering mechanism: as CRUD are generally managed in the backend, we need to output the data statically for the frontend system to access, and realize the SEO optimization of the website
Add category and tag features to facilitate further classification of data
For these characteristics mentioned above:
How to refine general concepts
How to design the development interface (to achieve the effect of out-of-the-box and flexible-customization)
How to configure flexibly (enable or disable some features conveniently). As the saying goes: it is easy to reduce dimensions, but difficult to increase dimensions. We need to have these features first, and then decide whether to enable them according to business requirements
How to adapt more business scenarios (rather than only applicable to a certain type of business data), such as blog posts, community posts, leave forms, reimbursement forms, purchase orders, contracts, projects, assets, financial documents, etc.
It is doomed that the concept of business data is not simple, but CabloyJS has implemented a brief development interface, which can be used out-of-the-box and flexible-customization
See Also:Bilibili Video:新建业务表单+审批工作流 (Translation Wanted)
Question: With the popularization and upgrading of mobile devices, a large number of business scenarios need mobile support. Then, how can the admin management system support the mobile devices more elegantly?
Traditional solution: At present, most of the admin management frameworks on the market are compatible with PC and Mobile by using CSS media query
Disadvantages of the traditional solution: However, the UI interaction experiences of PC and Mobile are different, and the page layouts are different either. Therefore, only relying on CSS media query can only make PC pages available on the Mobile, but it is far from achieving the effect of the native MobileNew solution: CabloyJS provides a unique adaptive layout of pc=mobile+pad, so that only one set of codes is needed to adapt to PC and mobile at the same time, and the mobile is close to the native interactive experience
Advantages of the new solution: This solution also implements the design principle of out-of-the-box + flexible-customization, with the style of brief-but-not-simple. All you need to do is to understand this mechanism by referencing documents or watching videos. The codes required for actual frontend page development will be much less than CSS media querySee Also:Bilibili Video: 独树一帜的跨端方案:pc=mobile+pad 自适应布局 (Translation Wanted)
It is recommended that you read the following documents to have a preliminary understanding of the basic concepts of CabloyJS
CabloyJS is based on EggJS, VueJS and Framework7. These underlying framework documents do not have to be read first. CabloyJS provides enough samples and test codes to facilitate rapid development. It is recommended to run CabloyJS project first, and then gradually introduce relevant knowledge as needed
Of course, if you have the knowledges of EggJS and Framework7 in advance, it is easier to understand what innovations and transformations CabloyJS has made on the basis of these two
CabloyJS has many built-in core modules, which encapsulates and implements most of the functions and features commonly used in specific businesses. Therefore, it is recommended that you first create a project, run it, and preview the functions and features provided by CabloyJS. In this way, when you develop your own system, you will know how to refer to the existing paradigm to get twice the result with half the effort
CabloyJS offers some free video courses. This set of courses is taught by the author of CabloyJS, zhennann. Through on-site coding and actual combat, it takes you into the real scene of NodeJS full stack development, so that you can quickly improve development skills and quickly start the development of various business systems after learning
See Also: A-001: CabloyJS 全栈框架:从入门到精通 (Translation Wanted)
See Also: A-002: CabloyJS 全栈框架:功能特性演示 (Translation Wanted)
See Also: B-001: 微信一起点菜项目进度复盘 (Translation Wanted)
On the basis of CabloyJS framework, it is very fast and convenient to redevelop specific business modules. From the following tutorials section, you can see what steps are needed to develop a business module
By reading the EggBornJS section, you can understand what features EggBornJS has extended on the basis of EggJS in order to achieve business modularity
By reading the CabloyJS section, you can understand what core modules CabloyJS provides to improve the efficiency and convenience of business development
NodeJS workflow engine is the core component of a business development platform. By reading this chapter, you can understand how CabloyJS’s own workflow engine supports the development of business systems in a simple, flexible and efficient way
Based on CabloyJS, corresponding solutions are implemented for different business scenarios, including:
Cabloy-Wechat (Translation Wanted)
Cabloy-Wechat Work (Translation Wanted)
Cabloy-Dingtalk (Translation Wanted)
Cabloy-Uniapp (Translation Wanted)
test-party : is the test suite of CabloyJS, including a large number of test cases and Kitchen-sink
test-flow: is the test module of NodeJS workflow engine, containing a large number of workflow related test cases
test-note: is used to demonstrate how to use the Markdown rich text editor
These test modules/suites not only facilitate the quick learning of knowledge points in all aspects of CabloyJS, but also provide a large number of code examples to facilitate the rapid start of actual project development. It is strongly recommended that you pay attention to and keep these test modules/suites updated, so as to always obtain the latest sample codes in time
How to install test modules/suites, see also: Cabloy Store Cli
How to disable test modules/suites, see also: Disable Module/Suite
How to update test modules/suites, see also: Update Cabloy
By reading the source codes of the core modules provided by CabloyJS, you will find that the CabloyJS framework is flexible enough to allow you to deeply customize, replace, and extend the numerous functions and features provided by CabloyJS
Welcome to participate in and contribute to the improvement of the CabloyJS full stack framework, which is also an effective way to quickly and deeply learn CabloyJS
]]>V5 演示 https://nutzwk.wizzer.cn
V7 演示 https://demo.budwk.com
V7 是基于 nutzboot 类似 SpringCloud 的 API 网关+微服务分布式+前后端分离的开发框架。
V5 是基于 nutzboot 的单应用的微服务开发框架。
两者的特点是,V7 更适合企业团队、大型一体化项目开发,V5 更适合个人或者项目快速开发。
V5 捐赠者不少,V7 几乎没有~个人觉得 V7 比 V5 设计更完美,修复和提升了不少功能,可是一、宣传不到位,太小众,二、类似功能的基础框架遍地都是,,我这个框架维护快十年了,star 还不及新手写的……惭愧
]]>p.s.
其实,支付宝,也是类似的。
p.s.
我不知道直接开发一个微信的小程序能不能达到目的,还没有试过。
不知道对错,只是想梳理下想法,有错误请指正
微服务已经是一个不再新鲜的概念,但我却依然模糊不清。
微服务,抛开 微 不看,首先是一个面向服务的架构,即 SOA 。系统模块,业务逻辑之间的界限是服务,服务为 服务名+方法名,与 CRUD/REST 不同。服务重在交互,CRUD/REST 重在数据。
SOA 曾经有 SOAP 、Java RMI,现在主流的 gRPC 和常见的 JsonRPC 。这些定义的都是服务交互协议,而微服务更多的关注服务的组合、分布、编排、容错、发现、通信、跟踪等。因此会想到这样的一些主题:
服务之间的通信可类比为网络通信,主要分为点对点,广播和网关:
从服务提供方来说服务的通信也可以区分为主动和被动:
HTTP
目前 HTTP 在快速发展,新的协议提高的主要是性能和对长链接流的支持,如果选择简单实现服务调用,HTTP 请求足以。
使用 HTTP POST 实现 单次请求响应,使用 WebSocket 实现流式请求。使用 HTTP 的好处是能利用现有的基础设施,HTTP 是目前支持最为广泛的协议,也是最受关注的协议。
但选择 HTTP 时,如果自行实现,则最好选择 HTTP 1,避免使用 HTTP 2 等新增特性,HTTP 2+ 能传递 HTTP 1 的所有语义,且性能各方面能得到很好的提升,这样足以。如果要独立使用 HTTP 协议新特性,例如 Trailer,则实现会变得过于复杂。
非 HTTP 语义
当使用非 HTTP 语义语义时,可能是基于 TCP,也可能是对 Payload 进行定义,抽象传输层,但如今想要跨语言,使用非 HTTP 协议阻碍会非常大,因此宁愿选择对 Payload 做自定义也不会选择不使用 HTTP 。
通常点对点是需要直接通信,但现今有提供 Mesh 网络的网关组件,使得原本不互通的网络服务能够互相访问。同时也能实现对应的服务之间的权限管理和监控。
使用 Mesh 网关则可以让客户端的网络层实现更为简单,由网关去维护服务网络的稳定性,对服务网络的变化也能更快的反应。但成本是维护额外的基础设施组件,且注册中心与网关有强关联和交互,每个节点运行一个网关也是额外的资源消耗。
服务总线本来是一种设计模式,比较常见的是基于事件驱动的设计,但在服务场景会有所不同。事件驱动一般有固定的 主题 /Topic,在定义之初已经确定了部分语义。而服务总线则可以理解为只有一个 Topic,通过消息的内容来进行过滤谁处理谁不需要处理。
总线的通信模式解决了服务之间网络隔离的阻碍,不再需要 A 服务 与 B 服务 网络互通,网络的变化也不会阻碍服务的通信。但如果总线本身如果不支持一些 meta 信息的模式匹配,则会导致流量过大,处理能力受限。
选择广播通信,则必然会选择某种形式的 消息队列 /MQ 实现,因此会牵扯到其他的基础设施服务,从部署跟踪上来说,这是扣分的。
网关通信与 Mesh 网关不同,Mesh 的目的在于打通节点,网关的目的在于磨平 /适配不同的环境服务,提供相同的能力。
所有的请求通过网关,由网关进行路由,这是典型的 Nginx 反向代理场景。因为所有请求都加了中间层,因此很多事情都可以在中间层完成:
该模式与实际最底层的服务通信有有一点区别,主要作为适配和耦合存在,如果网关功能越多做的事情越多也越容易造成单点瓶颈。
通信是服务的根本,对于微服务更是如此。通信的模式间接或直接的影响其他组件的选择和设计。但不同的通信模式并不是互斥的,在对于的场景选择对于的方式才是最好的选择。
15s * 3 = 45s - 不进行主动干预的情况服务发现通常只是一种行为,但实际使用的应该是服务注册中心,主要能力包括:
服务注册中心通常不是,而是一个集群,其中的服务元信息也可被同步到 RDBMS 便于开发人员查看和使用,场景例如:
服务容错包含服务异常、节点异常、网络异常,不同的异常可能采取不同的应对方式,我理解的常见功能包括
容错的实现通常配合监控,网关,注册中心。算是优化服务体验的一部分,可以作为延伸支持考虑。
微服务,微的是除了服务之外的部分,也就是上述的所有内容。微服务的期望是让开发只关心业务逻辑的编写,开发好的业务逻辑能够快速稳定的上线被使用。
如果不在一套完善的体系下谈论开发微服务都是没有意义且难以实现的,而这套体系的搭建不背靠现在的 K8S 之类的体系也是难以成形的。
将最近混乱思绪进行梳理,不一定都是正确,仅作为参考便于理解,引导之后的选择和决定。