Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Você não está sozinho, vá pra produção com Elixir!
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Igor Florian
September 23, 2016
Technology
320
3
Share
Você não está sozinho, vá pra produção com Elixir!
Igor Florian
September 23, 2016
More Decks by Igor Florian
See All by Igor Florian
Testando aplicação phoenix
igorffs
1
250
Conceitos que podem te ajudar a escrever testes melhores
igorffs
4
270
Other Decks in Technology
See All in Technology
ストライクウィッチーズ2期6話のエイラの行動が許せないのでPjMの観点から何をすべきだったのかを考える
ichimichi
1
310
さくらのクラウドでつくるCloudNative Daysのオブザーバビリティ基盤
b1gb4by
0
140
ZOZOTOWNリプレイスでのSkills導入までの流れとこれから
zozotech
PRO
4
3.2k
新メンバーのために、シニアエンジニアが環境を作る時代
puku0x
0
200
AIがコードを書く時代の ジェネレーティブプログラミング
polidog
PRO
3
660
さくらのAI Engineから始める クラウドネイティブ意識
melonps
0
120
すごいぞManaged Kubernetes
harukasakihara
1
370
インフラを Excel 管理していた組織が 3 ヶ月で IaC 化されるまで
geekplus_tech
3
160
AI時代に新卒採用、はじめました/junior-engineer-never-die
dmnlk
0
230
制約を設計する - 非決定性との境界線 / Designing constraints
soudai
PRO
6
2.4k
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.3k
AgentCore RuntimeからS3 Filesをマウントしてみる
har1101
3
380
Featured
See All Featured
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
Darren the Foodie - Storyboard
khoart
PRO
3
3.2k
How to train your dragon (web standard)
notwaldorf
97
6.6k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
Making Projects Easy
brettharned
120
6.6k
Bash Introduction
62gerente
615
210k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
500
Everyday Curiosity
cassininazir
0
190
Amusing Abliteration
ianozsvald
1
150
Statistics for Hackers
jakevdp
799
230k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
510
Transcript
Você não está sozinho, vá pra produção com Elixir!
@igorffs @igorflorianfs
None
Deploy
• Ferramentas • Dificuldades • Hot code swap
None
FERRAMENTAS
None
http://www.phoenixframework.org/docs/heroku
♥
Guia estruturado
buildpacks consolidados
https://github.com/HashNuke/heroku-buildpack-elixir
https://github.com/gjaldon/heroku-buildpack-phoenix-static
A opção ➕ rápida ⚡ ➕prática
➖Hot code swap
E se eu quiser ter minha própria infra?
Como o pessoal de Erlang faz deploy?
Existe um Elixir way?
Exrm (Elixir Release Manager)
http://www.phoenixframework.org/docs/advanced-deployment
Wrapper de ferramentas do Erlang
https://github.com/erlang/rebar3
https://github.com/erlware/relx
http://learnyousomeerlang.com/release-is-the-word
Release ==
None
None
é composto por
None
None
Elixir e Erlang estão inclusos!
pode ser independente
Ou não! Você escolhe.
None
Tá, mas por que isso?
Facilidade de distribuição
Sem nos preocupar com a versão instalada
None
Então posso distribuir minha release pra qualquer lugar?
Posso compilar no meu Windows e executar no meu servidor
Linux!!
Obrigado Elixir! ♥
Né?!
Maaaais ou menos… (segura essa emoção )
Cross-compiling
Releases estão presas à arquitetura e S.O
NIFs (Native Implemented Functions)
(snif)
Comofas?
None
None
None
A release contém executáveis
• start • stop • ping • console • remote_console
• upgrade • downgrade
Não existem Mix tasks
Porque não existe um Mix file
Mesmo com Ecto, não poderá executar migrations
http://blog.plataformatec.com.br/2016/04/running-migration-in-an-exrm-release/
Configurações ⚙ com variáveis de ambiente
None
Todo código é compilado durante o build da release
Nos arquivos de configuração, funções são executadas
Todas configurações são compiladas e adicionadas em sys.conf
None
None
Pouco flexível e não é seguro
https://12factor.net/config
E agora José?!
@renanranelli
RELX on the rescue!
None
None
RELX_REPLACE_OS_VARS=true
As tags serão substituídas pelos valores das variáveis de ambiente
na máquina que a release será executada
None
http://blog.plataformatec.com.br/2016/05/how-to-config-environment-variables-with-elixir-and-exrm/
( Distillery ⚗…
https://github.com/bitwalker/distillery
Substituindo Exrm
http://bitwalker.org/posts/2016-07-21-distillery-vs-exrm-vs-relx/
…)
Isso tá parecendo manual
Prefiro Capistrano!
None
https://github.com/boldpoker/edeliver
Gerencia e automatiza o processo de deploy
bash scripts orquestram os builds e RPCs aos servidores
Exrm por baixo dos panos
ou mix + relx
ou rebar (erlang only)
ou Distillery
Quanta coisa, né?
Não se preocupe, edeliver abstrai as ferramentas utilizadas
Deploy em ambientes de staging e production
Você escolhe onde fazer o build da release
Resolve problema de Cross-compiling
Local Build Staging Production
None
None
None
None
None
None
None
http://blog.plataformatec.com.br/2016/06/deploying-elixir-applications-with-edeliver/
Afinal, o que eu uso em produção?
edeliver !
Mas não deixe de conhecer as ferramentas que está usando
Ht code l♥ving
ZERO DOWNTIME
Não é a única forma
Show me the code!!
GenServer
None
None
None
v0.1.0
None
v0.2.0
None
None
None
None
None
O que tá acontecendo?
Code server
Mantém 2 versões do código
Código antigo é executado por processos antigos <
Código novo é executado por processos novos =
http://learnyousomeerlang.com/designing-a-concurrent-application#hot-code-loving
http://erlang.org/doc/man/code.html
Isso parece ser bem simples!
None
Mudança de estado
None
None
None
None
None
None
O código precisa saber como reagir
None
None
Feels like migration
Appups
None
http://learnyousomeerlang.com/relups
É dificil!
Quando usar?
Stateful apps, que não podem parar
Trade-offs @
Comunidade❤
Obrigado! B