Elixir Wizards S3E4: Justin Schneck and Frank Hunleth on Nerves and Performance

https://podcast.smartlogic.io/s3e4-schneck-hunleth-nerves

Say NO! to montrous Avro schemas

From the very beginning, this library was heavily inspired by avro_turf simplicity and features. Now it’s time to say – Avrora moves one step closer to the feature set avro_turf provides.

The must-have feature inter-schema references comes to Avrora. Now you can split your huge schema into smaller pieces and glue them together via references.

What is a reference?

Reference is a canonical full name of a schema. Accordingly to Avrora name to location rules if you have schema under io/confluent/Message.avsc its full name (namespace + name) will be io.confluent.Message.

How do references work?

Technically Avro specification doesn’t support inter-schema references, only local-schema references. Because of this limitation, inter-schema references implemented via embedding referenced schema into the schema which contains reference and replacing all other references within this schema with local-references.

How to use references?

For example, you have a Messenger schema which contains references to the Message schema:

priv/schemas/io/confluent/Messenger.avsc

{
  "type": "record",
  "name": "Messenger",
  "namespace": "io.confluent",
  "fields": [
    {
      "name": "inbox",
      "type": {
        "type": "array",
        "items": "io.confluent.Message"
      }
    },
    {
      "name": "archive",
      "type": {
        "type": "array",
        "items": "io.confluent.Message"
      }
    }
  ]
}

priv/schemas/io/confluent/Message.avsc

{
  "type": "record",
  "name": "Message",
  "namespace": "io.confluent",
  "fields": [
    {
      "name": "text",
      "type": "string"
    }
  ]
}

Final compiled schema which will be stored and registered in the Confluent Schema Registry, will looks like this:

{
  "type": "record",
  "name": "Messenger",
  "namespace": "io.confluent",
  "fields": [
    {
      "name": "inbox",
      "type": {
        "type": "array",
        "items": {
          "type": "record",
          "name": "Message",
          "fields": [
            {
              "name": "text",
              "type": "string"
            }
          ]
        }
      }
    },
    {
      "name": "archive",
      "type": {
        "type": "array",
        "items": "Message"
      }
    }
  ]
}

⚠️ In case of avro_turf field archive will keep its canonical items type reference io.confluent.Message instead of local reference Message.

How to Use Broadway in Your Elixir Application

Discover how Broadway can help you create highly concurrent data processing pipelines in your Elixir app.

https://blog.appsignal.com/2019/12/12/how-to-use-broadway-in-your-elixir-application.html

Shameless plug: Check out @elixirstatus' other community project:

Credo, a new static code analysis tool that acts as a code linter, but also focusses on teaching coding practices and code consistency.

Stream.iterate and Advent of Code Day 1

I made a short screencast about the Advent of Code (day 1), and how to solve it entirely in IEx.

2019 is my first year checking it out, and it’s interesting to see everyone else’s solutions on Github. One of my favorites was Sasa Juric’s solution, which used &Stream.iterate/2 to do the recursion necessary in the 2nd part of the problem.

https://www.alchemist.camp/episodes/stream-iterate-aoc-2019-1

Survey of Cowboy Webserver Performance

In this series of articles we benchmark the performance of Cowboy. Then we analyze the root cause of performance degradation in Cowboy 2. We point to some solutions and show their effect on the test results.

Part 1

Part 2

ElixirMix Podcast 081: Discussing Deployment

In this episode of ElixirMix, we talk together about Docker, multi-stage Docker builds, options for deployment, some pitfalls to avoid, benefits of releases, running migrations, live upgrades, how nerves does it, and much more!

Podcast Episode

Deploy an Elixir application on Clever Cloud PaaS

Elixir deployment if officially supported on Clever Cloud, just one git push away.

https://www.clever-cloud.com/blog/features/2019/12/05/elixir-phoenix/

Elixir Processes: Spawn, Send, and Receive

All of OTP is built on a handful of process primitives. In this article, we’ll explore three in particular – spawn, send, and receive – to see how they work together.

https://samuelmullen.com/articles/elixir-processes-send-and-receive/

Where do I put startup code in Elixir?

This blog post examines the common places people put startup code in Elixir and the pros and cons associated with each.

https://moosecode.nl/blog/where-do-i-put-startup-code-in-elixir

Shameless plug: Check out @elixirstatus' other community project:

Credo, a new static code analysis tool that acts as a code linter, but also focusses on teaching coding practices and code consistency.

Introduction to Phoenix LiveView LiveComponents

LiveComponents is a great new feature in Phoenix LiveView. Learn the basics with complete examples.

http://blog.pthompson.org/liveview-livecomponents-introduction

The Big Elixir 2019 Talks

All 12 of the talks from The Big Elixir 2019 are now up on our YouTube channel for all to enjoy!

Check them out and see the awesome things we learned about this year:

https://www.youtube.com/channel/UCInJUDVff2bzZSrkDRUCOdA/videos

Broadway, RabbitMQ, and the Rise of Elixir Part 2

Learn how to use RabbitMQ along side Broadway to create a power data processing pipeline and see how Elixir and Erlang have been trending over time on HackerNews!

https://akoutmos.com/post/broadway-rabbitmq-and-the-rise-of-elixir-two/

RabbitMQ Dashboard

ELixir Tips Journal - Add Free

🎉 Just Launched Killer Elixir Tips Journal .🎉

Discover it here -> https://elixir-tips.blackode.in

It is still in beta but you can feel the code highlighting. 👍

It is a minimal Design focused on code highlighting and Elixir matter.

The Elixir Tips articles from https://medium.com/blackode are now available at https://elixir-tips.blackode.in as well.

Feel free to visit…

Happy Coding :)

LiveView and StatesLanguage

A simple example of utilizing the StatesLanguage library with Phoenix LiveView for a multi-step forms, https://github.com/entone/states_language_live_view

Installing Elixir on Windows with WSL 2

New Windows 10 features allow you to easily install Linux as a development environment. Save yourself from the woes of —werl flags, figuring out how to use PowerShell commands, and dealing with unsupported libraries. Saved myself from a ton of pain.

https://aaronwestbrook.com/installing-elixir-on-windows-with-wsl-2/

Testing Side Processes with Monitoring in Elixir

Latest post from Eric, on testing side processes and using Process.monitor and assert_receive to make sure the delivery process isn’t outpaced by the test process in the Ecto sandbox.

https://blog.smartlogic.io/test-process-monitoring/

Improve Elixir code with static code analysis.

Improve your Elixir using static code analysis tool, Credo (latest video in an on-going series on Elixir tools): https://www.youtube.com/watch?v=29RhlNt5qEc

Elixir Wizards S3E3 Brad Traylor of Podium on Training & Hiring

https://podcast.smartlogic.io/s3e3-brad-traylor

How to Compose Queries in Ecto

Writing composable queries in Ecto including how to safely build queries that need to join through multiple tables.

https://medium.com/flatiron-labs/how-to-compose-queries-in-ecto-b71311729dac

States Language - Declaratively design gen_statem processes

Declaratively design state machines that compile to Elixir based :gen_statem processes with the States Language JSON specification. https://github.com/citybaseinc/states_language