Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 24, 2022 10:15 am GMT

Nodes

Greeting

Hello #devElixir!!! Welcome to #FullStackElxpro

Here we discuss strategies and tips for your Elixir learning journey. This is from scratch until your first wave as an elixir developer

I am Gustavo and today's theme is: Distributed Systems in Elixir

_ps: You can follow the article with video

Which are Distributed Systems?

A distributed system is a collection of computer programs that utilize computing resources at several different central computing points to achieve a shared goal. Distributed systems centralized bottlenecks or central points of failure of a system.

In this case, in the language, we chose (Elixir). We will use the resources of NODE

https://hexdocs.pm/elixir/1.12/Node.html

Why is it so important to understand System Distribution important?

What is the principle of programming in Elixir? And what are the advantages?

Everyone who chooses to work with Elixir is always the same subject:

  • Functional Language
  • competition
  • Parallelism

The important thing is what I see that could be a trend in the future in advanced Elixir developers and use mainly of concurrency and parallelism in distributed systems to decrease the cost in a company.

And how does Elixir help us with distribution?

A list of frameworks is below, but before using these frameworks, you need to understand a very important concept.

MNESIA - https://elixirschool.com/en/lessons/storage/mnesia
PUBSUB - https://hexdocs.pm/phoenix_pubsub/Phoenix.PubSub.html
LibCluster - https://github.com/bitwalker/libcluster

And reading this article: https://dashbit.co/blog/you-may-not-need-redis-with-elixir

I could talk about MNESIA, Pubsub, and Libcluster, but before you understand and before you start distributing systems with Elixir you need to understand what's behind all these frameworks.

The why and in case you still don't understand the distribution of systems It is low cost and uses performance of computer systems and hardware of a fantastic language that is not mainly and Elixir

How did I come to that conclusion?

I arrived at this final computation, this solver different one Feature had three applications running (in Kubernetes) I needed to read a file and send this external service, and an external service that saves a file to the database when the service was running or staging, sometimes these files were not read, so we tried to understand what the data was doing sometimes.

Our problem is that we had 3 running and the file was sometimes sent to the batch at the time of background processing, and when trying to read the file it was not healthy.

The simplest solution for this case would be to save this data in Storage (S3). When we talk about a functional language and a powerful language that facilitates concurrency, parallelism and distribution, 3 minutes to read files is a lot of time and that's where the idea for the next version came from using distributed systems and few resources. These resources that require a lot of knowledge of how Elixir works behind the scenes that I've come to complete and I want to share my experience with you and how you can make decisions after this article.

Getting Started with Elixir Distribution

This article is an example of how to use Nodes and RPC. Our first step is to know how to creators and RPC (remote procedure call).

Let's start with IEX

iex --sname gus #this way you create a shortname
iex --name gus@ip #this way you create a name

the biggest difference is access between the internet and local.

Image description


Original Link: https://dev.to/postelxpro/nodes-1jaf

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To