Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Practical Elixir

Practical Elixir

Arnaud Wetzel, co-founder Shopping Adventure presented us the usage of Elixir inside of his company.

erlang.paris

June 29, 2015
Tweet

More Decks by erlang.paris

Other Decks in Technology

Transcript

  1. PRACTICAL ELIXIR PRACTICAL ELIXIR PRACTICAL ELIXIR PRACTICAL ELIXIR PRACTICAL ELIXIR

    PRACTICAL ELIXIR PRACTICAL ELIXIR PRACTICAL ELIXIR PRACTICAL ELIXIR PRACTICAL ELIXIR PRACTICAL ELIXIR PRACTICAL ELIXIR PRACTICAL ELIXIR PRACTICAL ELIXIR PRACTICAL ELIXIR PRACTICAL ELIXIR Arnaud Wetzel, co-founder Shopping Adventure
  2. INTRODUCTION Shopping Adventure connects physical shops Microservices Java/C/Python/Ruby/Clojure/Erlang/Elixir Erlang :

    stateful services, microservices inside, simple and available Elixir additions ? Syntax ? really ? Macros ? `parse_transform` Tools ? Erlang ecosystem is more mature and stable Feedback : productivity, flexibility, the whole experience This presentation is a feeback
  3. PROJECT Mall e-commerce website : nice UI to quickly fill

    a cart with mall shops products and buy them, then organize pick up or delivery. Backend Magic: construct data set from nothing, or very bad inputs Backend magic: handle heterogeneous processes, connect retailer software, synchronize teams
  4. PROJECT Bad input dataset Format / Augment / Filter /

    Merge / Join Heterogeneous providers Local micro services Heterogeneous order workflows Transactional order changes Connect non technical partners APIfy websites and emails UI == eternal nightmare Small team == well partitioned jobs
  5. OUR OWN ECOSYSTEM Hex.pm: Open repository is the future (before

    the chaos) HTTP DSL: Ewebmachine Data Mashup: ADAP Service Aggregation: EXOS/node_erlastic/python_erlastic/clojure_erlastic Mail destructuring/structuring: Mailibex State Distribution: Supervisorring FSM definition: ExFSM Rules as matches: ExRules Dev env: neovim-elixir
  6. UI UI : Webflow (0LOC) UI state/cache : reaxt/jsxz (900LOC)

    HTTP API : Ewebmachine (350LOC) Cache : ets/riak (50LOC) Service clients : httpc (300LOC)
  7. ORDER MANAGEMENT DHT distributed order transactions as FSM Core: transactors

    and models (350LOC) Order adapter for incomplete order (70LOC) FSM Selector rules (20LOC) Processes specification as FSM (500LOC) Service clients/adapters : clojure/python/http (500LOC)
  8. WEBSITE AUTOMATION Distributed Selenium sessions Clojure Port/GenServer to talk to

    selenium Elixir is used to maintain and supervise sessions, and route then to free browsers
  9. DATA MANAGEMENT Ruby workflows / python / c / etc.

    Our new approach, Elixir to pipe them all Distribute multi-language services and state : image caches / RDBS / machine learning models on dedicated nodes Query your entire dataset to create a new one Stream data entities accross the cluster hoping from one node to another when remote data is needed Data sink node will reorder and join entities with a buffer queue Augmentation rules (1000LOC)
  10. ELIXIR: FLEXIBLE MODULE Organize your code Generate your functions (ex:

    riak_search stop words) Compile your spec (ex: mailibex mime type)
  11. ELIXIR: FLEXIBLE DSL Make code matches your business if it

    does not match functionnal abstractions ex: Rule system, HTTP, FSM system
  12. CONCLUSION Overall Elixir productivity seems to beat erlang in our

    experience Language is now stable The community is very active Library are more up to date Diversity of developers using it in France ?
  13. QUESTIONS ? QUESTIONS ? QUESTIONS ? QUESTIONS ? QUESTIONS ?

    QUESTIONS ? QUESTIONS ? QUESTIONS ? QUESTIONS ? QUESTIONS ? QUESTIONS ? QUESTIONS ? QUESTIONS ? QUESTIONS ? QUESTIONS ? QUESTIONS ?