Slide 1

Slide 1 text

USING NODE JS WORKER THREADS Srushtika Neelakantam | DevFest Live 2021

Slide 2

Slide 2 text

Developer Relations and Partner Engineer I’m @Srushtika

Slide 3

Slide 3 text

b @Srushtika | @ablyrealtime | @DevFestLive

Slide 4

Slide 4 text

PEER TO PEER STRATEGY @Srushtika | @ablyrealtime | @DevFestLive player1 player2 player3 player4 player5 O(n2) time complexity

Slide 5

Slide 5 text

CLIENT/SERVER STRATEGY server player1 player2 player3 @Srushtika | @ablyrealtime | @DevFestLive O(n) time complexity

Slide 6

Slide 6 text

b @Srushtika | @ablyrealtime | @DevFestLive

Slide 7

Slide 7 text

b @Srushtika | @ablyrealtime | @DevFestLive

Slide 8

Slide 8 text

HTTP @Srushtika | @ablyrealtime | @DevFestLive vs WEBSOCKETS

Slide 9

Slide 9 text

PUBLISH/ SUBSCRIBE PATTERN P.S. This is an old gif, Ably has moved on to new branding now @Srushtika | @ablyrealtime | @DevFestLive FEATURES ● Presence ● Message History ● Integrations . . . INFRASTRUCTURE ● Auto reconnection ● Scale ● Guaranteed delivery ● Message ordering . . .

Slide 10

Slide 10 text

PUBLISHING THE GAME STATE @Srushtika | @ablyrealtime | @DevFestLive

Slide 11

Slide 11 text

b @Srushtika | @ablyrealtime | @DevFestLive

Slide 12

Slide 12 text

NODE.JS GAME SERVER @Srushtika | @ablyrealtime | @DevFestLive

Slide 13

Slide 13 text

KEY ELEMENTS THAT MAKE NODE JS WORK NODE JS The chrome v8 engine converts JavaScript to machine readable code The libuv library provides and manages the event loop and thread pool @Srushtika | @ablyrealtime | @DevFestLive

Slide 14

Slide 14 text

“What the heck is the event loop anyway” by Philip Roberts (JSConfEU on YouTube) @Srushtika | @ablyrealtime | @DevFestLive

Slide 15

Slide 15 text

—VARIOUS PEOPLE ON THE INTERNETS “Node.js is a CPU bottleneck due to its single-threaded nature. That’s one of its major drawbacks” @Srushtika | @ablyrealtime | @DevFestLive

Slide 16

Slide 16 text

The answer? @Srushtika | @ablyrealtime | @DevFestLive

Slide 17

Slide 17 text

NODE JS WORKER THREADS ARCHITECTURE Credits: The NodeSource Blog @Srushtika | @ablyrealtime | @DevFestLive

Slide 18

Slide 18 text

@Srushtika | @ablyrealtime | @DevFestLive

Slide 19

Slide 19 text

CREDITS: This presentation template was created by Slidesgo, including icons by Flaticon, and infographics & images by Freepik THANKS! Do you have any questions? @Srushtika | @ablyrealtime | @DevFestLive