This article describes the php programmer to simply carry out the service governance architecture operation. For your reference, the details are as follows:
The services governed by service governance need reasonable deployment and management. In this chapter, we will talk about SOA (Service-Oriented Architecture). My language is not good, so this chapter uses question and answer mode and refers to the SOA interview question（ http://www.jdon.com/soa/soa-interview.html ]The interview question, through this station complex description carries on the simple explanation.
SOA represents service-oriented architecture, which is just a concept. Various service architectures evolved from this concept can be called SOA architecture. The core concept of SOA is “loose coupling”.
Non SOA Architecture
Co language development
Services and services may be developed in different development languages or in the same language, and their calling methods can still only be obtained through HTTP, or the popular restful API form, which is a stupid way in the process of performance and development.
What is the service of SOA
In the real world, service is a kind of expected service that we spend to buy.
1. (from the real world): you go to a restaurant to order, your order goes to the counter first, then the food is prepared in the kitchen, and finally the food is provided by the waiter. Therefore, in order to implement a restaurant ordering service, you need three logical departments / services to work together (accounting, kitchen and waiters). In the software world, the same approach is called business services.
2. (software world): you go to Amazon to order a book, there are different services, such as payment gateway, inventory system, freight system, etc., to complete the book order together.
All services are self-contained and logical. They’re like black boxes. In short, we don’t need to know the internal details of business services. For 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: whether the customer has credit or not. For order system, the service of payment gateway is a black box.
What are the main features of the service
A) SOA components are loosely coupled. When we talk about loose coupling, it means that each service is self-contained and exists independently. For example, we took the “payment gateway” service and attached it to different systems.
B) SOA services are black box. In SOA, services have inherent complexity. They only use interactive messages, and services receive and send messages. By virtualizing a service as a black box, services become more loosely coupled.
C) SOA services should be customized: SOA services should be able to define themselves.
D) SOA services are maintained in a list: SOA services remain in a central repository. Applications can search for services in a central repository and invoke the services.
E) SOA services can be choreographed and linked to achieve a specific function: SOA services can be plug and play. For example, there are two services in business process, security service and order processing service. From its business processes, you can implement two types: one, you can check the user first, and then process the order, or vice versa. Yes, you guessed it, SOA can manage the workflow between services in a loosely coupled way.
What is SOA
SOA represents a service-oriented architecture. SOA is an architecture for building business applications using loosely coupled black box services, which can be connected together through choreography 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. It is contracted in the service development, and the client is bound to the service for development and call.
- A contract is an agreement between two or more parties. It defines a protocol for how clients communicate with services. Technically, it has methods to describe 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.
- Binding determines how the endpoint can be accessed. It determines how communication is done. For example, if you expose your services, you can access them using soap over HTTP or through TCP’s binary. Therefore, two bindings will be created for these communication media.
What are reusable services?
A service is an autonomous, reusable, discoverable, stateless function with a certain granularity and is part of a composite application or a composite service.
Reusable services are identified by a business activity that is described using a service specification (design time contract).
A service constraint, including security, QoS, SLA, usage policy, can be defined by multiple runtime contracts, multiple interfaces (Web services in WSDL) and multiple implementations (codes).
Reusable services should be regulated throughout their enterprise life cycle from design to operation. Its reuse should be promoted by standard process, and reuse should be measurable.
How to realize loose coupling in an SOA?
One strategy to realize loose coupling is to use service interface (soap web service in WSDL) to limit the dependency between services and hide service implementation from consumers. Loose coupling can be solved by implementing functional encapsulation of services and limiting the impact of service interface implementation changes. However, there are times when you need to change the interface without affecting the consumer of the service, except for managing multiple security constraints, multiple transports, and other considerations.
Is SOA Service stateless or stateful?
Services should be stateless. It has a stateless execution context, but it does not have an intermediate state to wait for an event or a callback. The retention of state related data must not exceed the request / response of the service. This is because state management consumes a lot of resources, which may affect the reusability, scalability and availability of services.
After the RPC service is started, the service remains dormant and wakes up only when there is a request. You can call it stateless or stateful
Do we need to build systems from scratch in SOA?
No. If you need to integrate existing systems into business services, you just need to create loosely coupled wrappers, wrap your existing systems, and expose functionality to the outside world in a common way.
In fact, there is no need to rebuild, just continue to decompose each service and classify it into external and internal.
What is the difference between services and components?
Service components to implement the logical component grouping of business functions. Component is the way to achieve the goal of service. Components can use Java, C, C, but services will be exposed in a common format such as web services.
We call other services (Thrift) through RPC
Seeing this, I have learned about SOA. At this time, I revealed a secret. SOA actually has another name“Service governance”Yes, that’s what we’ve been talking about service governance. The next chapter goes back to the topic of service governance implementation
How PHP programmers develop simple service governance architecture (1)
How PHP programmers develop simple service governance architecture (2)
This ape man wrote a framework of service governance
More about PHP related content interested readers can see this site topic: “PHP object-oriented programming introductory tutorial”, “PHP array (array) operation skills”, “PHP basic syntax introductory course”, “PHP operation and operator Usage Summary”, “PHP character string (string) Usage Summary”, “PHP + MySQL database operation introduction tutorial” and “PHP common database operation” Summary of writing skills
I hope this article will help you with PHP programming.