On this publication, we’ll cowl the next matters:
-
How reside streaming works
-
Visa vs. American Specific
-
Why is the bank card referred to as “essentially the most worthwhile product in banks”?
-
Why is single-threaded Redis quick (video)
-
Debugging Ways
How do video reside streamings work on YouTube, TikTok reside, or Twitch? The approach is named reside streaming.
Livestreaming differs from common streaming as a result of the video content material is shipped by way of the web in real-time, normally with a latency of only a few seconds.
The diagram under explains what occurs behind the scenes to make this doable.
Step 1: The uncooked video information is captured by a microphone and digital camera. The information is shipped to the server aspect.
Step 2: The video information is compressed and encoded. For instance, the compressing algorithm separates the background and different video components. After compression, the video is encoded to requirements resembling H.264. The scale of the video information is way smaller after this step.
Step 3: The encoded information is split into smaller segments, normally seconds in size, so it takes a lot much less time to obtain or stream.
Step 4: The segmented information is shipped to the streaming server. The streaming server must assist totally different units and community situations. That is referred to as ‘Adaptive Bitrate Streaming.’ This implies we have to produce a number of recordsdata at totally different bitrates in steps 2 and three.
Step 5: The reside streaming information is pushed to edge servers supported by CDN (Content material Supply Community.) Tens of millions of viewers can watch the video from an edge server close by. CDN considerably lowers information transmission latency.
Step 6: The viewers’ units decode and decompress the video information and play the video in a video participant.
Steps 7 and eight: If the video must be saved for replay, the encoded information is shipped to a storage server, and viewers can request a replay from it later.
Commonplace protocols for reside streaming embrace:
-
RTMP (Actual-Time Messaging Protocol): This was initially developed by Macromedia to transmit information between a Flash participant and a server. Now it’s used for streaming video information over the web. Be aware that video conferencing functions like Skype use RTC (Actual-Time Communication) protocol for decrease latency.
-
HLS (HTTP Stay Streaming): It requires the H.264 or H.265 encoding. Apple units settle for solely HLS format.
-
DASH (Dynamic Adaptive Streaming over HTTP): DASH doesn’t assist Apple units.
Each HLS and DASH assist adaptive bitrate streaming.
Over to you: What are a number of the optimizations that may be performed on this course of? Which kind of storage is appropriate for video persistence in step 7
What are the variations between VISA and American Specific’s (AMEX) processing whenever you swipe bank cards?
The key distinction is VISA makes use of a 4-party mannequin the place the issuer and acquirer are totally different entities, whereas AMEX makes use of a 3-party mannequin the place the issuer and acquirer are the identical entity.
The diagram under makes use of the authorization movement to display the variations.
🔹4-Occasion Mannequin (Authorization Circulation)
Step 0: The cardboard-issuing financial institution points a bank card to its buyer.
Step 1: The cardholder buys a product by swiping their bank card on the Level of Sale (POS) terminal in a service provider’s store.
Step 2: The POS terminal sends the transaction to the buying financial institution, which supplies the POS terminal.
Steps 3 and 4: The buying financial institution sends the transaction to the cardboard community, additionally referred to as the Card Scheme. This card community sends the transaction to the issuing financial institution for approval.
Steps 4.1, 4.2, and 4.3: The issuing financial institution freezes the cash if the transaction is authorized. The approval or rejection is shipped again to the acquirer, and to the POS terminal.
🔹3-Occasion Mannequin (Authorization Circulation)
Steps 0,1 and a pair of are the identical as within the 4-party mannequin.
Step 3: Since one firm performs issuing, buying, and card community capabilities, the transactions are processed internally inside the franchisor. That is additionally referred to as the closed loop card mannequin. Closed loop networks are extra environment friendly as a result of all capabilities are processed in a single franchisor. Nonetheless, it doesn’t enable different entities to situation or purchase on its behalf, so it scales extra slowly.
Lately, the closed loop networks have partnered with different issuers and acquirers to scale their circulation.
Step 4: The approval or rejection is shipped again to the acquirer, then to the POS terminal.
Why is the bank card referred to as “essentially the most worthwhile product in banks”? How does VISA/Mastercard earn cash?
The diagram under exhibits the economics of the bank card fee movement.
1. The cardholder pays a service provider $100 to purchase a product.
2. The service provider advantages from the usage of the bank card with increased gross sales quantity, and must compensate the issuer and the cardboard community for offering the fee service. The buying financial institution units a price with the service provider, referred to as the “service provider low cost price”
3 – 4. The buying financial institution retains $0.25 because the buying markup, and $1.75 is paid to the issuing financial institution because the interchange price. The service provider low cost price ought to cowl the interchange price.
The interchange price is about by the cardboard community as a result of it’s much less environment friendly for every issuing financial institution to barter charges with every service provider.
5. The cardboard community units up the community assessments and charges with every financial institution, which pays the cardboard community for its companies each month. For instance, VISA fees a 0.11% evaluation, plus a $0.0195 utilization price, for each swipe.
6. The cardholder pays the issuing financial institution for its companies.
Why ought to the issuing financial institution be compensated?
-
The issuer pays the service provider even when the cardholder fails to pay the issuer.
-
The issuer pays the service provider earlier than the cardholder pays the issuer.
-
The issuer has different working prices, together with managing buyer accounts, offering statements, fraud detection, danger administration, clearing & settlement, and many others.
Over to you: Does the cardboard community cost the identical interchange price for large retailers as for small retailers?
An image is price a thousand phrases.
What’s your favourite one? Something lacking?
Thanks for making it this far!
If you wish to be taught extra about System Design, try our books:
Paperback version: https://geni.us/XxCd
Digital version: https://bit.ly/3lg41jK