请输入您要查询的百科知识:

 

词条 Draft:Team workers
释义

  1. Overview

  2. Definition

  3. History

  4. Philosophy

  5. Route-rule Implementation

  6. Code sample

  7. Defining a team worker's scope

  8. Other interactions

  9. References

{{AFC submission|d|essay|u=Guybrandw|ns=118|decliner=Praxidicae|declinets=20190327001654|ts=20190326223001}}

Team workers (derived from team and, replicated workers) or Teamed services (also abbreviated : "Workers") are a software development paradigm in which every service in a service-oriented architecture (SOA) may play a variety of roles for each request it receives determined by a set of route-rules, it's average calculated latency and other team workers availability and latency.

The set of rules considers the worker's ability to complete the request autonomously (and within a defined response time) or complete some of the sub tasks the request flow requires.

From a technical point a view a Team worker is a combination of code originally designed as Microservices, linked as one computer program.

While the traditional SOA pattern considers each service as a provider or a consumer, a team worker can play both provider or consumer roles, and therefore can also serve as a provider for its own request, meaning a worker may select (or be instructed by an Orchestration tool or Service Mesh) whether to pass the request to another worker or handle the request itself.

The selection of the part played by a worker should not compromise data integrity, security and latency and should be transparent for the consumer that originally sent the request.

Overview

As the trend[1][2] to "break down" Monolithic applications to services has grown in the early 2000's, the adoption of the Unix philosophy to Do One Thing and Do It Well lead to growth of the Microservices variant, and with many advantages of the Microservices approach, some new challenges[3][4] were introduces, and mainly point to: over-complexity, latency, greater number of point of failures, and cumbersome testing and debug-ability, with many articles[5] pointing to pros vs cons.

Hence, a suggested approach that may harness the advantages in both Monolithic and Microservices approach became a necessity.

The Team workers paradigm tries to comply with this necessity, by keeping many of the promises from both Microservices and Monolithic design:

A team worker, restricted to "act as a microservice" rules, would only serve "One purpose" in a similar manner to a Microservice, whereas it can ignore the fact that its built from "glued" Microservices and forward the request in classic Microservice manner.

In such case the single difference between a team worker and a microservice - would be the fact that the size of the worker's binary application would be much larger, as the worker will consist a great deal of "unused code" .

However, when directed by rules that allows the worker to act with multiple roles, it resolves or narrows down some of the challenges:

  1. Latency - each call handled internally within the worker, is not sent through the network, and is effectively a native function call.
  2. Number of network point of failures would be lower as well (as the total number of network requests is reduced).
  3. Debug-ability on a developer machine in most cases can be done running a worker as a complete Monolith - which would set all code debug accessible (i.e. all microservices linked in a single executable) .
  4. test-ability - business logic tests can utilize same monolith approach, other test coverage (load test, real prod environment mimic etc) would still require a distributed environment.
  5. Over-complexity in most cases cannot benefit from a team worker approach, in some case, creating a complicated set of route-rules might as well create another level of complexity.
  6. Reliability can also gain if a fail-over rule is set, so when a specific request from a worker to another fails or times out, assuming the worker contains the requested logic, it can try to resolve the request internally.

Definition

An application must satisfy the below terms to admit as a team worker:

  1. It meets the definition of a network service.
  2. It is build from at least two individual sets of code (hereby: subsets) which could be compiled into an independent service, linked together to one executable.
  3. It may serve as the provider for at least one of the request it consumes, whereas one subset is the consumer and another is the provider.
  4. It has either an internal algorithm, API or service hook, that instructs each request the worker is about to consume whether to be routed internally into another subset or externally to another worker or service.

History

The use of RPC (Remote procedure call) is dated to the early 1980's and alternating to Remote method invocation during the 1990's, the concept on which objects and classes are remotely served became common.

In some RPC models such as Microsoft DCOM specific method invocation were either machine level registered as local or remote[6] or dynamically launched local or remote with a call parameter of a server name[7], thus creating a dynamic environment on which an object can be defined as a local service or remote.

With the birth of microservices and their quick adoption[8] [9] application domain often calls a small set of methods (e.g. CRUD, RESTful and other less general purpose methods), a similar ability to allocate the service provider relies on service discovery that forces the selection of a service provider using rules and patterns [10] [11] [12] that adds another communication layer between the consumer and provider services.

