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
Igor Florian
September 23, 2016
Technology
3
310
Você não está sozinho, vá pra produção com Elixir!
Igor Florian
September 23, 2016
Tweet
Share
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
260
Other Decks in Technology
See All in Technology
MySQLのJSON機能の活用術
ikomachi226
0
140
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
420
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
67k
日本語テキストと音楽の対照学習の技術とその応用
lycorptech_jp
PRO
1
410
今日から始めるAmazon Bedrock AgentCore
har1101
4
380
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
17k
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
150
分析画面のクリック操作をそのままコード化 ! エンジニアとビジネスユーザーが共存するAI-ReadyなBI基盤
ikumi
0
130
システムのアラート調査をサポートするAI Agentの紹介/Introduction to an AI Agent for System Alert Investigation
taddy_919
2
1.6k
【インシデント入門】サイバー攻撃を受けた現場って何してるの?
shumei_ito
0
1.4k
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
2
810
GSIが複数キー対応したことで、俺達はいったい何が嬉しいのか?
smt7174
3
130
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
320
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
240
Chasing Engaging Ingredients in Design
codingconduct
0
110
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Paper Plane (Part 1)
katiecoart
PRO
0
3.9k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
Crafting Experiences
bethany
1
46
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
580
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
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