4 ms·
I own a dev shops and I also write apps for clients big and small (think big 500 to 5 person startups) for a living. I used to advocate Rails a lot, but over j
by neya 9y ago
I own a dev shops and I also write apps for clients big and small (think big 500 to 5 person startups) for a living.
I used to advocate Rails a lot, but over just the last year, I realized nothing out there can replace my current stack (Phoenix/Elixir/Vue) then yet and I think it's still true today. And, that's a good thing after playing with tons of frameworks out there.
So far, I've tried the following - Express (Node), Play/Scala, Paython/Django/Flask, Ruby on Rails, Phoenix/Elixir.
My pick would be the following (and I'll explain my reasoning):
DB: Postgres (Google Cloud)
API: Phoenix/Elixir
Frontend: Vue + Brunch
Caching: We don't use caching (haven't had to, will explain a bit)
Paas: AppEngine (Google Cloud)
I wrote an app for a startup backed by a large VC firm last year and we chose Phoenix/Elixir for it. With Elixir, we were able to find code errors early on, we had the freedom of organizing code in Rails style (think concerns), while not having to fight with opinionated OO.
Elixir is drastically different in the sense the piping makes you think way more differently than working with other languages such as Ruby/Python. An example, this is production code from our E-commerce platform:
def process_order(user, token) do
user
|> mark_order_type()
|> collect_payment(user, token)
|> fulfill_order(user)
|> verify_order()
|> update_order_status()
|> clear_cart(user)
|> email_order_confirmation()
end
The code is more elegant and really beautiful to write and maintain. As a nice bonus,
about last year, we had so built so many drop in libraries that we'd just throw in into new projects and we were good to go since they would just "work".
There was one startup that abandoned their project midway after paying a lot of money, but as a courtesy, I told them I'll keep it online as long as I can, but promising only minor/security fixes to their web app. You'd be surprised how little effort went into maintaining their app. Once it was all setup, it just worked without any hiccups, (yeah, we do our regular checks).
I have fallen in love with Phoenix/Elixir ever since.
Why Vue? Because, it's fast, has a very low learning curve and doesn't involve JSX (Mildly related: https://twitter.com/thomasfuchs/status/810885087214637057 https://twitter.com/thomasfuchs/status/810885087214637057)
Why Google cloud? Before Google cloud, we were on Elastic beanstalk. There was this issue of dockerized setups where instances would randomly shut down and also updating them would take forever. The only solution was to delete and re-create the instances. This issue persisted as early as Jan 2018, I'm not sure about now. The sole purpose, I repeat, the only reason why you wan't to go the Paas route is because you don't want to do DevOps. And ElasticBeanstalk got us to a point where we were almost doing DevOps. I don't blame Amazon, since Phoenix/Elixir is still relatively new, but unfortunately didn't work well for us.
Between AWS and Google Cloud, AWS has a lot more breadth in terms of the services offered - My favorite is their image processing service. Their (AWS's) official SDKs are also usually more stable. But, I prefer to write my own as most of the time Elixir isn't supported anyway.
Recently Google enabled first class support for Elixir on AppEngine, so it makes it all the more attractive. They also offer a $3000 in credits if you're a startup. I don't have the links, but I know the program is still live as I got one very recently.
Caching: We don't use caching for our use-case. We divide our app into high-load parts and low-load parts. The high load parts are usually the static ones, such as your home page, about us page and so forth. We use Jekyll to push up static sites. For some of them, we use Netlify. But, for the rest, we use S3/Cloud storage. As scary as that sounds, for most of my use cases, I think caching is pretty much overkill for my clients since they don't have their response times as bottlenecks yet (I've only had 6-7 clients who've faced such issues in the last 2 years).
Having said all this, I would also factor in the learning curve to develop such an application. IF this is your first time, I'd rather prefer you stick to something you know already and are familiar with. If this is a mission critical project, I wouldn't gamble with a new stack. So, use my advice with caution :)
- mercer 9y agoI'll add that I love the 'with' keyword when piping doesn't cut it. Other than that I've also found that until about a year ago I would've recommended Rails or Django, and now I'm all for Phoenix/Elixir to a fault (as in, I'd even consider using Python packages from Elixir over going for Python because of those packages. Or cut out the middle-man and get a C guy to join the team).