Many articles[13] [14] cover the pros and cons of monolith vs microservices approaches, naming the microservices drawbacks mainly in two groups:

  1. Maintenance overhead (development complexity, end to end test-ability, troubleshoot, monitoring, dependency management, high dependency on devops)
  2. Performance overhead (communication, machines/containers and therefore RAM and CPU)

Since these drawbacks are not minor, a "Death for microservices" movement articles and blogs [15] [16] [17] started appearing, calling for a "more sane" solution suggesting a "more monolith" design, and while doing that often tell how a failing microservices solution was re-bounded either by topic to a "pack of few services" or a one monolith.

At January 2019 the idea that "combining the monolith and microservices" can lead to a "utilizing the best in two approached" gave birth to Team workers, first publicly discussed in Oracle hosted Golang meetup [18] .

Philosophy

The philosophy behind team workers can be summarized by:

  • Software engineers often design language and architecture that matches real world patterns (such are the Natural language in Imperative programming, Neural circuit in Artificial neural network for Machine learning/Artificial intelligence).
  • Programs, like humans solves simple and complex problems.
  • A "Do One thing and Do It Well" philosophy for a human can sometimes solve complex issues in steps, but rarely modern human teams are combined of people that does very small repeated similar jobs, the versatility of a team member is not only a key for the member's own success, but sometimes is the key to the whole team's success.
  • Each time a team member passes a task to another team member the need for passing the data and status of the task, can be time consuming, and error prone, and while strict responsibilities sometimes force that, an "overall responsibility" is sometimes missed.
  • Therefore forwarding/passing a job or splitting it with another team member(s) should be done with consideration: an "Assembly line" many the times benefit from each worker tool or machine doing a single repeated job, while in a football team, any player with any position would be expected to do any duty (to a degree) in order to "win". similar concepts repeat in many other games[19] [20] [21] , this does not however suggests that "all players are the same, and moreover some players have benefits/duties/privileges that other players do not, such as the Goalkeeper.
  • Adopting from a human "team member" a team worker "service" should be able to "select" (or be instructed to) when to pass the task and when to try and handle it solely, according to his abilities, availability and the pros vs cons of passing the task to another team member .

Route-rule Implementation

Every interface between a consumer and a provider, should alternate a selection for either use the internal function built in the worker, or send the request to the provider.

A basic pseudo code sample that implements a route-rule based on the busy state of worker would look like this:

