How to make your Node.js API 5x faster!

  Рет қаралды 9,352

Adventures in Nodeland - Matteo Collina

Adventures in Nodeland - Matteo Collina

9 ай бұрын

In this video I demostrate how to use the github.com/mcollina/async-cac... module to increase the req/s of Platformatic DB by 5x, while reducing the latency to 1/3. Amazing? You can implement it too!

Пікірлер: 25
@JuliusGrybauskas
@JuliusGrybauskas 9 ай бұрын
Always happy to see these videos!
@adventuresinnodeland
@adventuresinnodeland 7 ай бұрын
More to come!
@programmer-network
@programmer-network 9 ай бұрын
Thank you, Matteo. Will try to implement this in my programmer network Fastify API. Cheers man
@alexenax1109
@alexenax1109 4 ай бұрын
Great new module!
@timibolu
@timibolu 9 ай бұрын
thanks mattteo for this
@khanhney
@khanhney 9 ай бұрын
Nice video, Thank you so much
@adventuresinnodeland
@adventuresinnodeland 7 ай бұрын
Thank you too
@jurajzovinec
@jurajzovinec 9 ай бұрын
Thanks for share this is nice video, still watching videos regarding evolving of Platformtic DB, can't wait to find a project allowing me to my hands on it :) Have you also thought of cache invalidation? Something like creating "relationships" between queries and mutations saying "Hey, if this mutation is running with this movie ID, clear query related object from cache"
@adventuresinnodeland
@adventuresinnodeland 9 ай бұрын
It’s in the roadmap and supported by async-cache-dedupe, we just need to wire it with Platformatic DB.
@alirezanqp
@alirezanqp 9 ай бұрын
Thanks
@ted3309
@ted3309 9 ай бұрын
Good video! Also, can you point or say where you're looking at when you're using "htop" or other fancy tools, because It's hard to follow when you see a tool for the first time.
@adventuresinnodeland
@adventuresinnodeland 9 ай бұрын
Good tip!
@ankit8268
@ankit8268 6 ай бұрын
But you don't have just one api in your web app, if there are 100 apis how many will overlap, moreover the input to the query also need to be same for this to work right, this can decrease the performance as well. Isn't it?
@user-op4hh8le6u
@user-op4hh8le6u 5 ай бұрын
Hey Matteo Collina I have one question which package should we use for caching API. should we need to use async-cache-dedupe or fastify-caching ? because both packages ends up with cahcing data into redis or any in-mem cache
@adventuresinnodeland
@adventuresinnodeland 5 ай бұрын
the latter is lower level and will deduplicate requests.
@user-op4hh8le6u
@user-op4hh8le6u 5 ай бұрын
@@adventuresinnodeland I am not getting can you please describe I am bit confused and by the way you guys are doing great work
@adventuresinnodeland
@adventuresinnodeland 5 ай бұрын
@@user-op4hh8le6u use async-cache-dedupe
@minhhieple6483
@minhhieple6483 9 ай бұрын
Thank you so much, One question, So we should use cache in every query to database, right ?
@adventuresinnodeland
@adventuresinnodeland 9 ай бұрын
Yes, at least for the one that fetched data.
@notaspectator
@notaspectator 9 ай бұрын
definitely not, choose wisely based on profiling and db stats ideally during stage testing
@cx1260
@cx1260 8 күн бұрын
wow
@admiralicic
@admiralicic 6 ай бұрын
Hit the Like in advance, thank you Matteo!
@codewithnws3544
@codewithnws3544 9 ай бұрын
Can we have the link to the repo of that platformic db's github repo or access to the code !
@adventuresinnodeland
@adventuresinnodeland 9 ай бұрын
Here is the file I’m showing in the video github.com/platformatic/platformatic/blob/main/packages/sql-mapper/lib/cache.js
@tusharbarate4973
@tusharbarate4973 4 ай бұрын
Does this only work with promise.all? How about if I send same request out of promise.all? will that also return from cache ?
Do not thrash the Node js event loop
24:52
Adventures in Nodeland - Matteo Collina
Рет қаралды 4,6 М.
Type-safe Fastify
10:51
Adventures in Nodeland - Matteo Collina
Рет қаралды 6 М.
World’s Largest Jello Pool
01:00
Mark Rober
Рет қаралды 102 МЛН
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
Top 7 Ways to 10x Your API Performance
6:05
ByteByteGo
Рет қаралды 320 М.
Redis Caching in Node.js
17:42
Traversy Media
Рет қаралды 228 М.
Mastering Memory Management in Node.js: Tips and Tricks for Better Performance
16:06
Software Developer Diaries
Рет қаралды 30 М.
Generating Types without Climbing a Tree
20:08
Adventures in Nodeland - Matteo Collina
Рет қаралды 1,4 М.
Speed Up Your Node App Using Worker Threads!
6:34
Coding With Chaim
Рет қаралды 22 М.
Interview with Node Congress speaker - Matteo Collina
29:51
Вы так любезны
0:16
KOTVITSKY
Рет қаралды 1,7 МЛН