In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Open source for front-end and Node.js development, Github: https://github.com/midwayjs/midway, click the direct jump point Star.
Last year, Ali proposed the Serverless architecture and made use of its new generation of R & D architecture, which reduced a large number of R & D personnel 'attention to infrastructure and operation and maintenance. For front-end developers, they only need to write a few functions to implement the back-end business logic, promote the rapid launch of the business, and improve the R & D performance of the entire front-end by 50%.
In the past six months, Midway FaaS has received the attention of many students, and many large enterprises have started to use it directly. Thank you here. Today, Midway FaaS will evolve into Midway Serverless and officially become the core scenario of the Midway system, with the official release of v1.0.
Version v1.0 represents an official version that can be safely used. Through the whole new Midway Serverless system, we will gradually open Ali's Serverless capabilities, and the front end will enter a new era. As I said two years ago, open source is just the beginning, but the end is far from coming.
Today's Serverless is the golden era for cloud manufacturers to expand their own territory, and it is also the best time for you to try. Now Node.js has become the best choice at this time, and the Midway system should also stand at this crossroads to lead the way.
What is Midway Serverless?
As mentioned earlier, Midway Serverless is a set of Serverless-oriented solutions, which includes framework, runtime, tool chain, and configuration specification parts, and the combination of these parts provides some unique capabilities for Serverless architecture:
1. It is easier to migrate between platforms by providing a unified configuration specification and entry smoothing mechanism to make the code basically the same on each platform. Extending the runtime API of different cloud platforms can not only load common inter-platform extensions, but also connect to the privatized deployment solutions within the company. two。 It makes the application easier to maintain and expand, provides standard cloud platform function access parameter event definition, provides multiple integrated development solutions with community front-end React, Vue, etc., uses TypeScript as the basic language to facilitate application expansion and definition, and provides a complete Midway system iconic dependency injection solution. 3. The ecological lightweight and free function system reuses the ecological and Web middleware capabilities of koa, which is more handy when dealing with traditional Web; the ecological chain of egg components reuse egg plug-ins is provided, and the enterprise development link is simpler and smoother; the decorator capability of Midway system is unified, which makes the migration of traditional Web to Serverless system faster and better.
All the capabilities mentioned above are open source in the Midway Serverless repository. You are welcome to click on the link to jump directly to Star. Github: https://github.com/midwayjs/midway
Serverless and FaaS
FaaS is one of the forms of Serverless architecture, and it is also the scenario that Midway hopes to solve this time. Before v1.0, we invested a lot in FaaS, but in fact, Serverless architecture is very large, and FaaS is only a small part of it. Based on the event-driven model, it evolved from MicroService, a small functional block focused on a single responsibility and function. Today, this more "code fragmentation" software architecture paradigm, smaller program units than micro-services, provides unparalleled flexibility to business code.
Today, according to Forbes magazine, typical servers in business and enterprise data centers provide only 5% to 15% of the average maximum processing power output, which is undoubtedly a huge waste of resources. With the emergence of Serverless architecture, let service providers provide our computing power to meet real-time needs to the maximum extent, which will enable us to use computing resources more efficiently.
Elastic container can meet all the current aspirations for the utilization of resources, and it is also one of the goals pursued by the cloud platform. For developers, whether it is an elastic container or an elastic function, as long as there is a set of code that can run in it, you can meet the needs of the business. As a result, the goal of Midway Serverless has expanded from the original FaaS scene to other areas, whether it is a function or a new architecture, we will meet one by one, and landing business, back-feeding the community.
Anti-platform locking
Vendor Lock-in is a question that everyone who uses the cloud platform will torture the soul. The original intention of Midway Serverless is to allow a set of code to run on different platforms and runtimes. We do not recommend customizing the runtime without knowing the whole picture, which is very dangerous. In fact, the official runtime is the most stable and must have the best performance, based on which all benchmark runs are based.
The first question that most of the enterprises we know are facing Serverless is whether my code must be tied to Ali Cloud, Tencent Cloud, aws and so on.
Faced with this problem, Midway Serverless provides a set of "hidden" portals plus generalized definitions to solve this problem.
For each platform, Midway Serverless provides different runtime initiators to smooth out the differences between different platforms, and regularizes the input and exit parameters of each platform, as well as the return format of each event structure and gateway, so that users are not aware of the differences between underlying containers and protocols as much as possible.
In addition, Midway Serverless provides a set of Spec definitions to smooth out the differences between multiple platforms, while easily reusing the same tool chain and function logic among multiple platforms.
In this way, both API Gateway and ordinary HTTP triggers can provide API in a unified programming plane, making it easy to write code.
TS and decorator
The writing of the function is very flexible, which not only brings convenience, but also brings maintenance costs. As a result, TS is introduced into the function, and the standard and expansibility are introduced.
The following code, which seems to be the standard syntax of koa, is actually the API for HTTP triggers in the function. In order to be consistent with the Web stack syntax, through some changes, the acquisition of parameters and calls can be connected seamlessly as much as possible, and the cost of learning is reduced, and the original code can be migrated better.
On the other hand, the method of decorating through the decorator will become a function entry, making the structure of the entire function free. Through the way of building, the real entry is hidden, which not only allows the function to be called across multiple platforms, but also adapts to different routes. As in the example above, there are multiple entries in a file and you can share the same code, but in fact each function call is independent, providing convenience in management and post-maintenance.
The actual structure of different cloud platforms is different. If users need to use traditional event and context structures, we also provide different definitions for different platform triggers to facilitate coding, as shown below.
Reuse community ecology
As mentioned above, the original purpose of the design of the Midway Serverless system is to reuse the existing koa ecology and turn the underlying event rules of multiple platforms into a unified class koa API. The similar purpose of API is for the whole web ecology of koa, and we also hope that the whole middleware ecology of koa can be reused. As shown in the following figure, @ koa/cors is introduced.
On the other hand, Midway, due to its excellent IoC component capabilities, provides the upper egg infrastructure, while reusing existing egg plug-ins, so that the capabilities of traditional enterprise development can be continued. For example, the following figure is an example of using egg-mysql plug-ins.
Front-end enabling
Cloud + end development experience is one of the goals of Midway Serverless, traditional application development, front-end and back-end separation, multi-warehouse development, deployment separation. Even if you use the glue layer of Node.js, you can't avoid the physical fragmentation of personnel developers. Under the Serverless system, this is not a problem.
Due to the significant simplification of the back end, coupled with the BaaS of cloud services, data aggregation and page rendering become easier and faster for the front end to get started and develop.
Integration has gradually become the front-end demand of this piece, the so-called integration is not only the integration of traditional warehouses, but also the evolution of the entire development model, from the engineering system plus code, the opportunity to reshape the whole system of CI/CD.
Today's Midway Serverless provides an integrated development solution with the front end, including the existing React, Vue and other ecology of the community, as well as customized solutions for the entire tool chain (Webpack,ice scrips,umi, etc.), and provides out-of-the-box solutions for different scenarios, such as blogs.
As for the detailed front-end integration capabilities, we will open a separate article to introduce the details and thinking of front-end integration.
Application and function
Serverless is the direction of the future period of time, but also the front-end to a higher level of paving block.
I have been thinking about the relationship between the final state of functional development and applications.
At this stage, our answer is to be unified. after being questioned by countless souls and user requirements, we have come to the answer that the function is the smallest embodiment of the application in the current business, and more simply, it is part of the code that runs the application in the minimum specification container.
For a period of time after that, we will focus on the access of more platforms and the migration of traditional applications, so that previous users can also enjoy the flexible dividend of Serverless, making it cheaper for enterprises and easier for business to launch.
Last
Under the background of the deepening of the group's large, medium-sized and small front-end business architecture, and with the development of the group's cloud native Serverless, Node.js saw the future in the business end-to-end delivery scenario last year.
The foreground business delivery model of the new generation of cloud + end has gradually become a reality, which can help the technical team create a special force with the overall business delivery capability and help the business win quickly. However, there is still a long way to go and there are still many imperfections. In order to achieve this step as soon as possible, we need to focus on two core issues: scale cost and delivery speed.
It is expected that in the future, through our continuous investment in large-scale cost and delivery speed, Node.js/Serverless system can reflect the overall advanced nature. If you have any questions, welcome to join the nail communication group: https://qr.dingtalk.com/action/joingroup?code=v1,k1,Lr3HsEsA55Pk8NPqlkhxajuhpcBUpGWa3bRHcW7wwTw=&_dt_no_comment=1&origin=11
Midway Serverless,Go!
Experience courtesy: use Serverless as quickly as possible in 5 minutes
"Serverless" has been very popular in recent years. Everyone is keen to discuss the significance of its appearance, but little is said about how to use it or land in the production environment. We designed the experience scene, hand-in-hand with you for 5 minutes to start Serverless, but also sent 2000 Ali Yun "first line code" gilded limited edition mugs!
Click to view details: https://developer.aliyun.com/adc/series/fc/
"Alibaba Cloud Native focus on micro services, Serverless, containers, Service Mesh and other technology areas, focus on cloud native popular technology trends, cloud native large-scale landing practice, to be the official account of cloud native developers."
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.