SlideShare a Scribd company logo
1 of 40
Download to read offline
GoLang:learning
bydoing
Case: Migrating nearly 2 billion documents
@jonatasdp
Goisawesome!
2weeks
experience
Howitstarts?
thechallenge:
migrate~1.8billion
fromamongoserver
toanother
WITHOUTSTOP!
downtime
migrationø
Billionof
documents1.8
200K /MINUTE
1Million /5MIN
20Millions /hour
400Millions /DAY
5daysMIGRATING
weeksexperience2
● syntax
● Basics
● Mgo
● TERMUI
● CLI
Migrationalgorithm
● Twomongoconnections:<origin>and<destiny>
● <origin>receiverecords
● <destiny>insertrecords
● Whenrecordison<destiny>
● Removefrom<origin>
FIRSTTASTE
● STARTWITHOUTTESTS:(
● LEARNINGABOUTREFERENCESVSVARS
● Structsforeverything
● InterfaceComprehension
● GORoutines
● LocksandMutex
● Channels
MGOEXAMPLE
Simpleinsert
MGOEXAMPLE
IsNotgeneric
structs
Structs& Interfaces
Interface{}
"Typecasting"theInterface
GOROUTINES
nowaitgroup=1.2Mrpm
GOROUTINES+waitgroup
= 200krpm
StatelessGOROUTINES
Withchannels
GOROUTINES+channels
Channels
Channels
STRUCTMETHODS
TERMUI
TERMUI
TERMUI colors
CLI
github.com/codegagsta/cli
CLIgithub.com/codegagsta/cli
CLI
WhatIlearned
● simplicity
● naturallyfast
● easytowriteasynccode
● easytomaintain(mongo-migration#1)
OPENSOURCE
https://github.com/ResultadosDigitais/mongo-migration
Thankyou!
http://shipit.resultadosdigitais.com.br
@jonatasdp
http://ideia.me

More Related Content

Viewers also liked

Viewers also liked (12)

Quando descobri que era programador
Quando descobri que era programadorQuando descobri que era programador
Quando descobri que era programador
 
XP - eXtreme Programming - 2010
XP - eXtreme Programming - 2010XP - eXtreme Programming - 2010
XP - eXtreme Programming - 2010
 
ZendFramework2 & Symfony2
ZendFramework2 & Symfony2ZendFramework2 & Symfony2
ZendFramework2 & Symfony2
 
4 ferramentas para acompanhar seu app em produção pelo slack
4 ferramentas para acompanhar seu app em produção pelo slack4 ferramentas para acompanhar seu app em produção pelo slack
4 ferramentas para acompanhar seu app em produção pelo slack
 
Concurrency in Ruby
Concurrency in RubyConcurrency in Ruby
Concurrency in Ruby
 
Tech for non techs
Tech for non techsTech for non techs
Tech for non techs
 
Testes em go
Testes em goTestes em go
Testes em go
 
Testing in go
Testing in goTesting in go
Testing in go
 
Life hacks for productivity
Life hacks for productivityLife hacks for productivity
Life hacks for productivity
 
7Masters jQuery - Eventos em jQuery, com Felquis Gimenes
7Masters jQuery - Eventos em jQuery, com Felquis Gimenes7Masters jQuery - Eventos em jQuery, com Felquis Gimenes
7Masters jQuery - Eventos em jQuery, com Felquis Gimenes
 
Docker na vida real
Docker na vida realDocker na vida real
Docker na vida real
 
Docker: uma visão geral e exemplos de uso
Docker: uma visão geral e exemplos de usoDocker: uma visão geral e exemplos de uso
Docker: uma visão geral e exemplos de uso
 

Similar to Go Lang migrating billions of documents

Identifying Hotspots in Software Build Processes
Identifying Hotspots in Software Build ProcessesIdentifying Hotspots in Software Build Processes
Identifying Hotspots in Software Build Processes
Shane McIntosh
 
ekbpy'2012 - Антон Патрушев - ZeroMQ
ekbpy'2012 - Антон Патрушев - ZeroMQekbpy'2012 - Антон Патрушев - ZeroMQ
ekbpy'2012 - Антон Патрушев - ZeroMQ
it-people
 

Similar to Go Lang migrating billions of documents (20)

Reactive mistakes - ScalaDays Chicago 2017
Reactive mistakes -  ScalaDays Chicago 2017Reactive mistakes -  ScalaDays Chicago 2017
Reactive mistakes - ScalaDays Chicago 2017
 
Creando microservicios con Java MicroProfile y TomEE - OGBT
Creando microservicios con Java MicroProfile y TomEE  - OGBTCreando microservicios con Java MicroProfile y TomEE  - OGBT
Creando microservicios con Java MicroProfile y TomEE - OGBT
 
Barcamp presentation
Barcamp presentationBarcamp presentation
Barcamp presentation
 
Creando microservicios con Java y Microprofile - Nicaragua JUG
Creando microservicios con Java y Microprofile - Nicaragua JUGCreando microservicios con Java y Microprofile - Nicaragua JUG
Creando microservicios con Java y Microprofile - Nicaragua JUG
 
[db tech showcase Tokyo 2017] A11: SQLite - The most used yet least appreciat...
[db tech showcase Tokyo 2017] A11: SQLite - The most used yet least appreciat...[db tech showcase Tokyo 2017] A11: SQLite - The most used yet least appreciat...
[db tech showcase Tokyo 2017] A11: SQLite - The most used yet least appreciat...
 
Creando microservicios con java micro profile y tomee - CUNORI 2020
Creando microservicios con java micro profile y tomee - CUNORI 2020Creando microservicios con java micro profile y tomee - CUNORI 2020
Creando microservicios con java micro profile y tomee - CUNORI 2020
 
Log Management Systems
Log Management SystemsLog Management Systems
Log Management Systems
 
Identifying Hotspots in Software Build Processes
Identifying Hotspots in Software Build ProcessesIdentifying Hotspots in Software Build Processes
Identifying Hotspots in Software Build Processes
 
ekbpy'2012 - Антон Патрушев - ZeroMQ
ekbpy'2012 - Антон Патрушев - ZeroMQekbpy'2012 - Антон Патрушев - ZeroMQ
ekbpy'2012 - Антон Патрушев - ZeroMQ
 
Learn TypeScript from scratch
Learn TypeScript from scratchLearn TypeScript from scratch
Learn TypeScript from scratch
 
Paper_An Efficient Garbage Collection in Java Virtual Machine via Swap I/O O...
Paper_An Efficient Garbage Collection in Java Virtual  Machine via Swap I/O O...Paper_An Efficient Garbage Collection in Java Virtual  Machine via Swap I/O O...
Paper_An Efficient Garbage Collection in Java Virtual Machine via Swap I/O O...
 
How to build TiDB
How to build TiDBHow to build TiDB
How to build TiDB
 
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUGCreando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
 
Serverless for High Performance Computing
Serverless for High Performance ComputingServerless for High Performance Computing
Serverless for High Performance Computing
 
Lrz kurs: big data analysis
Lrz kurs: big data analysisLrz kurs: big data analysis
Lrz kurs: big data analysis
 
Killer Bugs From Outer Space
Killer Bugs From Outer SpaceKiller Bugs From Outer Space
Killer Bugs From Outer Space
 
Serverless for High Performance Computing
Serverless for High Performance ComputingServerless for High Performance Computing
Serverless for High Performance Computing
 
3 Flink Mistakes We Made So You Won't Have To
3 Flink Mistakes We Made So You Won't Have To3 Flink Mistakes We Made So You Won't Have To
3 Flink Mistakes We Made So You Won't Have To
 
萬事萬物皆是 LOG - 系統架構也來點科普
萬事萬物皆是 LOG - 系統架構也來點科普萬事萬物皆是 LOG - 系統架構也來點科普
萬事萬物皆是 LOG - 系統架構也來點科普
 
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
Kubernetes Native Java and Eclipse MicroProfile | EclipseCon Europe 2019
 

More from Jônatas Paganini

More from Jônatas Paganini (9)

Extracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated applicationExtracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated application
 
Onboarding developers on a ful remote environment
Onboarding developers on a ful remote environmentOnboarding developers on a ful remote environment
Onboarding developers on a ful remote environment
 
TDC Floripa 2018 Dev Tests - weak specs
TDC Floripa 2018 Dev Tests - weak specsTDC Floripa 2018 Dev Tests - weak specs
TDC Floripa 2018 Dev Tests - weak specs
 
Floripa on Rails - dev workflow
Floripa on Rails - dev workflowFloripa on Rails - dev workflow
Floripa on Rails - dev workflow
 
ø Downtime migrations - Ruby Conf 2015
ø Downtime migrations  - Ruby Conf 2015ø Downtime migrations  - Ruby Conf 2015
ø Downtime migrations - Ruby Conf 2015
 
Tdc cloud computing - RDStation experiences
Tdc cloud computing - RDStation experiencesTdc cloud computing - RDStation experiences
Tdc cloud computing - RDStation experiences
 
Life hacks for productivity
Life hacks for productivityLife hacks for productivity
Life hacks for productivity
 
Dicas para uma boa impressão 3D
Dicas para uma boa impressão 3DDicas para uma boa impressão 3D
Dicas para uma boa impressão 3D
 
ø Downtime migrations
ø Downtime migrationsø Downtime migrations
ø Downtime migrations
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Go Lang migrating billions of documents