
Lessons I learned while creating my SaaS with Rails - tn6o
http://samurails.com/projects/7-lessons-i-learn-while-creating-my-new-saas-yoursetup-io/
======
afro88
Extra (maybe obvious) tip for #7: Get yourself a free Slack/Hipchat account
and start curling those errors and exceptions to it. Super easy, way less
hassle than email, and free push notifications to your phone if you've got the
app installed.

~~~
herbst
Also do that with new relic. I finally found peace at night again.

------
michaelZejoop
Good writeup for your experience with Rails and EBS. I've built my project,
Zejoop dot com, in Java/Groovy/Grails and deployed on AWS Elastic BeanStalk -
and I'm very happy with my setup so far.

As for your comment about the multitude of services available on AWS, I agree.
They've recently added ACM certificate manager which simplified my maintenance
considerably.

Their ACM easy implementation probably saved me at least 20 hours of cert
renewal agony, plus it was free!

------
nolite
You're going to cry the day when you try to clone your Elastic Beanstalk
environment to do a rolling upgrade, and the termination of the first wipes
away your RDS db with it.

It's undocumented, but you'd be better off creating the db separately, not
within the beanstalk wizard, to avoid this

~~~
tn6o
Wouah, thanks for the heads up. I had no idea about this, I'm gonna look into
it and re-create the RDS db myself.

~~~
nolite
Take one of your RDS daily snapshots (which you're taking of course), and
recreate a new instance from it. Point your app to it, and you should be good.

------
nata79
Good post. But "[http://www.yoursetup.io/"](http://www.yoursetup.io/") is
returning 502s most of the time... Maybe something's wrong with your setup :/

------
colinramsay
Thanks for the insight into Elastic Beanstalk; I'm looking into it now.

Regarding Coffeescript and classes, I think that's a really poor reason to use
it. IMO Coffeescript has had its day and if you want class sugar, just use
ES6. You're already using a compilation step in your process so why not use it
to work with something standard?

~~~
tn6o
You're probably right indeed! I was just looking into refactoring some code,
found that and thought it was pretty cool. Plus Rails comes with CoffeeScript
by default.

ES6 is pretty sweet (pun intended) and will probably make CS kinda useless in
the future. I'll look into it however I think that currently CoffeeScript is a
bit of a standard in the Rails world.

~~~
colinramsay
That is a fair point, if I'm using Rails I actually just use plain old JS as I
don't personally like CS.

I just found a comment by a Rails contributor [1] which says ES6 will be
supported out of the box in Rails 5, which would be ideal. I can't find
anything newer to back that up though. I think it might be via ES6 support
baked into sprockets.

[1] [http://kryptonlabs.com/blog/2015/10/25/whats-new-in-
rails-5/...](http://kryptonlabs.com/blog/2015/10/25/whats-new-in-
rails-5/#comment-2326469442)

------
bluewater
Off topic in regards to this specific blog post but if you haven't already
check out mr money mustache's blog. I think his philosophy mirrors your own
based on reading through the rest of your posts on creating financial freedom.

------
bshimmin
The actual site (not this article) is currently serving up a 502; I think the
author needs to play with his autoscaling options in EB!

~~~
joshmn
Or just, you know, cache it correctly.

@OP there's a more DHH way of caching, but these will serve you well in the
meantime: [https://github.com/rails/actionpack-
page_caching](https://github.com/rails/actionpack-page_caching) and
[https://github.com/rails/actionpack-
action_caching](https://github.com/rails/actionpack-action_caching)

------
aprdm
Great blog post! Can't you use Angular or React with RoR when rendering in the
backend? I am pretty sure you can.

~~~
tn6o
Yes, you can just use Rails as an API and create a frontend SPA. But in my
opinion, it's faster to write in the 'old way' for a MVP instead of creating 2
different applications (one frontend, one backend). For the future, I'm
actually thinking about rewriting the frontend using SPA technologies.

~~~
andreamazz
Way faster. We are using a rails API and a React+Flux app as a front end. The
whole setup time alone is a considerable pain. I feel that the JS tooling is
still too fragmented and sometimes messy, but I'm probably biased by years of
rails and iOS development. Writing the app takes more time since you need to
write everything from the ground up (e.g.: no Devise views to just style and
forget), but I really hope that in the future the investment will pay. I wrote
about it a while ago (although now we are using the more terse Alt
implementation): [http://fancypixel.github.io/blog/2015/01/28/react-plus-
flux-...](http://fancypixel.github.io/blog/2015/01/28/react-plus-flux-backed-
by-rails-api/)

~~~
sandGorgon
Completely agree - just setting up a workable environment for webpack is a
disastrous exercise. Even things like cache-busting signatures, etc are a
implement-it-yourself deal.

------
amalag
Elastic Beanstalk drove me nuts. I went with Opsworks and was much happier.

