Division and unification of SOA and API

Source: Internet
Author: User

While APIs and SOA have similar business and technical goals, many proponents of the API insist that APIs are almost unrelated to SOA, and that they are a distinct approach. They often preach that there is a big difference between a pragmatic rest API and SOA. The Division of labor restricts SOA services and restful APIs from being neatly integrated into a single, unified architecture.

The team must build a bridge between the SOA and API perspectives, building a real-world plan to integrate APIs and SOA.

The common focus of the teams that do rest and create APIs is to overcome technical and business hurdles with incremental external scaling, concrete demonstrations, and core business use cases that do not involve complex technologies. SOA teams are often concerned with scaling efficiencies, meeting business standards, building decision centers, and meeting complex non-functional requirements.

By combining APIs and SOA perspectives, teams can quickly deliver business solutions when they follow business strategies and expand requirements.

A pragmatic Rest API focus

Rest is an architectural style of system development that enforces constraints on a range of service interactions. Formal rest constraints include client-server and stateless interactions, cacheable responses, immutable contracts, layered system design, and on-demand encoding. These constraints are conducive to the presentation of features, namely simplicity, extensibility, variability, reliability, visibility, performance, and portability. Systems that meet rest constraints are called restful. RESTful design methods can add a lot of benefits:

    • Make data and services easier to access
    • Lower entry threshold
    • Maximize the number of audiences you can expand
    • Make the API or service consumed by a large number of user agents
    • Make data and services evolve
    • Extending the system at run time
    • Changes to the resource do not affect the customer
    • Dynamically Guide Customer behavior
    • Enables scalable, reliable and high-performance systems
    • Simple
    • can be cached
    • Atomic Nature

While restful design benefits the goal of supporting SOA, a pragmatic rest's strategic focus differs from many SOA initiatives. The Pragmatic Rest API design team focuses on bottom-up scenarios, friendly protocols or formats (such as HTTP, JSON, DNS), tolerant interface definitions, and simple interaction models (such as retries on guaranteed delivery).

A pragmatic SOA focus

A pragmatic SOA focuses on service-oriented patterns, which focus on increasing the value of software assets. The basic service-oriented pattern is:

    • Sharing and reusing assets
    • Secures redundant functionality to stable parts
    • Keeping projects in compliance with public standards and best practices

Applying these three modes will reduce the complexity of the IT environment and provide greater flexibility, such as the ability to build applications more quickly and modify changes to handle requirements more quickly. Service-oriented models drive development teams to assess the ability of software assets to meet the needs of business stakeholders.

Pragmatic SOA Best Practices

A pragmatic SOA team does not force the public (and complex) standards to be pushed forward. A pragmatic SOA team delivers valuable business capabilities, lowers application resistance and delivers unique service value.

A pragmatic SOA team does not advocate hard-to-operate best practices. They rely on inter-team mentoring and automated governance to streamline best-practice applications, which makes it easier for teams to do the right thing.

A pragmatic SOA team is mindful of skill differences and barriers to application. They provide accelerator packages (such as architectures, tools, frameworks, and API or service building blocks) to reduce training, increase self-service applications, and speed project delivery.

A pragmatic SOA team balances corporate governance with project autonomy. Rather than erecting development and registration thresholds, successful teams introduce mechanisms to improve services, indirect interactions, hard service levels, and promote self-service applications by introducing these mechanisms to enable teams to promote service development, service sharing, and service application. You can think of these mechanisms as the core of existing API management.

A pragmatic blend

Rest and SOA are different, although they are not incompatible. Services can become restful,restful resources can also become services. Like SOA, rest is a schema discipline defined by a set of design principles, and rest enforces a set of schema constraints. Rest uses a resource-centric model that is diametrically opposed to an object-centric model (for example, encapsulating behavior through resources). In rest, everything you are interested in is a resource. The ability to encapsulate and expose services in a set of resources when modeling a restful service (also called an API).

SOA is a lengthy architectural journey, not a short-term implementation, because SOA presents a schema-targeted state that is often somewhat different from the current legacy of IT assets. Because APIs connect business capabilities both inside and outside the organization, the API provides a platform for business stakeholders to initiate enterprise IT innovation and implement a pragmatic business.

When to create a service or to create an API

