Back in August I did a write up for my company, TGFI, talking about what we did to make BigSouthSports.com handle tens of thousands of concurrent users.
Be it programming or life, you have to push through your comfort zone to expand your capabilities. If you are unwilling to do that, you’ll lead a very unfulfilling life.
It is a fundamental law of nature that to evolve one has to push one’s limits, which is painful, in order to gain strength—whether it’s in the form of lifting weights, facing problems head-on, or in any other way. Nature gave us pain as a messaging device to tell us that we are approaching, or that we have exceeded, our limits in some way. At the same time, nature made the process of getting stronger require us to push our limits. Gaining strength is the adaptation process of the body and the mind to encountering one’s limits, which is painful. In other words, both pain and strength typically result from encountering one’s barriers. When we encounter pain, we are at an important juncture in our decision-making process.
Ray Dalio, Principles
Every day I try to push myself and challenge my beliefs from the day before. The more I read new topics or tackle difficult tasks, the better I feel.
This quote from Steve Jobs has nothing to do with product design and everything to do with moving society forward.
Designing a product is keeping five thousand things in your brain and fitting them all together in new and different ways to get what you want. And every day you discover something new that is a new problem or a new opportunity to fit these things together a little differently. And it’s that process that is the magic.
Don’t rest on your laurels. Keep pushing.
Heroku recently announced that they are changing the way you backup your app’s database. They are deprecating their bundles add-on and have added a new PostgreSQL only backup feature. This is great news as the old bundles method included a copy of your source code as well. In one instance, our backups went from 90MB compressed to just 17MB uncompressed.
Installing the Heroku PGBackups Add-On
First, you’ll need to install the latest version of the heroku gem.
sudo gem install heroku
Next, go into your project directory and install the pgbackups add-on.
heroku addons:add pgbackups
Once installed you can easily make a backup to the cloud.
heroku pgbackups:capture --expire
There are two things to note here:
- This backup now happens synchronously instead of in the background. This makes automation much easier as you don’t have to sleep for a few minutes and hope it’s done.
- The ––expire parameter automatically deletes the oldest backup, making historical cleanup a cinch.
Once the backup completes you can fire the download command off. This will get a public url (heroku pgbackups:url) and download it using curl to a directory on your computer. The file is also renamed with a timestamp like 20101213 for easy sorting.
curl -o /MyComputer/Drobo/backups/MyProject/MyProject_pgbackup_`date '+%Y%m%d'`.sql `heroku pgbackups:url`
That’s it. They’ve really done a great job making it easier to backup your database and it works every time.
What else can you do?
For more information, checkout the Heroku documentation on pgbackups. They have a great example at the bottom for transferring your database between production and staging sites, something we do all the time.
One of the first things I noticed after upgrading to Snow Leopard is that my Passenger based sites stopped working. I use this heavily for Rails development, so I needed it fixed. The first thing I tried was reinstalling Passenger Phusion, which led to an error.
I’ve been implementing Delayed Job to poll Twitter every minute for changes. However, it was immediately running everything and ignoring the run_at time in the database. Or so I thought.
Upon inspection of the code for Delayed Job, it is polling the database time to UTC and not local time.
(ActiveRecord::Base.default_timezone == :utc) ? Time.now.utc : Time.now
Delayed::Job.enqueue PollTwitter.new(), 0, 1.minutes.from_now
has now become
Delayed::Job.enqueue PollTwitter.new(), 0, 1.minutes.from_now.getutc
Four hours is a large difference.
Note: Normally I would just run this as a cron job, but Heroku will only run cron once per hour.
Memory usage is getting higher, and my patience waiting on a browser to load changes is getting much lower these days. Installing Ruby Enterprise Edition and Passenger Phusion will help with both! Here’s how we’ll do it:
A lot of effort has been going into transforming IndyRB into a valuable group of talented people. We’re at 116 members and growing!
Here are a few ways you can interact with the group:
- We have a new website up at www.indyrb.org with all the details.
- We meetup the second Wednesday night of each month.
- Get updates, make suggestions and help out via @indyrb on Twitter.
- Join the back channel IRC conversation at irc://irc.freenode.net/indyrb.
- Scan the archives of our #indyrb IRC room.
Quite a few of us hang out on IRC during the day and late at night. It’s a great way to see what some of the best Ruby developers are discussing and get some help when you’re stuck.