What is SOA? What is SCA? What is micro service?

This is the front-end small class of the Xiuzhen Academy. Each shared article is from

[background introduction] [knowledge analysis] [common problems] [solutions] [coding practice] [extended thinking] [more discussion] [References]

Eight aspects of in-depth analysis of front-end knowledge / skills. This article shares:

[what is SOA? What is SCA? What is microservice?]

Hello, I'm a student of IT academy, an honest, pure and kind java programmer

Today, I'd like to share with you the knowledge points in deep thinking on Java task 9 on the official website of the Academy - what is SOA? What is SCA? What is micro service?

Background introduction

With the development of the business, all in one can no longer meet the business requirements. It is necessary to split the core or common services. Driven by this demand, the concepts of SOA, SCA, microservice and so on have emerged.

Knowledge analysis

1:SOA

SOA (Service Oriented Software Architecture) is a software design pattern, which is mainly applied to the interoperability between different application components through some kind of protocol, such as typical communication network protocol. Therefore, SOA is independent of any manufacturer, product and technology.

Service oriented architecture is a software architecture. Different components of an application provide services to other components through communication protocols on the network. Communication can be simple data transfer, or two or more services can be coordinated and connected to each other. These unique services perform small functions, such as verifying payments, creating user accounts, or providing social login.

Service oriented architecture is less about how to modularize the application, but more about how to form the application through the integration of distributed, separately maintained and deployed software components. These are implemented through technologies and standards, which make it easier for components to communicate and cooperate through networks, especially IP networks.

There are two main roles in SOA Architecture: service provider and service consumer. Software agent can play these two roles. The consumer layer is the point where users (people, applications or other components of a third party) interact with SOA, and the provider layer consists of all services in SOA architecture.

SOA was first named in the mid-1990s, when a company called Gartner Group recognized the new trend of this software architecture and promoted it around the world. By doing so, they managed to greatly accelerate the adoption and further development of this architecture model. However, the earliest record of using distributed services as a software architecture dates back to the early 1980s.

SOA based solutions, SOA architecture can be divided into five levels:

User interface layer - Application / service interfaces accessed by end users or applications of these GUIs;

Business process layer - business use case service in application;

Service layer - services are combined to provide unified real-time services;

Service component layer - components used to build services, such as function library, technology library, technology interface, etc;

Operating system - this layer includes data model, enterprise data warehouse, technical platform, etc;

SCA

The full name of SCA is service component architecture, which is called service component architecture in Chinese. SCA is a model specification based on SOA development and a standard led by IBM.

In SCA, the most important concept is service, whose connotation is independent of specific technology. Therefore, SCA will not call it Java component architecture or web service component architecture. The so-called specific technology mainly has two meanings: one is the program language, but the transmission protocol.

There are many different models of component-based programming. In order to provide a unified calling mode for different interfaces, IBM proposed WSIF, but WSIF does not have a component-based architecture model, so IBM proposed SCA on this basis.

Service component is the most basic functional unit of SCA. Service implementation methods and POJOs can be packaged as service components of SCA. The main interface specification of SCA service components is based on WSDL. In addition, in order to provide a more direct interface to Java, java interface is also provided.

Characteristics of SCA service components

Service components are generally coarse-grained.

The interface of the service component is a standard interface.

The service component implementation is language independent, that is, it does not bind language.

Service components are managed by the component container and provide services, which are not controlled by program code.

SCA is a further sublimation of current component programming. Its goal is to enable service components to freely bind various transport protocols and integrate other components and services.

The biggest difference between SCA and traditional business components is that SCA implements two functions: one is the separation of components and transmission protocols, and the other is the separation of interfaces and implementation languages.

The essence of SCA is a software architecture idea. SCA architecture is an SOA architecture independent of program language.

The goal of SCA is to create a running environment that can integrate service components.

Service module is composed of one or more service components with internal business relationship. It is the running unit and independent deployment unit in SCA.

General applications are complex. Practical applications require multiple modules to meet the requirements. These modules call each other. The module provides two endpoints, import and export. Import enables the module to call external services, and export enables external applications to call services inside the module.

When we build multiple modules, if there are some resources that can be shared between different modules, we can choose to create a resource that can be shared between different modules. The shared library is where these shared resources are stored. The shared library contains only data definition, interface definition, data mapping and relationship. The biggest difference from the module is that the shared library does not contain service components, so it does not contain business logic.

