Can large SAAS applications be created in Phoenix?

I am in the process of learning Elixir and Phoenix, and so far, all the example apps that I see use LiveView and are small, dynamic single page applications that are all some variation on chat apps. As such, I have a few questions:

  1. Are regular phoenix controllers still usable or have they been basically deprecated with LiveView being the way forward?
  2. With LiveView, is it possible to create large scale SAAP style web applications with Phoenix or are small, dynamic apps with one or two controllers the sweet spot for phoenix?
  3. Assuming one can still use regular controllers, are there any good resources out there for how to build multi-controller web apps with phoenix 1.7? Unfortunately, all the guides that I have found so far use LiveView and mostly skip over how to work with regular controllers.
1 Like

Hello and welcome!

The Official Phoenix Guides is really the best resource. Elixir’s documentation is pretty fantastic and, if you’re not used to that coming from other ecosystems, I would always look there first. Controllers are absolutely still usable and will not be deprecated (websockets can’t set session data so they are at least necessary for that kind of thing). The Contexts section goes in depth about building an end-to-end feature and it uses controllers.

As for building a large SAAP app I can’t speak from experience there. Phoenix should be quite capable of building very large applications, though coming from me that is merely speculative based on others’ reports of their experience :slight_smile:

Here is a somewhat verbose description of hexdocs I gave to someone else who asked a similar question recently (because I didn’t notice these things right away, ha).

8 Likes

Yes it is still usable. There should be a page_controller created by default in any new Phoenix 1.7 project…

But now, previous templates, views and controllers are colocated in a controllers folder.

When You create API, You only have only controllers, no Liveview

As for building a large SAAP app I can’t speak from experience there. Phoenix should be quite capable of building very large applications, though coming from me that is merely speculative based on others’ reports of their experience :slight_smile:

I’m currently leading the development of a SaaS product, a CRM for commercial real estate brokers, using LiveView. The application is live, serving real customers, and I couldn’t be happier with the choice. The UI includes Kanban boards, multi-step forms and other fairly involved components.

I’d suggesting watching this conference talk: https://www.youtube.com/watch?v=XzAupUHiryg While it’s not a SaaS product, cars.com is a large-scale, very high traffic ecommerce site. The talk describes some issues they had when they cut over, but this is to be expected when completely rewriting an existing high-traffic application.

11 Likes

Thank you for the link to the Contexts section of the docs. It looks like what i am looking for. I had not yet visited that page in my exploration.

1 Like

Hi Chris!

You can definitely mix Liveview and controllers depending on your needs. Controllers are the only option if you serve an SPA for example.

About large scale Phoenix applications, at my company, we have a big monolith (~2000 Elixir files) that serves 4 web applications on different domains. We couldn’t be happier with our choice to build that with Elixir and Phoenix.

We started to use controllers a few years ago and slowly migrated them to Liveview. Honestly we don’t see the need for controllers anymore because we got used to working with Liveview :slight_smile:

3 Likes