Coder Social home page Coder Social logo

youtube-clone's Introduction

Debouncing:

typing slow = 200ms typing fast = 30ms

Perfomance:

iphone pro max = 14 letter _ 1000 = 140000

with debouncing = 3 API calls _ 1000 = 3000

Debouncing with 200ms

if difference between 2 key strokes is <200ms - DECLINE API call 200ms make an API call

Cache: time complexity tro search in array = O(n) time complexity tro search in Object = O(1)

[i, ip, iph, iphone]

{ i: ip: iph: iphone: }

new Map();

Live Data Implementation :

Challenges to handle LIVE DATA

  1. DL(Data Layer) : Get the live DATA

  2. UL(UI Layer) : Update the UI

There are two ways to handle Live Data

**In Live chat applications You always have "WEBSOCKETS"

1. Web Sockets : UI < ==== > (no regular INTERVAL) SERVER

***Websocket connection is heavy

Two servers connect to each other now they can send data any time to each other initial setup takes a time once setup is done is like handshake

Once the connection is established you can send data in any direction whenever you want to (its a Bidirectional flow)

eg. Time Critical App's they need real time data :  Trading App's (like, Kite, Binance, Grow), WhatsApp

2. API POLLING is also called LONG POLLING : UI(Requests) < === (INTERVAL) SERVER

Data flow's from SERVER to UI. It's one directional after an Interval

eg. Gmail, Cricbuzz(sweetSpot : 25 seconds )

youtube-clone's People

Contributors

bhaveshwagh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.