Microservices

To some extent, microservice architecture is the next step in the development of Service-Oriented Architecture SOA. Basically, this architecture type is software development, Network or mobile applications as separate service Suites (also known as microservices). The creation of these services is limited to a specific business function, such as user management, user role, e-commerce vehicle, search engine, social media login, etc. in addition, they are completely independent, that is, they can write to different programming languages and use different databases. Centralized service management hardly exists , microservices communicate using lightweight HTTP, rest, or thrift APIs.

The word itself originated from the software architect seminar held near Venice in May 2011. For the first time, they used the term "microservice" to describe a common architectural style seen by participants, many of whom were exploring similar content. In May 2012, the same team decided to take "microservice" as the most appropriate name. However, in fact, major technology companies such as Microsoft, Amazon, Netflix and Facebook have been working on microservice architecture for more than a decade.

At first glance, microservice architecture seems to be talking about the same thing as SOA. However, if Martin flower, a pioneer in Microsoft services, is quoted, he once said, "we should regard SOA as a superset of microservices".

Similarities and differences between SOA and microservices:

SOA

The differences described in the above table are further explained below:

Development aspects - in both architectures, services can be developed using different programming languages and tools, bringing technical diversity to the development team. Development can be organized in multiple teams, but in SOA, each team needs to understand common communication mechanisms. On the other hand, with microservices, services can be run and deployed independently of other services. Therefore, it is easier to frequently deploy new versions of microservices or independent extension services. You can read more about these benefits of microservices here.

"Context boundary" - SOA encourages sharing of components, while microservices try to minimize sharing through "context boundary". Context boundary refers to coupling components and their data into a single unit with minimal dependency. Because SOA relies on multiple services to complete business requests, systems built on SOA may be slower than microservices.

Communication - in SOA, an ESB can become a single point of failure affecting the entire system. Since each service communicates through the ESB, if one of the services becomes slow, it may block the ESB and request the service. On the other hand, microservices are much better at fault tolerance. For example, if a microservice has a memory error, only that microservice will be affected. All other microservices will continue to process requests on a regular basis.

Interoperability - SOA facilitates the use of a variety of heterogeneous protocols through message oriented middleware components. Microservices try to simplify the architectural pattern by reducing the number of integration choices. Therefore, if you want to integrate multiple systems using different protocols in a heterogeneous environment, you need to consider SOA. If all your services can be accessed through the same remote access protocol, microservices are a better choice for you.

Size - last but not least, the main difference between SOA and microservices is size and scope. The prefix "micro" in microservice architecture refers to the granularity of internal components, which means that they must be much smaller than the services of SOA architecture. Service components in microservices usually have a single purpose, and they do well. On the other hand, SOA services usually contain more business functions, and they are usually implemented as complete subsystems.

common problem

Application of SCA. A simple example of SCA.

Coding practice

Extended thinking

Similarities and differences between SOA and soap;

SOA (Service Oriented Software Architecture) is a software design pattern, as above;

Soap is the simple object access protocol, which is a lightweight protocol for exchanging XML (a subset of Standard General Markup Language) encoded information.

It has three main aspects:

1: XML envelope defines a framework for describing information content and how to deal with it;

2: Rules for encoding program objects into XML objects;

3: A convention for executing remote procedure calls (RPCs).

Soap can run on any other transport protocol.

For example, you can use SMTP, the Internet e-mail protocol, to deliver SOAP messages, which is very tempting. The headers are different between the transport layers, but the XML payload remains the same.

Web service hopes that different systems can call each other in the way of "software software dialogue", breaking the incompatible state between software applications, websites and various devices, and realizing the goal of "seamless integration based on Web".

reference

More discussion

Q1: what are the mainstream microservice frameworks?

A1: Dubbo and spring cloud

Q2: brief introduction to duboo

A1:

Dobbo is an RPC framework. It is an RPC developed for Java by Alibaba engineers. It has high performance and simple usage:

1. The remotely called interface needs to be registered in zookeeper;

2. Services that need to be called remotely declare their required interfaces in zookeeper;

3. Zookeeper notifies the registered interface to the required service;

Q3: what is cap theory

Cap theory is that it is impossible to meet "consistency", "availability" and partition fault tolerance at the same time;

Ppt link video link

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>