In this chapter, we will talk about SOA(Service-oriented Architecture). My language is not good, so this chapter uses the q&A mode, referring to [SOA interview questions (www.jdon.com/soa/soa-int…)]. A brief explanation of the complex description of the station.

An overview of the

SOA stands for service-oriented architecture. It is just a concept through which various service architectures can be called SOA architectures. The core concept of SOA is “loose coupling”.

Non-soa architectures

Multilingual development

Same language development

Services may be developed in different languages or in the same language, and their invocation methods are still available only through HTTP, or in the form of popular Restful apis, which are clumsy in terms of performance and development.

What are SOA services

In the real world, a service is an expected service that we pay for.

1. (from the real world) : You go to a restaurant to order food, your order goes first to the counter, the food is prepared in the kitchen, and finally the food is served by the waiter. Therefore, in order to implement a restaurant ordering service, you need three logical departments/services working together (accounting, kitchen, and server). In the software world the same approach is called business services.

2. (Software World) : You go to Amazon to order a book, and different services, such as payment gateway, inventory system, shipping system, etc. work together to complete the book order.

All services are self-contained and logical. They’re like black boxes. In short, we don’t need to know the inner workings of business services. To the outside world, it’s just a black box that can interact with messages. For example, after the Payment Gateway business service gets the message “Check credit,” it will give the output: this customer has or does not have credit. The payment Gateway service is a black box to the order system.

What are the main features of the service

A) SOA components are loosely coupled. When we say loosely coupled, it means that each service is self-contained and exists independently of its own logic. For example, we took the “payment gateway” service and attached it to different systems.

B) SOA services are black boxes. In SOA, service hiding has inherent complexity. They only use interactive messages, which the service accepts and sends. By virtualizing a service as a black box, services become more loosely coupled.

C) SOA services should be custom: SOA services should be self-definable.

D) SOA services are maintained in a list: SOA services are maintained in a central repository. Applications can search for services in the central repository and invoke the corresponding services.

E) SOA services can be choreographed and linked to implement a specific function: SOA services can use a plug-and-play approach. For example, there are two services in business process, security Service and Order processing Service. Two types of business processes can be implemented from it: one, you can check the user first and then process the order, or vice versa. Yes, you guessed it, workflow between services can be managed in a loosely coupled way with SOA.

What is the SOA

SOA stands for service-oriented architecture. SOA is an architecture for building business applications using loosely coupled black box services that can be choreographed together to achieve specific functions.

What are contracts, addresses and bindings?

These are the three standard terms for SOA. Each service opens its address to the outside world, contracts are made in service development, and clients bind the service to make development calls.

  • A contract is an agreement between two or more parties. It defines a protocol for how a client communicates with a service. Technically, it has methods for describing parameters and return values.
  • The address indicates where the service can be found. An address is a URL that points to the location of the service.
  • The binding determines how this endpoint is accessible. It determines how communication is done. For example, if you expose your service, you can access it using SOAP over HTTP or through TCP BINARY. Therefore, two bindings will be created for these communication media.

n

What are reusable services?

A service is an autonomous, reusable, discoverable, stateless, granular function that is part of a composite application or a composite service.

Reusable services are identified by business activities described using service specifications (design-time contracts).

A service constraint, including security, QoS, SLA, usage policy, can be defined by multiple run-time contracts, multiple interfaces (Web services in WSDL), and multiple implementations (code).

Reusable services should be regulated throughout their enterprise life cycle from design to operation. Its reuse should be driven by a normative process and should be measurable.

How do you achieve loose coupling in an SOA?

One strategy for implementing loose coupling is to use service interfaces (SOAP Web services in WSDL) to limit dependencies between services and hide service implementations from consumers. Loose coupling can be addressed by enforcing functional encapsulation of services and limiting the impact of implementation changes on service interfaces. However, at some point you need to change the interface without affecting the consumer of the service, in addition to managing multiple security constraints, multiple transports, and other considerations.

Are SOA services stateless or stateful?

Services should be stateless. It has a stateless execution context, but it has no intermediate state to wait for an event or a callback. State – related data must not be retained beyond the request/response of the service. This is because state management consumes a lot of resources, which can affect the reusable scalability and availability of services.

After the RPC service is started, the service remains asleep and only wakes up on request, which you can call stateless or stateful

Do we need to build systems from scratch in SOA?

No. If you need to integrate existing systems for business services, you just need to create loosely-coupled wrappers that wrap your existing systems and expose functionality to the outside world in a common way.

There is no need to rebuild, just continue to break down each service into external and internal categories.

What is the difference between a service and a component?

Service components Logical grouping of components to implement business functions. Components are the way to achieve this goal. Components can use Java, C #, or C, but services will be exposed in a generic format like Web services.

We call other services through RPC (thrift)

trailer

Now that I know about SOA, I’m revealing a secret that SOA actually has another name called “service governance”. Yes, it’s the service governance we’ve been talking about. The next chapter gets back to business and covers service governance implementations

PHP programmers how to implement a simple service governance architecture (a) juejin.cn/post/703258…

PHP programmers how to implement a simple service governance architecture (2) juejin.cn/post/703258…

The ape has written a framework for service governance github.com/CrazyCodes/…

communication

There is life, there is code.

Spread the positive energy of technology and continue to learn new knowledge.