Serverless Frist's progressive application development framework Malagu

What is Malagu

Malagu  is a Serverless First, componentized progressive application development framework based on TypeScript. Use the same programming language and IoC design to develop front-end, back-end, and front-end integrated applications. And it combines OOP (Object Oriented Programming), AOP (Aspect Oriented Programming) and other elements, drawing on many Spring Boot design ideas.

At the back end, Malagu abstracts a set of interfaces to facilitate adaptation to any platform and basic framework. It is an upper-layer framework that is independent of platform or basic framework. Platforms such as Alibaba Cloud Function Computing, Tencent Cloud Cloud Functions, Vercel, etc., and basic frameworks such as Express, Koa, Fastify, etc.

In the serverless scenario, Malagu develops projects based on applications, and an application generally contains multiple API interfaces. If our application is large, we should disassemble the large application into small micro applications or micro services. Just like the principle of granular splitting in the microservice architecture, reasonable granular splitting has many benefits for our application management. The framework guarantees the running performance of an application in a function. To

Why do you need Malagu

Believe that serverless is the future

Serverless is a new generation of cloud computing computing engine, born to replace the traditional cloud server architecture. The core idea of ​​Serverless is to allow developers to focus on business code without worrying about the existence of servers.

What is the status of Serverless

Now, all cloud vendors and communities are vigorously promoting and evangelizing the concept of serverless. Through serverless, commercial solutions can be quickly implemented at low cost and with high quality. At present, everyone generally believes that Serverless = FaaS + BaaS, and there may be other forms in the future. No matter how the form changes, the core theory of Serverless remains unchanged. The key to all serverless development experience lies in the FaaS development experience. The current development experience of FaaS is not ideal, and there are many pain points. It is difficult to solve at the bottom of FaaS in a short time, such as cold start, database access, local development, debugging and running, Platform has nothing to do and so on. To

How to solve these pain points

We can change our thinking and try to solve these problems from the development framework level (it turns out that these problems can be solved through the development framework). So, we are faced with a new choice whether to adopt the traditional framework or to need a new framework? If we choose to make a new framework, should we choose a specific programming language or a general programming language?

Why a brand new framework is needed

In terms of the development experience of the traditional framework, everyone is sure to accept it, after all, it has been used for so many years. However, when applications developed by traditional frameworks are migrated to a serverless environment, they often encounter various difficult problems, which are often closely related to the underlying design of the framework. Although we can solve or alleviate some problems by extending the framework's capabilities, the result of practice is that the threshold for framework transformation is very high, the effect is not ideal, the need for hacking is not elegant. When you use a traditional framework in Serverless, you often feel that although the application can run, you will have concerns when it is actually applied to the production level. All we need a new, Serverless Fisrt development framework. Only in this way can the advantages of Serverless be maximized and the Serverless development experience surpasses the traditional development experience.

Why choose a specific programming language

Currently, there are many language-independent serverless tools or frameworks in the open source community, such as Funcraft, Serverless Framework, Vercel, and so on. This kind of general language serverless tools can indeed achieve a good experience at the operation and maintenance level, and can also form a common standard. However, the development experience of application code development, debugging, and operation is not so ideal. Each programming language has its own unique aspects in terms of development, debugging, and operation. Common language serverless tools are difficult to be unified, and the development experience can be very good. Only by choosing a specific programming language can the experience of development, debugging and operation reach the extreme.

Why choose Typescript

Serverless makes the threshold for back-end development extremely low, and the cost of learning for front-end developers to develop back-end applications based on Serverless is also extremely low. In the future, more and more front-end developers will become full-stack developers. Typescript can develop both the front-end and the back-end, which is very friendly for front-end or full-stack developers. To

The front-end architecture is actually a serverless-like architecture. For example, the front-end browser needs to load the front-end code to execute, and the serverless scene also needs to load the user's code to execute. Therefore, many front-end solutions are naturally suitable for serverless scenarios. For example, the front-end uses packaging, compression, and Tree Shaking to reduce code size, and reduce code deployment and cold start time. Similarly, this optimization solution is also applicable to Serverless scenarios, so choosing Typescript is equivalent to directly having a ready-made solution polished by countless real scenarios.

In addition, Typescript and Java are very close, and Java developers can easily switch to the Typescript technology stack.

The value of Malagu

Malagu is a Serverless First, scalable and componentized progressive application development framework based on TypeScript. Malagu shields most of the underlying details of different serverless platforms and most of the pain points in serverless scenarios. Malagu is polished based on real business scenarios and provides production-level usable solutions. To provide multi-cloud solutions, cloud vendors are not locked in.

How to use Malagu

The Malagu framework is composed of a series of components. Each component is actually a node module. Choose the appropriate component according to your business scenario. You can also develop your own components based on the component mechanism. For rapid development, Malagu provides a command line tool. The command line tool has built-in out-of-the-box templates for different scenarios. You can quickly create your application through the command line tool. First, we need to install the relevant command line tools:

$ npm install -g yarm # 框架默认推荐使用 Yarn 工具,您也可以使用 Npm
$ npm install -g @malagu/cli # 安装 Malagu 命令行工具
$ malagu init project-name # 使用命令行工具 malagu init 命令,选择一个模板,初始化一个模板应用
$ cd project-name # 进入到应用的根目录
$ malagu serve # 启动应用,默认端口为 3000

Open a browser and navigate to  http://localhost:3000/ .

Support us

Malagu is an open source project licensed by MIT. It needs the support of excellent people to make it develop continuously. If you want to join us, please contact us, our email is  [email protected] .

Related Links

Guess you like

Origin www.oschina.net/news/119377/malagu-serverless-first