Elixir Blog Posts

blog-posts
wiki
stickies

#418

Hmm that article states that Cachex is only a local cache but it supports distributed caching as well:
https://hexdocs.pm/cachex/distributed-caches.html
It’s not super featureful, like I don’t know if it’s pluggable, but it supports cross BEAM node cache storage via sharding, so Nebulex is more capable if you have an external store.

I wonder how they benchmark, I’d love to see both tested with their full feature sets. ^.^


#419

Hmm that article states that Cachex is only a local cache but it supports distributed caching as well

Yeah, good catch, apparently since v3.1 supports distributed features. But overall, the main argument is not only about if the cache is distributed or not. The existing libraries are particular cache implementations, not a caching framework which is what Nebulex aims to be, be able to craft different caching topologies and patterns using different cache stores. But all these things are covered in the blog post.

It’s not super featureful, like I don’t know if it’s pluggable, but it supports cross BEAM node cache storage via sharding, so Nebulex is more capable if you have an external store

Well, I’m not sure what you meant, but Nebulex supports distributed caching by means of its distributed build-in adapter (among others) which implementing sharding (under-the-hood). Therefore, it is not necessary an external store, it is optional, and that’s the point, Nebulex doesn’t depend on an external store or any other particular cache implementation. The idea is that you can setup the adapters you need and deploy the topologies you require for your specific use case. For example, a multilevel topology where the L1 is the local cache using the built-in local adapter or even Cachex (in the roadmap there is an adapter for cachex), the L2 could be a distributed cache (using the built-in adapter), the L3 could be an external store like Redis, and so on and so forth.

I wonder how they benchmark, I’d love to see both tested with their full feature sets

Yeah, both Nebulex built-in adapters and Caches have benchmarks, you can run those benchmarks on each project and compare. But again, that’s not the point, it doesn’t matter which one is faster. The purpose of Nebulex is not to be faster than Cachex or any other cache, actually they complement each other, Cachex is a amazing cache library, and you can use it with Nebulex as well. The idea of Nebulex is to provide a caching framework you can play with, craft your own caches using the implementations you want, etc.


#420

Yep, that’s what I went on to say, Cachex’s version is not super featureful so if someone needed more detailed setup like pluggable implementations or so then Nebulex is better to use. :slight_smile:

Precisely, that’s what I was summarizing, that Nebulex is better to use especially in such scenarios. I am curious if it can handle transactional support though, I didn’t see it mentioned in the post. Like with Cachex you can access and store cached entries in bulk so no worry about out of sync issues (though it has issues doing that distributed, transactions are basically disabled then unless very specifically used).

I was actually just thinking that I wonder if Cachex could switch to using Nebulex as a backend for its distributed cache. ^.^


#421

I am curious if it can handle transactional support though, I didn’t see it mentioned in the post

Yes, Nebulex supports transactions as well (Erlang :global library is used under-the-hood). You can find more detailed info in the Nebulex Repo. Anyways I will write more about transactions, this is a very tricky feature and controversial topic that worth to be explained better :slight_smile:

I was actually just thinking that I wonder if Cachex could switch to using Nebulex as a backend for its distributed cache. ^.^

I think it might be possible, but the other option is to use Cachex from Nebulex, and that’s where the Cachex adapter comes in. But use Nebulex from Cachex sounds also interesting.

Thanks for your thoughts :slight_smile: !!!


#422

Plataformatec’s recap of their year with Elixir:

Thank you José and everyone at Plataformatec for everything you do with Elixir :purple_heart:


#423

Elixir and Erlang Ecosystem? https://link.medium.com/74U1RILJFS


Alvise Susmel's blog on Elixir
#424

Best practices for integrating with third party libraries
https://www.jackmarchant.com/articles/integrating-third-party-libraries-in-elixir


#425

Counting Real-Time Trades

In the Real-time Market-Data Updates with Elixir article, we have seen how to build a Coinbase WebSocket client and receive real-time trades. A reader asked how many trades we receive per second. In general, the rate of trades depends on the product and the time of day.
In this article we start to see how to aggregate these trades in real-time, using the GenServer behaviour. We’ll build an aggregation process that groups and count the trades.