When you are about to create a unified architecture strategy that includes both SOA and rest, the next logical question is: When do you create a service or create an API? From a message-passing standpoint, services and APIs have similar properties. They are all accessible network terminals that deliver data by accessing or triggering transactions. From an architectural standpoint, services and APIs provide the opportunity to isolate concerns and create loosely coupled solutions. Many architects and developers want to expand their service-oriented architecture (SOA) along with the API, but it's unclear when to create a service or to create an API.

When do I create a service?

As an accessible network terminal, a service is a published business or data. Create services when a team wants to share business capabilities or business data across network domains or run - time applications.

Services should implement an appropriately automated business task and should not be designed to be refined components that interact with other components. When a service exposes a separate task in a business process, developers and business analysts prefer to learn about the goals of the service. The granularity of business tasks to design services, reduce the interactive complexity of services, simplify the maintenance of the application. Examples of business tasks that are appropriate for the service-oriented approach include "Submit Orders", "Retrieve Customer Records", and "pay".

Interface and implementation separation

A service encapsulates a specific implementation, and a service terminal typically has a one-to-one correlation between the service and the back-end business logic. Services should expose business capabilities or data through a variety of interface styles, such as resource-oriented, publish/subscribe, method calls. To maximize effectiveness and scope, service implementations should publish accessible interfaces through a variety of message protocols such as HTTP, JMS, MQ, and message formats such as JSON, XML, and CSV.

RESTful is an interface style. This network is ideal for mobile applications, thin JavaScript client applications, and bash script access functions across networks and all domains.

Ideally, the interface style is not only a detailed solution, but also an important management feature (such as security, enforcement of the service layer, usage tracking, etc.), which are valid in all interface styles (such as resource-oriented, publish/subscribe, method calls). Figure 1 shows the appearance pattern, connecting a single service implementation and multiple consumers:

Figure 1:api Appearance mode

The separation of intrinsic representations from external contracts and external agreements will certainly affect the ability to evolve service implementations over time. When an interface is clearly separated from an existing implementation, the developer can modify its implementation without affecting the invocation of the application using the service.

However, removing the coupling between consumers and providers from a shared application platform and eliminating interface coupling from the implementation adds additional focus. For example, if you try to make operational semantics (such as identity, service layer, authorization) flow seamlessly across different platforms and distributed environments, the difficulty increases. The team relies on the middleware infrastructure to bridge the semantics across all participants and components.

Many teams bind interfaces tightly to implementations because of the complexity and extra work that is introduced by separating interfaces from implementations. By following architectural best practices and introducing API skins or proxy terminals (using automated development), the team can enhance the maintainability and adaptability of the solution.

When do I create a restful API?

RESTful APIs are an interface style that complements service implementations. You can create restful APIs at the following times when you want to share services beyond the control domain (such as business units, organizations), when you aim to extend the reach and consumer groups, when you want to provide services across the local Web infrastructure, or when you are extremely interested in asymmetric evolution of the service side, interfaces, and implementations.

If the development team publishes the API appearance before the existing service, they will detach the service's interface from the implementation of the service. API endpoints are lightweight agents that implement security, monitoring usage, and traffic shaping. Proxies enable the implementation of consumer interface contracts and back-end services to be clearly separated.

API gateways are prioritized by API delivery mechanisms when application servers, enterprise service bus nodes, or data service hosts can publish API endpoints. The managed APIs are:

    • Active Publishing and subscription
    • Works with related service level agreements (SLAs) that have been published
    • Secure, certified, authorized, and protected
    • Monitoring and monetization through analysis
Service interface or RESTful API interface

RESTful APIs are not the same as services, although they are not incompatible. Services can become restful,restful resources can also become services. Like SOA, rest is a schema discipline defined by a set of design principles, and rest enforces a set of schema constraints.

The RESTful API interface is a constrained subset of the service interfaces. The RESTful API exposes resource-oriented interfaces, ideally conforming to Hateos (Hypermedia as the application state engine). The RESTful API publishes a resource-centric model that is opposite to the object-centric model (for example, the behavior is wrapped in resources). In rest, every "thing" of interest is a resource. When modeling a restful service (also called an API), the capabilities of the service are packaged and exposed as a set of resources.

To create a restful API:

    1. Specify "ID" for all Things
    2. Link all things together
    3. Using the standard HTTP method
    4. Allow multiple message formats to be expressed
    5. Reduce the state of sharing

The Emerging API design tool will help you transform a service implementation into a restful API

Division and unification of SOA and API

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.