SlideShare une entreprise Scribd logo
1  sur  52
Télécharger pour lire hors ligne
yo-ho-ho
Hello I’m
Alexey
Алексей Осипенко
cimon.io
«Эликсир счастья»
Эликсир на сервере
или
/README.md
Нет смысла пересказывать
cimon.io
cimon.io
с докеромЭликсир
cimon.io
с докеромЭликсир
это
cimon.io
с докеромЭликсир
как без
докера
это
cimon.io
с докеромЭликсир
с докером
только с
как без
докера
это
cimon.io
Козу вверх
кто любит
эликсир
cimon.io
Козу вверх
кто любит эликсир
cimon.io
Козу вверх
кто любит эликсир
cimon.io
Эликсир не панацея
cimon.io
не элексирЭликсир
Но ведь, можно же!
Не стоит деплоить с горячей заменой кода
Но ведь, можно же!
Не стоит деплоить с горячей заменой кода
Можно, но не стоит
cimon.io
Используется на боевом сервере
Сейчас эликсир-приложение
cimon.io
Справляется отлично
И, знаете, сервер
со всеми задачами!
cimon.io
Развертывание на сервере
Но вот
не такое радужное
cimon.io
Конечно же,
заслуга эликсира –
это эрланг
cimon.io
BEAM
А заслуга эрланга – это его
cimon.io
все является процессами,
а «процесс» – это актор
В эрланге
cimon.io
Снаружи
И процесс
выглядит как
черный ящик
Снаружи
мы ничего не знаем про
текущее состояние
cimon.io
Внутри
черный ящик превращается в
замкнутое пространство
Внутри
приходит
извне
параметрами
состояние
cimon.io
хранение данных управляется
виртуальной машиной,
а не акторами
В итоге,
cimon.io
Чистые функции
А внутри акторов у нас
cimon.io
Чистые вызовы функций
А у программиста снаружи используются
умирать весело
как концепт, говорят нам,
Акторы,
что
001 002 003004 005006
Совершенно неважно есть ли актор прямо сейчас
или не нужно заботиться о том, чтобы актор жил
cimon.io
можно поднять новый актор, а старый убить
Данные хранятся в BEAM, поэтому
006 007
Данные
006 007
Данные
cimon.io
проблема?
Может быть есть какая-нибудь
cimon.io
Миграция состояния
данных актора — серьезная
проблема
006 007
данные
Мы хотим, чтобы
подходили одинаково хорошо
для всех версий акторов
данные
А в итоге
нужны разные.
Наш актор а после обновления
был рокер,
стал хиппи
Миграция данных
не автоматизируется
И в общем случае
пишется вручную
для всех релизов
cimon.io
Не стоит деплоить с горячей заменой кода
Вывод, который был сделан:
cimon.io
по делу
Теперь давайте
обсудим
существующие решения
Процесс релиза
прост, как столб
/README.md
И описан
чтение ENV переменных
происходит
на этапе компиляции
CONFIG.EXS
cimon.io
Ubuntu
Проблема межплатформенной компиляции.
MacOS,
То, что компилировалось под
не запустится под
cimon.io
Проблема
миграций
базы данных
cimon.io
Проблема
миграций
базы данных
cimon.io
> _build/production/rel/vault8/bin/vault8 command
'Elixir.Vault8.Release.Tasks' migrate
The Twelve Factors
Config in the environment
Stateless processes
Dev/prod as similar as possible
Admin processes
несоблюдение
Тотальное
cimon.io
Платформа билда и запуска должны совпадать
Процесс релиза затрагивает все акторы
Процесс релиза уникален для системы
Четыре бочки дегтяв итоге имеем
Сервисы снаружи никак не управляемы
cimon.io
Все будет хорошо.
Но не стоит расстраиваться.
Эликсир молод, горяч
активно развивается
и
и
alexey@cimon.io
Спасибо
за
внимание
telegram@aratak
alexey.osipenko@fb.me
https://t.me/itextrapolation

Contenu connexe

Plus de Elixir Club

Promo Phx4RailsDevs - Volodya Sveredyuk
Promo Phx4RailsDevs - Volodya SveredyukPromo Phx4RailsDevs - Volodya Sveredyuk
Promo Phx4RailsDevs - Volodya SveredyukElixir Club
 
Web of today — Alexander Khokhlov
Web of today —  Alexander KhokhlovWeb of today —  Alexander Khokhlov
Web of today — Alexander KhokhlovElixir Club
 
ElixirConf Eu 2018, what was it like? – Eugene Pirogov
ElixirConf Eu 2018, what was it like? – Eugene PirogovElixirConf Eu 2018, what was it like? – Eugene Pirogov
ElixirConf Eu 2018, what was it like? – Eugene PirogovElixir Club
 
