Erick Wendel Profile picture
Dec 2 7 tweets 4 min read
How to consume any Database as a Stream for heavy data processing using JavaScript 🤯🔥

🧵/1

#javascript #nodejs #streams #sql #nosql #tutorial #dataprocessing #database #business #data #strategy #pipeline @nodejs
The secret for processing anything using JavaScript is to handle data on demand.

Imagine data you wanna migrate data from a SQL database to a NoSQL DB. You would need to apply some business rules, clean up fields, filter data and then output them to the final output.

/2
You might know that you can block the Node.js (and the data source you're consuming) if you handle too much data at once in memory

The best practice then is to limit results, send individual data to a stream pipeline, and then ask for more data until you've consumed it all.

/3
In Node.js you can now use async generators as a data source. This is game-changing for those who really need to use JavaScript to process terabytes of data if needed.

/4
I've seen people installing packages and struggling to consume data as Streams - and I'm not speaking only about databases

This strategy applies to anything. Is it a file? Database? External API? You can handle them using Node.js if you keep in mind to process them on demand

/5
I have a good video on my Youtube channel where I show how you can throttle data to respect 3rd-party-API limits and this might also help you a lot on heavy tasks using Node.js.



/6
How about you, how would you migrate terabytes of data from one source to another using JavaScript?

/7

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Erick Wendel

Erick Wendel Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @erickwendel_

Dec 1
O Aniversário do JavaScript vem aiiiiiiiiiii!! dia 04/12 a linguagem faz 27 ANOS 🤯😬

🧵/1

#javascript #jsexpert #devlife #100daysofcode #nodejs #advancedjs #devspecialist
Nem imagino como era programar nos anos 2000 ou mesmo antes de 2015, ano onde a especificação ECMAScript deu um salto gigantesco, que colocou o JavaScript no mapa das linguagens mais usadas no mundo inteiro.

/2
O que vejo até hoje é que, mesmo com o crescimento absurdo da popularidade e infinidades de casos de uso, pouca gente se concentra nos fundamentos da linguagem.

/3
Read 9 tweets
Nov 24
WOWWWWWW 🇧🇷 Mais uma matéria contando a minha história sobre como resolvi um bug crítico no Node.js que afetou milhares de pessoas no mundo inteiro 🤩🥳

#daZLParaOMundo

🧵/1
A materia saiu no portal @clientesa e lá eles contam um resumo sobre como encontrei o problema, de onde vim e os frutos que este trabalho tem me dado.

/2
"O trabalho de Erick neste caso o levou como destaque para eventos de importância mundial para desenvolvedores, incluindo o Open JS World 2022 em Austin nos Estados Unidos, o Node.TLV em Israel e o JSConf Korea na Coreia do Sul em Setembro em Seul."

/3
Read 7 tweets
Nov 22
E hoje é dia de exterminar mais uma confusão frequente: Você é back ou frontend? Eu sou Dev JavaScript 🤯🤩

🧵/1

#nodejs #javascript #webinar #tutorial #devlife #100daysofcode #frontend #html Image
Hoje, dia 22/11 às 19hrs vou fazer uma super live lá no canal para contar sobre lições importantes do @nodejs que você pode também usar no navegador (ou em qualquer outro lugar que roda JS)

/2
Eu recebo frequentemente dúvidas sobre alguns conteúdos do meu canal e treinamentos, algo como "ah, mas sou frontend, seu conteúdo de @nodejs é para backend"

A verdade, é a JS é uma só, tudo que tem na JS do navegador, tem no JavaScript do Node.js, #Bun e @deno_land

/3
Read 6 tweets
Nov 16
E olha que louco! Hackeei um jogo feito em JavaScript para receber comandos via Web Socket do giroscópio meu celular e ainda brinquei com @TensorFlow Machine learning na parada 😬

/1 🧵

#tensorflow #javascript #duckhunt #hacking #creativeprogramming #100daysofcode
Ah e não é só isso! Estou usando Machine Learning com @TensorFlow para entender quanto ocorre um gesto de “tiro” a partir dos meus sensores e enviar ao jogo.

/2
Muuuuito doido não? Vamos ver até onde vou nessa brincadeira 😆

Agora é melhorar esse modelo do TensorFlow e dar uma tunada em performance 💚

/3
Read 5 tweets
Aug 24
wowwww look at those new functions meant to help us consume @Nodejs Streams as JSON, text, blob, and much more! 😱🎉

🧵 /1
The Node.js project is on fire! Every day we see new functions, new shortcuts, and design improvements.

The Node.js project has been receiving a lot of new utility functions and this new set will help us save time when working with Node.js Streams

/2
Now Node.js itself will consume the whole data stream for you and then try parsing to the chosen format

Thanks to @jasnell for implementing it! 🤩

In the image below, I'm reading data from a file, but it'd also work for Web APIs, Net Sockets, Strings, Buffers, and much more

/3
Read 6 tweets
Aug 23
Fiiiiiiinaly we have a native solution to catch CLI arguments in @nodejs🔥😱

🧵 /1 Image
There was a long discussion on how many existing npm packages were made to parse CLI args and why the Node.js project hasn't had any native solution yet.

/2
You may have heard of existing packages that are very popular around there to make CLI programs such as commander, yargs and this new function came with interesting ideas.

/3
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(