Non-MVC web framework?

I am wondering if are there other reliable web frameworks in Elixir that are not based on MVC design pattern ?
Maybe something based on MVVM or multi-tier ?

PS: I know Phoenix is great, but not for everybody, sometimes seems rigid, cumbersome… so please don’t insist to convince me about it, I just want to experiment other flavors of web dev/Elixir.

Thanks! :roll_eyes:

3 Likes

Hello!

If you’re happy to go for something a bit more modular and convention based there are lots of options.

One these might fit your preferences. Personally I quite like Elli

7 Likes

Your links are all broken b/c they include the colon.

2 Likes

Have you tried LiveView? It’s not too rigid. No pesky controllers!

4 Likes

Just to list some more alternatives:

  • Aino: An Elixir HTTP framework built on top of elli
  • MochiWeb: An Erlang library for building lightweight HTTP servers.
  • Webmachine: A “REST toolkit” - it is an application layer that adds HTTP semantic awareness on top of MochiWeb, see the Webmachine Overview for more

I have not used any of them, but I do know that Webmachine is quite different from MVC.

There is also another one in Elixir, but I can’t think of it right now. It’s very DSL-driven, meant to remove a lot of boilerplate, and supports both REST and GraphQL APIs… I can’t remember the name right now though

6 Likes

Oops! Thank you, I have fixed them

Isn’t LiveView de facto an MVVM?

There is also another one in Elixir, but I can’t think of it right now. It’s very DSL-driven, meant to remove a lot of boilerplate, and supports both REST and GraphQL APIs… I can’t remember the name right now though

Ash Framework?

1 Like

There is also ewebmachine, an elixir version of webmachine built with plug.

2 Likes

Thank you, that’s the one :grinning:

So far, the ewebmachine worth giving it a try. Too bad the documentation is very poor. And doesn’t seem to provide for the front-end part.

Just an update (closure) to this topic.

I set my own stack and modus operandi for web dev w/ Elixir:

  • I use plug_cowboy on the backend to manage the web server operations, routes, REST etc.
  • Also on the back-end, the connection to the ArangoDB (a non-SQL db engine) instance is realized through Arangoex - wrapper/adapter.
  • Front-end is developed using Vue.js (I transplanted the SPAs from old Node framework we used)
  • Created my own/custom functions that somehow act as controllers - this took a lot of effort, time.

Notice that everything is at minimums, extra-light.
It took a lot of time and frustration to set all of these, but we are very satisfied now, it runs blazing fast, it’s light, easy to manage, didn’t need that bloatware of Phoenix. I know, this is not a solution for everybody, has limitations, it just fits our purpose.
If one need an out-of-the-box, full framework, he should probably use Phoenix. Nevermind the learning curve… :hocho:

Cheers,
Q.

1 Like

I’m glad you were able to work out a solution. It would be great to see an example of your setup. I don’t think it’s fair to refer to Phoenix as bloatware, even if you did not find it to be the right tool for you. It would be nice to maybe see a comparison of performance benchmarks and compiled binary sizes between your setup and Phoenix.

5 Likes

How’s your experience with ArangoDB and its elixir wrapper(s), please? It’s something that might potentially be a good fit for my project too. Thank you.

Arangoex is pretty suitable for our case, easy and straightforward. Mind that we are only using simple, pre-defined queries - so just list, get_edge, get_vertex functions.
If AQL custom transactions are to be employed, I would recommend to give a try to the other wrapper, Arangox.

1 Like

Since cowboy and plug_cowboy was suggested (and used as solution), I would like to suggest Bandit and Thousand Island.

The naming might be bad haha but I’m very interested in those two projects, the ideas behind them are great and there is also a great presentation I saw some time ago. I see a lot of potential on it.

Thousand Island is an alternative to Ranch, and Bandit is an alternative to Cowboy.

You can check the project here: ElixirConf 2021 - Mat Trudel - bandit on the loose! Networking in Elixir demystified - YouTube

8 Likes

I just wonder how mature, stable, reliable, proven is this new stack ? :thinking:
Or just an experiment that will fade in time, like many others of this kind (not talking only about Elixir ecosystem)

Bandit and TI looks interesting Jack!

In recent performance tests, Bandit’s HTTP/1.x engine is up to 5x faster than Cowboy depending on the number of concurrent requests. When comparing HTTP/2 performance, Bandit is up to 2.3x faster than Cowboy (this number is likely even higher, as Cowboy was unable to complete many test runs without error). This is possible because Bandit has been built from the ground up for use with Plug applications; this focus pays dividends in both performance and also in the approachability of the code base.

I think we need a poll to see what everyone is using - there seems to be quite a few options these days (@Tristan and @lpil both mentioned Elli a little while back too)…

2 Likes

I should also mention acceptor_pool since Thousand Island was mentioned. It serves the same purpose and I use it with Elli and Chatterbox.

I took a quick look at Bandit the other day and its HTTP 1.1 support appears to be essentially equivalent to how Elli works.

I haven’t compared Bandit’s HTTP 2 to Chatterbox yet.

2 Likes

Very cool. Keen to hear the comparison between Chatterbox and Thousand Island

1 Like