피드 구독

Having a grasp of common architectural patterns is essential to designing software architecture at scale. Using them saves not only time but also ensures a reliable implementation of your design. There’s no need to reinvent the wheel when there’s an architectural pattern available that applies to an architecture you’re developing.

The following is a brief overview of the Throttling architectural pattern.

Understanding the Throttling pattern

The Throttling pattern, also known as Rate Limiting, is one in which a throttle is placed in front of a target service or process to control the rate at which data flow into the target. Throttling is a technique that ensures that the flow of data being sent into a target can be digested at an acceptable rate. Should the target become overwhelmed, the throttle will slow down or even stop calls to the target.

Throttling architecture pattern

In addition to being used as a defensive measure, the Throttling pattern can be used by consumers of cloud providers as a way to control consumption costs. Consumers can use tools to set a rate limit on calls made to a specific third-party service. This limit is usually defined as calls per second. Thus, clients avoid incurring unanticipated costs.

Pros

  • The Throttling pattern prevents catastrophic failure, particularly in terms of a denial-of-service (DDoS) attack. A DDoS is one in which a malevolent actor assaults an endpoint with a high number of calls that obstruct other calls from getting access to that endpoint. A throttle will detect the increase in traffic caused by the attack and react. That reaction might be to block traffic coming in from the malevolent IP address or to slow down the rate of traffic in general.
  • The Throttling pattern can be used to control infrastructure expenses, either financial or technical, by enforcing rates of usage of a particular process or service. Setting a throttle ensures that the target does not become operationally overwhelmed. Or, the throttling pattern can be used to avoid incurring unexpected charges from commercial managed services.

Cons

  • If a system does not have adequate redundancy mechanisms in place overall performance can degrade when key targets are slowed down due to the threshold imposed by the given throttle.
  • Implementation of the throttling pattern will vary according to what’s being throttled. Thus, specific engineering expertise is required. The technique used to throttle messages being emitted to a message broker is much different than the technique used to throttle HTTP calls to a particular brand of web server.
  • The throttling pattern is difficult to do as a one-off solution implemented in isolation. Often the Throttling architectural pattern is used in conjunction with the Circuit Breaker pattern in order to maintain service availability. For example, when a target reaches a threshold that requires throttling, a circuit breaker is used to reroute traffic to another target that has identical functionality, thus reducing the load on the first target. Typically implementing this type of throttling behavior requires infrastructure management technologies such as Kubernetes Horizontal Pod Autoscaler or a service mesh solution such as Istio or Linkerd.

Putting it all together

The essential benefit of the Throttling pattern is that it allows a system to control both internal and external traffic that might compromise a system's ability to operate in a safe and predictable manner. Unanticipated bursts in call activity do happen; sometimes by accident; something by nefarious intention. The Throttling pattern mitigates the impact of such bursts.

Client-side throttling will control the rate at which calls are made to commercial services that calculate fees according to usage activity. Thus, the Throttling pattern is used as a cost-control mechanism.

Using the Throttling pattern internally on the server-side protects a system from the DDoS acts from bad actors. Also, internal throttling protects the system from unanticipated burst activity from other internal processes and services. The tradeoff is that when throttling is in effect, the system might slow down and thus overall system performance can be affected. Hence, the Throttling Pattern is often used in conjunction with the Circuit Breaker pattern.


저자 소개

Bob Reselman is a nationally known software developer, system architect, industry analyst, and technical writer/journalist. Over a career that spans 30 years, Bob has worked for companies such as Gateway, Cap Gemini, The Los Angeles Weekly, Edmunds.com and the Academy of Recording Arts and Sciences, to name a few. He has held roles with significant responsibility, including but not limited to, Platform Architect (Consumer) at Gateway, Principal Consultant with Cap Gemini and CTO at the international trade finance company, ItFex.

Read full bio
UI_Icon-Red_Hat-Close-A-Black-RGB

채널별 검색

automation icon

오토메이션

기술, 팀, 인프라를 위한 IT 자동화 최신 동향

AI icon

인공지능

고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트

open hybrid cloud icon

오픈 하이브리드 클라우드

하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요

security icon

보안

환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보

edge icon

엣지 컴퓨팅

엣지에서의 운영을 단순화하는 플랫폼 업데이트

Infrastructure icon

인프라

세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보

application development icon

애플리케이션

복잡한 애플리케이션에 대한 솔루션 더 보기

Virtualization icon

가상화

온프레미스와 클라우드 환경에서 워크로드를 유연하게 운영하기 위한 엔터프라이즈 가상화의 미래