What are the differences between a load balancer and an API gateway?
First, let's clarify some concepts before discussing the differences.
1️⃣ NLB (Network Load Balancer) is usually deployed before the API gateway, handling traffic routing based on IP. It does not parse the HTTP requests.
2️⃣ ALB (Application Load Balancer) routes requests based on HTTP header or URL and thus can provide richer routing rules. We can choose the load balancer based on routing requirements. For simple services with a smaller scale, one load balancer is enough.
3️⃣ The API gateway performs tasks more on the application level. So it has different responsibilities from the load balancer.
The diagram below shows the detail. Often, they are used in combination to provide a scalable and secure architecture for modern web apps.
Option a: ALB is used to distribute requests among different services. Due to the fact that the services implement their own rating limitation, authentication, etc., this approach is more flexible but requires more work at the service level.
Option b: An API gateway takes care of authentication, rate limiting, caching, etc., so there is less work at the service level. However, this option is less flexible compared with the ALB approach.
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
First, let's clarify some concepts before discussing the differences.
1️⃣ NLB (Network Load Balancer) is usually deployed before the API gateway, handling traffic routing based on IP. It does not parse the HTTP requests.
2️⃣ ALB (Application Load Balancer) routes requests based on HTTP header or URL and thus can provide richer routing rules. We can choose the load balancer based on routing requirements. For simple services with a smaller scale, one load balancer is enough.
3️⃣ The API gateway performs tasks more on the application level. So it has different responsibilities from the load balancer.
The diagram below shows the detail. Often, they are used in combination to provide a scalable and secure architecture for modern web apps.
Option a: ALB is used to distribute requests among different services. Due to the fact that the services implement their own rating limitation, authentication, etc., this approach is more flexible but requires more work at the service level.
Option b: An API gateway takes care of authentication, rate limiting, caching, etc., so there is less work at the service level. However, this option is less flexible compared with the ALB approach.
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👍3
ویدئو آموزش کار با smart contracts در زبان گو بصورت رایگان
https://courses.ardanlabs.com/courses/smart-contracts-with-go
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
https://courses.ardanlabs.com/courses/smart-contracts-with-go
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
Ardan Labs Education
Smart Contracts with Go
❤4
My Favorite Books to Learn Docker and Kubernetes
https://dev.to/javinpaul/my-favorite-books-to-learn-docker-and-kubernetes-3bdc
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
https://dev.to/javinpaul/my-favorite-books-to-learn-docker-and-kubernetes-3bdc
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
🐳5
لینوکس 6.2 با پشتیبانی از پردازنده M1 اپل منتشر شد
https://www.zoomit.ir/os/402666-linux-6-2-kernel-apple-m1-chips/
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
https://www.zoomit.ir/os/402666-linux-6-2-kernel-apple-m1-chips/
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
❤3🔥2🍾1👨💻1
هوش مصنوعی interiorai.com بهتون دکوراسیون پیشنهاد میده.
اینجوری هست که یه عکس از داخل خونه یا محل کار بهش میدید اونم یه دکوراسیون به سبکی که بهش بگید براتون میزنه
تا ۵ عکس رایگان هم بهتون میده.
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
اینجوری هست که یه عکس از داخل خونه یا محل کار بهش میدید اونم یه دکوراسیون به سبکی که بهش بگید براتون میزنه
تا ۵ عکس رایگان هم بهتون میده.
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👍2🤩1
Live streaming work?
Step 1: The streamer starts their stream. The source could be any video and audio source wired up to an encoder
Step 2: To provide the best upload condition for the streamer, most live streaming platforms provide point-of-presence servers worldwide. The streamer connects to a point-of-presence server closest to them.
Step 3: The incoming video stream is transcoded to different resolutions, and divided into smaller video segments a few seconds in length.
Step 4: The video segments are packaged into different live streaming formats that video players can understand. The most common live-streaming format is HLS, or HTTP Live Streaming.
Step 5: The resulting HLS manifest and video chunks from the packaging step are cached by the CDN.
Step 6: Finally, the video starts to arrive at the viewer’s video player.
Step 7-8: To support replay, videos can be optionally stored in storage such as Amazon S3.
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
Step 1: The streamer starts their stream. The source could be any video and audio source wired up to an encoder
Step 2: To provide the best upload condition for the streamer, most live streaming platforms provide point-of-presence servers worldwide. The streamer connects to a point-of-presence server closest to them.
Step 3: The incoming video stream is transcoded to different resolutions, and divided into smaller video segments a few seconds in length.
Step 4: The video segments are packaged into different live streaming formats that video players can understand. The most common live-streaming format is HLS, or HTTP Live Streaming.
Step 5: The resulting HLS manifest and video chunks from the packaging step are cached by the CDN.
Step 6: Finally, the video starts to arrive at the viewer’s video player.
Step 7-8: To support replay, videos can be optionally stored in storage such as Amazon S3.
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👍1🕊1💊1
تو این چند روز که نبودیم جناب وزیر فرمودند برای توریست ها سیمکارت خاص طراحی میکنیم که بدون مشکل به اینستاگرام و واتساپ وصل بشن.
یعنی شما فکر کن که شهروند درجه یک کشور نمیتونه از یک سری امکانات استفاده کنه، ولی توریست میتونه بدون مشکل تو همین کشور از اون امکانات (اینستاگرام و واتساپ) استفاده کنه.
دیروزم چون دید ریده و آب قطعه اومد گفت این در حد یه پیشنهاد بود
#DevTwitter
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
یعنی شما فکر کن که شهروند درجه یک کشور نمیتونه از یک سری امکانات استفاده کنه، ولی توریست میتونه بدون مشکل تو همین کشور از اون امکانات (اینستاگرام و واتساپ) استفاده کنه.
دیروزم چون دید ریده و آب قطعه اومد گفت این در حد یه پیشنهاد بود
#DevTwitter
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
🤬14👍3💊2🤣1
اون ور توی گروه راست دیدم
ظاهرا دارن یه گروه کمونیستی راست تشکیل میشه😂
بده ما گولنگی ها حزب تشکیل ندیم واسه جنگ😂
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
ظاهرا دارن یه گروه کمونیستی راست تشکیل میشه😂
بده ما گولنگی ها حزب تشکیل ندیم واسه جنگ😂
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
🤣18🐳2🕊1
Nomad vs. Kubernetes: A complete comparison
https://www.virtualizationhowto.com/2023/02/nomad-vs-kubernetes-a-complete-comparison/
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
https://www.virtualizationhowto.com/2023/02/nomad-vs-kubernetes-a-complete-comparison/
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
🐳3
❎GitLab 15.9 Release
📡 https://about.gitlab.com/releases/2023/02/22/gitlab-15-9-released/
Key improvements released
Require multiple approvals from Code Owners
Manage license approval policies
Notifications now available in the GitLab for Slack app
Code Suggestions available in closed beta
etc....
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
📡 https://about.gitlab.com/releases/2023/02/22/gitlab-15-9-released/
Key improvements released
Require multiple approvals from Code Owners
Manage license approval policies
Notifications now available in the GitLab for Slack app
Code Suggestions available in closed beta
etc....
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👍5
Forwarded from Bardia
package main
func f(vs ...interface{}) { print(len(vs)) } func main() { f() f(nil) f(nil...) }
func f(vs ...interface{}) { print(len(vs)) } func main() { f() f(nil) f(nil...) }
Anonymous Quiz
40%
0 0 0
31%
0 1 0
25%
0 1 1
4%
1 1 0
👍1
What are the API architectural styles?
The diagram below shows the common API architectural styles in one picture.
🔹 1. REST
Proposed in 2000, REST is the most used style. It is often used between front-end clients and back-end services. It is compliant with 6 architectural constraints. The payload format can be JSON, XML, HTML, or plain text.
🔹 2. GraphQL
GraphQL was proposed in 2015 by Meta. It provides a schema and type system, suitable for complex systems where the relationships between entities are graph-like. For example, in the diagram below, GraphQL can retrieve user and order information in one call, while in REST this needs multiple calls.
GraphQL is not a replacement for REST. It can be built upon existing REST services.
🔹 3. Web socket
Web socket is a protocol that provides full-duplex communications over TCP. The clients establish web sockets to receive real-time updates from the back-end services. Unlike REST, which always “pulls” data, web socket enables data to be “pushed”.
🔹 4. Webhook
Webhooks are usually used by third-party asynchronous API calls. we use Stripe or Paypal for payment channels and register a webhook for payment results. When a third-party payment service is done, it notifies the payment service if the payment is successful or failed. Webhook calls are usually part of the system’s state machine.
🔹 5. gRPC
Released in 2016, gRPC is used for communications among microservices. gRPC library handles encoding/decoding and data transmission.
🔹 6. SOAP
SOAP stands for Simple Object Access Protocol. Its payload is XML only, suitable for communications between internal systems.
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
The diagram below shows the common API architectural styles in one picture.
🔹 1. REST
Proposed in 2000, REST is the most used style. It is often used between front-end clients and back-end services. It is compliant with 6 architectural constraints. The payload format can be JSON, XML, HTML, or plain text.
🔹 2. GraphQL
GraphQL was proposed in 2015 by Meta. It provides a schema and type system, suitable for complex systems where the relationships between entities are graph-like. For example, in the diagram below, GraphQL can retrieve user and order information in one call, while in REST this needs multiple calls.
GraphQL is not a replacement for REST. It can be built upon existing REST services.
🔹 3. Web socket
Web socket is a protocol that provides full-duplex communications over TCP. The clients establish web sockets to receive real-time updates from the back-end services. Unlike REST, which always “pulls” data, web socket enables data to be “pushed”.
🔹 4. Webhook
Webhooks are usually used by third-party asynchronous API calls. we use Stripe or Paypal for payment channels and register a webhook for payment results. When a third-party payment service is done, it notifies the payment service if the payment is successful or failed. Webhook calls are usually part of the system’s state machine.
🔹 5. gRPC
Released in 2016, gRPC is used for communications among microservices. gRPC library handles encoding/decoding and data transmission.
🔹 6. SOAP
SOAP stands for Simple Object Access Protocol. Its payload is XML only, suitable for communications between internal systems.
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👍8