RE: 阿里、滴滴钟爱的微服务为何能与区块链完美融合? by blockchainnerd

View this thread on steempeak.com

Viewing a response to: @nuls/5nyveu

· @blockchainnerd ·
$0.03
# Why can Ali and Didi's favorite microservices be perfectly integrated with the blockchain? 

---


In recent years, the maturity of micro-service architecture technology has made us see that more and more well-known enterprises, including Ali, Didi, and Vipshop, have begun to use microservices to reconstruct their own systems. Even in the blockchain industry that started the fire in 2017, there are also blockchain projects that have begun to use the microservices architecture.

Why are these well-known companies beginning to abandon the monolithic architecture and switch to microservices? Why is the blockchain of the fire combined with microservices?

What is a single architecture

Img

From the early days of Web applications, the single architecture is the most mainstream architecture in the software system architecture. So what is a single architecture?

For example, suppose you want to develop an e-commerce system that includes modules for different functions such as orders, customers, and merchandise. After the development is complete, you package all the programs and then deploy them to a server. All the functions of the user accessing the system are provided by this server.

In this way, all functions are deployed on the same server, and the architecture used is a single architecture.

Defect of single architecture

Those who have maintained a large software system with a single-frame architecture must have experienced this: when you need to add a new business function to the system, you need to download the code of all modules from the code base, deploy it in the IDE, and then Can be developed and tested; originally in an existing module, you have completed the partial encoding you need, but you can not directly call, can only copy the same code, and then modify to achieve new business Features.

These are all manifestations of high module coupling, poor code reusability, and low scalability in a single architecture. In small software systems, because the business is not too complex, after balancing development costs, a single architecture can often be used.

However, in large software systems, maintenance and iteration are persistent. How to ensure better maintenance of the system after development is completed must be considered, and micro-service is an architecture design that can effectively save maintenance costs. .

Microservice architecture and its characteristics

Img

Microservices are an architectural style. It will be a complex large-scale software system, divided into different modules according to different services, each module can be deployed independently and provide external services.

If you have developed a system with a microservices architecture, you will find that business drivers are a typical feature of the microservices architecture.

In the early 1980s, after RPC (Remote Procedure Call) technology emerged, developers began to use RPC to build large systems. In the process, developers found that not all technically split functions should be split. . The conclusion drawn from this is that the function of splitting according to the business is more reasonable. This experience eventually evolved into one of the design principles in the microservices architecture: business-driven.

Another feature of the microservices architecture is modular services. What does it mean?

In a system developed with a microservice architecture, each individual business unit is divided into a single module, and each module can be independently deployed in the server to provide corresponding business services. In the end, all the services provided by the modules are combined to form a complete business process and become a system.

Business drivers and modularity solve the problems in the single architecture system. The modules are independent of each other, and the communication between the modules is completed through the interface, which effectively reduces the coupling degree of the code. When developing new business functions, you only need to download the modules you need from the code base, you don't need to download all the code, the development and testing will be simpler, and the new features will not produce any of the original system. The impact of the system's scalability has been effectively improved.

The perfect fusion of NULS blockchain and microservices

Not only traditional Internet companies such as Ali and Didi like micro-service architecture, but also from the blockchain industry that started in 2017, there are also projects that use the micro-service architecture to make innovations.

In July 2018, the main online line was officially completed, and the NULS public chain project, which was strategically invested by Bitland, was adopted. In the design of 1.0, a modular idea was adopted, and a customizable blockchain infrastructure was realized.

However, the design of NULS1.0 is not perfect, and there are still many areas for optimization, including the following three main problems:

Testing and deployment must still be applied to the entire project;

The user interface is still an integral part of the code base;

Only one development language can be used to enhance the system and make changes.

In order to solve these problems and further optimize the overall design of NULS, the NULS core team and community members jointly designed a new architecture based on microservices NULS2.0.

NULS module warehouse, your blockchain Lego

After optimizing the NULS using the microservices architecture, NULS will use the modularity of microservices to build a module repository that will contain all the basic modules needed to build a blockchain.

The successful construction of the module warehouse allows companies or organizations to customize the blockchain they want and become a process of playing high. For example, a financial institution wants to use the NULS module warehouse to build a blockchain system that satisfies its own business. At this time, it can directly select the basic modules such as accounts, transactions, and blocks from the module warehouse, and then use it according to its own business. Need to develop the corresponding business module.

The reason why this is like a Lego process is that there is a module that has been developed and can be deployed independently and externally, so that each module can be reused by multiple blockchains. . It's like you are riding Lego, a module can be used not only for trains, but also for cars. This makes the module more reusable and more flexible.

Complete development library to make development blockchain simpler

The use of microservices systems to solve the problem of inter-module communication must be considered, NULS also provides its own solution at this point.

Img

Inter-module communication is a task that every module must handle. To facilitate development and avoid repetitive work, a service base library is added to each base module. This way the base module can easily inherit the general methods described, without having to rewrite the corresponding code.

Img

In order to further reduce the workload of the developer and facilitate the seamless connection between the external program and the platform, the NULS2.0 architecture also designs a basic application library adapted to various terminals. These libraries are code that provides intricate details about how to manage network resources, namely design messages, protocol processing, etc., so developers only need to pay attention to the problems their applications want to solve, without worrying about how to integrate them. Go to the platform. Over time, these libraries can be ported to multiple development languages, attracting more external developers to join the project.

Img

NULS is a blockchain infrastructure for customizable services. It is a global blockchain open source community project. The complete NULS2.0 microservice architecture is divided into three layers:

The first layer: the microservice infrastructure layer;

The second layer: the blockchain basic service layer;

The third layer: DAPP application layer.

This design jumped out of the common blockchain thinking limitations and reconstructed NULS from a higher dimension. The NULS core team decided to rebuild NULS 2.0 based on this architecture. This design allows NULS to be more than just the underlying infrastructure of the blockchain or a distributed system infrastructure that seamlessly integrates with the blockchain system. It will be a platform for seamless communication between different systems, which will enable Companies built around NULS can thrive faster and dramatically reduce development costs.

In the future, when NULS truly becomes a powerful and flexible platform, the scene must be unimaginable!
👍  ,
properties (23)
post_id68,679,329
authorblockchainnerd
permlinkre-nuls-5nyveu-20190111t125612125z
categorynuls
json_metadata{"tags":["nuls"],"app":"steemit\/0.1"}
created2019-01-11 12:56:12
last_update2019-01-11 12:56:12
depth1
children0
net_rshares50,247,079,036
last_payout2019-01-18 12:56:12
cashout_time1969-12-31 23:59:59
total_payout_value0.019 SBD
curator_payout_value0.006 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length8,783
author_reputation-4,455,422,450
root_title阿里、滴滴钟爱的微服务为何能与区块链完美融合?
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (2)