Implementing GraphQL API in Elixir – Victor Deryagin
Implementing GraphQL API in Elixir – Victor DeryaginImplementing GraphQL API in Elixir – Victor Deryagin
Implementing GraphQL API in Elixir – Victor DeryaginElixir Club
 
WebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan WintermeyerWebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan WintermeyerElixir Club
 
GenServer in Action – Yurii Bodarev
GenServer in Action – Yurii Bodarev   GenServer in Action – Yurii Bodarev
GenServer in Action – Yurii Bodarev Elixir Club
 
Russian Doll Paradox: Elixir Web without Phoenix - Alex Rozumii
Russian Doll Paradox: Elixir Web without Phoenix - Alex RozumiiRussian Doll Paradox: Elixir Web without Phoenix - Alex Rozumii
Russian Doll Paradox: Elixir Web without Phoenix - Alex RozumiiElixir Club
 
Practical Fault Tolerance in Elixir - Alexei Sholik
Practical Fault Tolerance in Elixir - Alexei SholikPractical Fault Tolerance in Elixir - Alexei Sholik
Practical Fault Tolerance in Elixir - Alexei SholikElixir Club
 
Phoenix and beyond: Things we do with Elixir - Alexander Khokhlov
Phoenix and beyond: Things we do with Elixir - Alexander KhokhlovPhoenix and beyond: Things we do with Elixir - Alexander Khokhlov
Phoenix and beyond: Things we do with Elixir - Alexander KhokhlovElixir Club
 
Monads are just monoids in the category of endofunctors - Ike Kurghinyan
Monads are just monoids in the category of endofunctors - Ike KurghinyanMonads are just monoids in the category of endofunctors - Ike Kurghinyan
Monads are just monoids in the category of endofunctors - Ike KurghinyanElixir Club
 
Craft effective API with GraphQL and Absinthe - Ihor Katkov
Craft effective API with GraphQL and Absinthe - Ihor KatkovCraft effective API with GraphQL and Absinthe - Ihor Katkov
Craft effective API with GraphQL and Absinthe - Ihor KatkovElixir Club
 
Elixir in a service of government - Alex Troush
Elixir in a service of government - Alex TroushElixir in a service of government - Alex Troush
Elixir in a service of government - Alex TroushElixir Club
 
Pattern matching in Elixir by example - Alexander Khokhlov
Pattern matching in Elixir by example - Alexander KhokhlovPattern matching in Elixir by example - Alexander Khokhlov
Pattern matching in Elixir by example - Alexander KhokhlovElixir Club
 
Ecto and Phoenix: Doing web with Elixir - Yurii Bodarev
Ecto and Phoenix: Doing web with Elixir - Yurii BodarevEcto and Phoenix: Doing web with Elixir - Yurii Bodarev
Ecto and Phoenix: Doing web with Elixir - Yurii BodarevElixir Club
 
Handling external APIs with Elixir - Alex Rozumii
Handling external APIs with Elixir - Alex RozumiiHandling external APIs with Elixir - Alex Rozumii
Handling external APIs with Elixir - Alex RozumiiElixir Club
 
Public Elixir in a service of government - Alex Troush
Public Elixir in a service of government - Alex TroushPublic Elixir in a service of government - Alex Troush
Public Elixir in a service of government - Alex TroushElixir Club
 
How I did create Telegram bot - Roman Senin
How I did create Telegram bot - Roman SeninHow I did create Telegram bot - Roman Senin
How I did create Telegram bot - Roman SeninElixir Club
 
Designing scalable application: from umbrella project to distributed system -...
Designing scalable application: from umbrella project to distributed system -...Designing scalable application: from umbrella project to distributed system -...
Designing scalable application: from umbrella project to distributed system -...Elixir Club
 
Deploying Elixir/Phoenix with Distillery - Yaroslav Martsynuyk
Deploying Elixir/Phoenix with Distillery - Yaroslav MartsynuykDeploying Elixir/Phoenix with Distillery - Yaroslav Martsynuyk
Deploying Elixir/Phoenix with Distillery - Yaroslav MartsynuykElixir Club
 
Erlang Common tests - Sergey Bondarchuk
Erlang Common tests  - Sergey BondarchukErlang Common tests  - Sergey Bondarchuk
Erlang Common tests - Sergey BondarchukElixir Club
 

Plus de Elixir Club (20)

Promo Phx4RailsDevs - Volodya Sveredyuk
Promo Phx4RailsDevs - Volodya SveredyukPromo Phx4RailsDevs - Volodya Sveredyuk
Promo Phx4RailsDevs - Volodya Sveredyuk
 
