Chris Oliver

Joined

290,710 Experience
86 Lessons Completed
298 Questions Solved

Activity

Posted in Russian Doll Caching with Rails 5 Discussion

Most cases like that, if you include both items in the cache key (both the user and the class) and use their updated_at timestamps there, it will do the trick. That way your cache changes anytime you update one or the other.

Posted in How to use the Sentimental gem

Hey Sascha! I forgot to write you back over email, but I'm planning on doing an episode on Thursday on this for you. :D

Are you interested in the simple "positive" or "negative" response or the percentage scores?

Posted in Setup Ubuntu 16.04 Xenial Xerus Discussion

That's where Chef, Ansible, etc come into play. :)

Posted in Managed hosting

We had both Rackspace cloud and dedicated servers. The dedicated servers cost us like $10k/mo or more. The cloud servers we used were fine, but performance seemed slow for the price. Their managed machines are also fairly expensive.

That's an interesting option as well. I'm curious to hear about what you go with and how it turns out. Hope some other people can weigh in as well.

Posted in My Development Environment Discussion

That would do it! :)

Posted in Managed hosting

I'd be really curious to hear how ElasticBeanstalk compares. I've used Rackspace in the past for several projects and wasn't impressed.

Heroku is one of those odd things in that the addon prices like database get obscenely expensive quickly. My guess is that ElasticBeanstalk is always going to be cheaper and more flexible than Heroku given that Heroku is built upon AWS. That said you're probably going to have a less easy time horizontally scaling since that's Heroku's bread and butter.

This guy basically said the same thing: https://www.quora.com/How-would-you-compare-Heroku-and-Amazon-Beanstalk-as-far-as-pricing-performance-and-ease-of-use-are-concerned-for-deployment-of-NodeJS-apps

EngineYard would be another option if you're looking for something fairly hands-off. Found another comparison that included them: http://mark-kirby.co.uk/2013/hosting-in-the-cloud-elastic-beanstalk-vs-heroku-vs-engineyard/

I don't know many people using EngineYard, but they have been really popular in the past. If you're already on AWS, you probably will already have all the experience and manpower you need to manage Elastic Beanstalk pretty easily. I think the platforms like Heroku tend to be great until you are paying costs similar to what you would for a full-time devops person. At that point, you might as well start managing your own scaling or start considering it.

Posted in My Development Environment Discussion

Hmm, works just fine for me when I import it here: http://cl.ly/g2px It's the one named "profile" after you import.

As for the zsh theme, I'm not sure why this line would cause any problems: https://github.com/excid3/d...

Posted in Setup Ubuntu 16.04 Xenial Xerus Discussion

Check out the deploy tutorial! :) https://gorails.com/deploy/...

Posted in My Development Environment Discussion

If you mean the ZSH theme, make sure you copy it into the ~/.oh-my-zsh/themes folder.

Posted in How to migrate from Heroku to Digital Ocean

For the actual migration, the only thing you'll really need to make sure you do is copy over your database. You can download it from Heroku and then upload it to your Digital Ocean server. You can google instructions on how to move a database to another server. It's not too bad, but you'll want to be careful that when you do this, your users aren't still using the old site where you would lose some data moving servers. You'll need to disable the current app on Heroku so that you don't lose data in the migration and then change your DNS to point to the new server on Digital Ocean.

Posted in How to migrate from Heroku to Digital Ocean

Hey Francisco,

The main difference is that on Heroku, you don't have to manage your server, update versions, patch security things, etc. It's a lot of work to run your own server but if you're willing to learn and do that, it can save you money, but it definitely won't save you time. :)

Heroku really saves a ton of time because there are so many little security patches to update constantly on your nginx, passenger, postgres, rails, ruby, redis, etc installs. That can be a fair amount of work not to mention if you want to setup backups or any of those things. You can check out the guides section in the navbar if you want to see some of my tutorials on how to do all this yourself.

The nice part is you can run all this stuff on a $10 or $20/mo server on Digital Ocean, whereas Heroku can get up to $100+/mo pretty fast. I will say, you'll probably still save time using Heroku, and if you're building something that makes money, then Heroku is probably going to be worth it. For side projects, or ones that you want to learn all the ropes of managing a server, then Digital Ocean is pretty great.

Posted in Deploy Ubuntu 14.04 Trusty Tahr Discussion

Whoops! Always something. I'll make sure this gets fixed shortly. :D

Posted in Dynamic Pricing based on user country

Hey Enrique,

You could definitely geocode their IP in order to get their country. That would probably be the most accurate version of this. Alternatively you could ask the user to fill out their country as part of the sign up process or something in order to record that without doing geocoding. The geocoding approach will look a lot more seamless on the UI side of things though, so I'd probably recommend that route.

Another option I just thought of could be taking the locale from the browser and using that to determine the country: http://stackoverflow.com/questions/7113736/detect-browser-language-in-rails I'm not sure how well this would work as the geocoded IPs would definitely be more accurate.

Posted in Setup Ubuntu 16.04 Xenial Xerus Discussion

Nope, just overlooked that! :)

Posted in Deploy Ubuntu 14.04 Trusty Tahr Discussion

No actually. Since you've got Bundler, Capistrano will run "bundle install" on deploy and will install Rails for you. That's the nice part about it, since you have Rails inside your Gemfile, Capistrano will automatically install it!

No real advantage other than meta tags are a bit nicer to organize your HTML with. You can absolutely put that on your body tag just the same.

Posted in dealing with authorized parts in fragment caching

Just did an episode on this! https://gorails.com/episodes/advanced-caching-user-permissions-and-authorization?autoplay=1

Cache keys are definitely tough because you have to make sure that no matter what when something changes, you get that a new cache key. Setting up extra "touch" methods so that you make sure all the parents and related models get updated_at changes is pretty important, but it always ends up coming down to the individual app you're building on some level.

Posted in Opinion: Destroy or not destroy

Honestly, I would probably only purge their data on request. Depending on the app, if they cancel their account, you might give them the option to purge or keep their data, but it's another thing for them to have to worry about when they cancel. It might be nice to automatically save it and then only purge if they ask you via support. Really depends on if your users would be unhappy about that approach or not I guess.

Posted in Opinion: Destroy or not destroy

I think that's a great idea. Having both is a really great way for keeping track of history even if the record was deleted. It's a good safety measure and a lot of businesses need that.

There probably isn't going to be significant amounts of storage used unless you're talking millions of records. At that point, you're well into the multiple gigabytes of storage, but that's relatively easy to handle these days.

I haven't added both into an app for a while, but I don't think there are any gotchas that I can remember. Paranoia is going to simply flag the main record as deleted which should do what you need.