func Do(job Job) {

if isbusy(){

} else {

}

Where "isbusy" can be a simple:

func isbusy() bool{

}

A "good" set of rules would be such that balances well between lowering number of requests from one worker to another vs exhausting the worker by handling all the requests on its own.


Code sample

A code sample of two separate microservices , and a small migration to a team worker linked out of the two microservices can be found in:

https://github.com/guybrand/teamworkers/

Defining a team worker's scope

The content of a team worker's scope (i.e. the combination of Microservices linked together) should consider the possibility and frequency each micro-service would interact with another micro-service, e.g. in an eCommerce website solution, it is very likely that a basket service would interact with catalog-product service and payment-service, and therefore a team worker consisting of these 3 Microservices may be a good set of choice, a service that supports for online chat in the same website, does not directly interact with the basket service and should not be linked in the same team worker.

Orchestration tools(such as Kubernetes and Ansible), service meshes(such as [https://istio.io/docs/concepts/what-is-istio/ istio],[https://linkerd.io/ Linkerd], and [https://www.hashicorp.com/blog/consul-1-2-service-mesh consul]) and monitoring & analytics tools (Such as Datadog and New Relic) that interacts with workers and microservice, can utilize their metrics or AI to advise for the right composition or a team worker, and even configure and launch dynamic compilation of workers when new pods are required.

Other interactions

Team workers can interact with classic services or microservices.

Creating a team worker can be selective for specific cases such as specific latency bottleneck, ease of debugging etc.

In the same manner switching to team workers can be done moderately, and does not require a complete rewrite.

References

1. ^{{Cite web|url=https://www.oreilly.com/library/view/service-oriented-architecture-governance/9780470171257/9780470171257_the_inevitable_soa_trend.html|title=THE INEVITABLE SOA TREND - Service-Oriented Architecture Governance for the Services Driven Enterprise [Book]|website=www.oreilly.com|language=en|access-date=2019-03-04}}
2. ^{{Cite web|url=https://redmonk.com/sogrady/2017/07/20/soa-microservices/|title=The Difference Between SOA and Microservices Isn't Size|last=O'Grady|first=Stephen|date=2017-07-20|website=tecosystems|language=en-US|access-date=2019-03-04}}
3. ^{{Cite web|url=https://docs.aws.amazon.com/aws-technical-content/latest/microservices-on-aws/challenges-of-microservices.html|title=Challenges of Microservices - Microservices on AWS|website=docs.aws.amazon.com|access-date=2019-03-04}}
4. ^{{Cite web|url=https://cloudacademy.com/blog/microservices-architecture-challenge-advantage-drawback/|title=Microservices Architecture: Advantages and Drawbacks|date=2018-10-18|website=Cloud Academy|language=en-US|access-date=2019-03-04}}
5. ^{{Cite web|url=http://insights.sei.cmu.edu/sei_blog/2015/11/microservices-beyond-the-hype-what-you-gain-and-what-you-lose.html|title=Microservices Beyond the Hype: What You Gain and What You Lose|last=Merson|first=Paulo|website=https|language=en-us|access-date=2019-03-05}}
6. ^{{Cite web|url=https://docs.microsoft.com/en-us/windows/desktop/com/dcomscmremotecallflags|title=DCOMSCMRemoteCallFlags - Windows applications|last=GrantMeStrength|website=docs.microsoft.com|language=en-us|access-date=2019-03-25}}
7. ^{{Cite web|url=https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/createobject-function|title=CreateObject function (Visual Basic for Applications)|last=o365devx|website=docs.microsoft.com|language=en-us|access-date=2019-03-25}}
8. ^{{Cite web|url=https://dzone.com/articles/lessons-from-the-birth-of-microservices-at-google|title=Lessons From the Birth of Microservices at Google - DZone Microservices|website=dzone.com|language=en|access-date=2019-03-25}}
9. ^{{Cite web|url=https://trends.google.com/trends/explore/TIMESERIES?date=all&q=microservices&hl=en-AU&sni=4|title=Google Trends|website=Google Trends|access-date=2019-03-25}}
10. ^{{Cite web|url=http://microservices.io/patterns/client-side-discovery.html|title=Microservices Pattern: Client-side service discovery pattern|website=microservices.io|access-date=2019-03-26}}
11. ^{{Cite web|url=http://microservices.io/patterns/server-side-discovery.html|title=Microservices Pattern: Server-side service discovery pattern|website=microservices.io|access-date=2019-03-26}}
12. ^{{Cite web|url=http://microservices.io/patterns/service-registry.html|title=Microservices Pattern: Service registry pattern|website=microservices.io|access-date=2019-03-26}}
13. ^{{Cite web|url=https://dzone.com/articles/to-micro-or-mono-pros-and-cons-of-both-service-arc|title=To Micro or Mono – Pros and Cons of Both Service Architectures - DZone Microservices|website=dzone.com|language=en|access-date=2019-03-26}}
14. ^{{Cite web|url=https://raygun.com/blog/what-are-microservices/|title=What are microservices? The pros, cons, and how they work|website=Raygun Blog|language=en-us|access-date=2019-03-26}}
15. ^{{Cite web|url=http://dwmkerr.com/|title=The Death of Microservice Madness in 2018|date=2018-01-12|website=dwmkerr.com|language=en|access-date=2019-03-26}}
16. ^{{Cite web|url=https://segment.com/blog|title=Goodbye Microservices: From 100s of problem children to 1 superstar|website=Segment|language=en|access-date=2019-03-26}}
17. ^{{Cite web|url=https://adamdrake.com/enough-with-the-microservices.html|website=adamdrake.com|access-date=2019-03-26}}
18. ^{{Cite web|url=https://www.meetup.com/Go-Israel/events/kjvczlyzfbjb/|title=Go Israel March 2019 Meetup|website=Meetup|language=en|access-date=2019-03-26}}
19. ^Rugby football
20. ^{{Citation|title=Basketball|date=2019-03-24|url=https://en.wikipedia.org/w/index.php?title=Basketball&oldid=889180692|work=Wikipedia|language=en|access-date=2019-03-26}}
21. ^{{Citation|title=Ice hockey|date=2019-03-24|url=https://en.wikipedia.org/w/index.php?title=Ice_hockey&oldid=889223451|work=Wikipedia|language=en|access-date=2019-03-26}}
随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/13 14:46:14