#426

Friends, I am now at least in this respect a rare breed: an Elixir programmer who has never written Ruby.

I was never a professional Erlang programmer. I cut my teeth on Python and began working in Python, but Erlang was the language I learned after that and the one that I looked for excuses to write in (in addition to Nim, which would come a little later, but which I would also be able to finagle into production at MakeSpace).

So here was my impression of Elixir for the first several years of my passing acquaintance with it: it’s Erlang with Ruby syntax. I had never ended up writing any Ruby, and I was already happy with Erlang and its syntax. So I had a fairly simplistic understanding of the Elixir language and the roots of its popularity and it didn’t seem that there was anything of value to me.

https://blog.zdsmith.com/posts/sketches-of-elixir.html


#427

@sfusato Hey another Erlanger!

A note:

iex(3)> [x, y, z: true] == [x, y, {:z, true}]
true

You put [x, y, [{:z, :true}]], which is:

iex(4)> [x, y, z: true] == [x, y, [{:z, :true}]]
false

:slight_smile:

Also on Streams, those aren’t an Elixir’y thing, they are just repeated function application underneath, trivial to do in Erlang as well. Structs are just maps. Etc…

However the quintessential Elixir’y bits of Elixir are Macro’s. The tooling built up around Elixir works for Erlang as well (except using the ASN.1 compiler in erlang, that’s still borked in Elixir…), you could implement protocols in Erlang the same as you could in Elixir (In fact my ProtocolEx library could even use a ProtocolEx or implementations defined in Erlang as long as a couple specially named named functions with appropriate returns are defined).

But the one thing that is horribly hard to port back to Erlang are Macros. Sure Parse Transforms give you the power, but not the succinctness, and there are parse transforms that add AST quoteing and compile-time calls, but it never gets as succinct as Elixir macros. Macros is what elevates Elixir from just a beam language to a more Lisp’y language without the parenthesis (though if you like the parenthesis look at lfe, it’s an awesome beam language as well!). :slight_smile:


#428

Hey everyone! Happy new year!

Processing Large CSV files with Elixir Streams

In this article I introduce Elixir Streams as a powerful and elegant way to process large CSV files. I compare the greedy and the lazy approach with some memory and cpu benchmarking.

As always, any feedback is really appreciated! :smiley:


#429

Create a High-Availability Kubernetes Cluster on AWS with Kops

This article is mainly focused on DevOps. I show how to create a High-Availability Kubernetes cluster on AWS with Kops and deploy a Phoenix Chat application.

I hope this can be useful to the Elixir community. I find interesting the idea of experimenting and discussing (in further articles) the deployment and update of distributed stateful elixir apps on a Kubernetes cluster.

Please let me know what you think. I’m here for any question :smile:


#430

Distributed Phoenix Chat using Redis PubSub

Hi guys!

In this article we see how to solve an issue we faced in the previous article, scaling horizontally the Phoenix Chat app. We’ll see how to integrate the PubSub Redis adapter to our chat app, and make it distributed.


#431

https://www.jackmarchant.com/articles/using-a-genserver-to-handle-asynchronous-concurrent-tasks


#433

Using Raxx.View in Plug applications

http://crowdhailer.me/2019-02-08/using-raxx-view-in-plug-applications/


#434

https://www.jackmarchant.com/articles/a-comparison-of-elixir-supervision-trees-and-react-component-trees


#436

Wrote down some thoughts about modular design in Elixir:

Comments, disagreements, and corrections are highly welcome :wink:


#437

https://www.jackmarchant.com/articles/lonestar-elixir-conf-2019-highlights


Phoenix LiveView Info
#438

Elixir is one of the young programming languages people mentioned a lot. We have been working on Elixir and Phoenix for several months since we started the business and we would like to share why we chose Elixir, the lessons learned, sample code and why it might be a good choice for your next project.


split this topic #439

A post was split to a new topic: Achieving 100k connections per second with Elixir