Web of today — Alexander Khokhlov
Web of today —  Alexander KhokhlovWeb of today —  Alexander Khokhlov
Web of today — Alexander Khokhlov
 
ElixirConf Eu 2018, what was it like? – Eugene Pirogov
ElixirConf Eu 2018, what was it like? – Eugene PirogovElixirConf Eu 2018, what was it like? – Eugene Pirogov
ElixirConf Eu 2018, what was it like? – Eugene Pirogov
 
Implementing GraphQL API in Elixir – Victor Deryagin
Implementing GraphQL API in Elixir – Victor DeryaginImplementing GraphQL API in Elixir – Victor Deryagin
Implementing GraphQL API in Elixir – Victor Deryagin
 
WebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan WintermeyerWebPerformance: Why and How? – Stefan Wintermeyer
WebPerformance: Why and How? – Stefan Wintermeyer
 
GenServer in Action – Yurii Bodarev
GenServer in Action – Yurii Bodarev   GenServer in Action – Yurii Bodarev
GenServer in Action – Yurii Bodarev
 
Russian Doll Paradox: Elixir Web without Phoenix - Alex Rozumii
Russian Doll Paradox: Elixir Web without Phoenix - Alex RozumiiRussian Doll Paradox: Elixir Web without Phoenix - Alex Rozumii
Russian Doll Paradox: Elixir Web without Phoenix - Alex Rozumii
 
Practical Fault Tolerance in Elixir - Alexei Sholik
Practical Fault Tolerance in Elixir - Alexei SholikPractical Fault Tolerance in Elixir - Alexei Sholik
Practical Fault Tolerance in Elixir - Alexei Sholik
 
Phoenix and beyond: Things we do with Elixir - Alexander Khokhlov
Phoenix and beyond: Things we do with Elixir - Alexander KhokhlovPhoenix and beyond: Things we do with Elixir - Alexander Khokhlov
Phoenix and beyond: Things we do with Elixir - Alexander Khokhlov
 
Monads are just monoids in the category of endofunctors - Ike Kurghinyan
Monads are just monoids in the category of endofunctors - Ike KurghinyanMonads are just monoids in the category of endofunctors - Ike Kurghinyan
Monads are just monoids in the category of endofunctors - Ike Kurghinyan
 
Craft effective API with GraphQL and Absinthe - Ihor Katkov
Craft effective API with GraphQL and Absinthe - Ihor KatkovCraft effective API with GraphQL and Absinthe - Ihor Katkov
Craft effective API with GraphQL and Absinthe - Ihor Katkov
 
Elixir in a service of government - Alex Troush
Elixir in a service of government - Alex TroushElixir in a service of government - Alex Troush
Elixir in a service of government - Alex Troush
 
Pattern matching in Elixir by example - Alexander Khokhlov
Pattern matching in Elixir by example - Alexander KhokhlovPattern matching in Elixir by example - Alexander Khokhlov
Pattern matching in Elixir by example - Alexander Khokhlov
 
Ecto and Phoenix: Doing web with Elixir - Yurii Bodarev
Ecto and Phoenix: Doing web with Elixir - Yurii BodarevEcto and Phoenix: Doing web with Elixir - Yurii Bodarev
Ecto and Phoenix: Doing web with Elixir - Yurii Bodarev
 
Handling external APIs with Elixir - Alex Rozumii
Handling external APIs with Elixir - Alex RozumiiHandling external APIs with Elixir - Alex Rozumii
Handling external APIs with Elixir - Alex Rozumii
 
Public Elixir in a service of government - Alex Troush
Public Elixir in a service of government - Alex TroushPublic Elixir in a service of government - Alex Troush
Public Elixir in a service of government - Alex Troush
 
How I did create Telegram bot - Roman Senin
How I did create Telegram bot - Roman SeninHow I did create Telegram bot - Roman Senin
How I did create Telegram bot - Roman Senin
 
Designing scalable application: from umbrella project to distributed system -...
Designing scalable application: from umbrella project to distributed system -...Designing scalable application: from umbrella project to distributed system -...
Designing scalable application: from umbrella project to distributed system -...
 
Deploying Elixir/Phoenix with Distillery - Yaroslav Martsynuyk
Deploying Elixir/Phoenix with Distillery - Yaroslav MartsynuykDeploying Elixir/Phoenix with Distillery - Yaroslav Martsynuyk
Deploying Elixir/Phoenix with Distillery - Yaroslav Martsynuyk
 
Erlang Common tests - Sergey Bondarchuk
Erlang Common tests  - Sergey BondarchukErlang Common tests  - Sergey Bondarchuk
Erlang Common tests - Sergey Bondarchuk
 

Deploying Elixir application - Alexey Osipenko