Archive for the ‘Entrepreneurship’ Category

How to migrate user data and preserve old links with Nginx

Saturday, June 5th, 2010

Yesterday I found that I’ve hosted 1GB of Freshlog-uploaded screenshots on my VPS account since I’ve launched in August 2009.

VPS (Virtual private server) are great for hosting Rails applications since they more or less provide you a guaranteed slice of CPU and memory. Furthermore, if another account on the same physical server dies, it’s self-contained and the other slices continue to run without a performance hit. Throw in a full-fledge root account and the option to independently reboot your slice – definitely more stability and control than a shared rails hosting environment. They’re cheap too, I’m only paying US$8 per month to my provider, prgmr.com, perfect for bootstrapping a startup, Freshlog in my case.

However, since I’m only selling Freshlog as a one time purchase and have been offering complimentary screenshot hosting, (the main selling point of Freshlog is uploading screenshots to other services), I wouldn’t be able to afford to upgrade to a bigger plan indefinitely.

Even so, I really enjoy using Freshlog myself and didn’t want to disappoint friends and fans by discontinuing my hosted screenshot service.

I understand the need for the links to existing Freshlog screenshots to continue to work, as users would have embedded HTML containing freshlog screenshot links in their own online documents and it would be very irresponsible to simple break them. I have also personally used countless Freshlog screenshots in my help and support documents on my Freshlog support site.

So here’s how I migrated 1GB of screenshots to another web host (VPS hosting costs are pricier for the full control you have over it) and freed up space on my VPS with an Nginx configuration, while preserving old links:

With existing Freshlog screenshot urls looking like this:

http://freshlog.com/photos/3704/large/ca2507287635411f76aade14a5a11d39.png

And I need them to be redirected transparently to my new host like this:

http://dh.freshlog.com/freshlog1/photos/3704/original/ca2507287635411f76aade14a5a11d39.png

I achieved this with Nginx rewrites, similar to Apache’s mod_rewrite, here’s what I added to nginx.conf:

if (!-f $request_filename) {

rewrite ^\/photos\/(\d+)\/([a-z]+)\/([a-z0-9]+).png$ http://dh.fres\

hlog.com/freshlog1/photos/$1/$2/$3.png;

}

Here’s what it does:

If the requested file ($request_filename) does not exist (!-f), parse the URL via regular expressions and redirect it to the new URL.

The changes are transparent to users and if you were to create new screenshots, the new screenshots will continue to be created and hosted my VPS, but if you were to access screenshots that were transferred to my other webhost, Nginx will find that the file does not exist locally and transparently redirect to the new host, all without any broken links.

In future, when storage starts to dwindle again, I’d simply transfer the screenshots to my secondary host and delete them locally on the VPS and Nginx will handle all the transparent redirects.

If you have a better way to migrate users’ data, do let me know in the comments.

User responses like these just make my day

Wednesday, May 19th, 2010
  1. See how cool my users are:

    Ee6cb87776741ce44f531171e1a00e32

I love my work =)

Step-by-step screenshots for quick changelogs

Tuesday, May 18th, 2010

I realized that Storyteller’s handy for creating changelogs:

Storyteller 0.1.1 (6) updates

  1. Number of screenshots you’ve taken.

    9cf61ea26701bb53b87fad9bdac7ad78

  2. Tooltips for image viewer

    E3ff846fe8c2eb5c072ff16c5108f608

  3. A little description where the body and conclusion will appear in your final story

    Dc916555469a6813e61264533dabf3ee

Let me know if there’s stuff you’d like to remove. Yes I said remove.

Pictures speak a thousand words.

Review your UI flow to save heartache

Monday, May 17th, 2010

Puzzled that I wasn’t getting any feedback for the past 2 days, I went through the new user signup flow, until I realized that the Login button for Beta users was barely noticeable:

  1. Previously the login link for beta users was so small it was barely noticeable.

    Bd76dff21e477fdb01dd07a3581e3710

  2. Now it’s bigger

    1aaf2b6ae789974c010f635ae4e749c0

Sorry for the confusion, as soon as I ran through the flow I immediately felt very very bad :(

Do yourself and your users a favor and review your flow!

This is why I love my work

Sunday, May 16th, 2010

Freshlog is a product I made to scratch my own itch – creating screenshot-attached messages (in project management services like Basecamp and bug trackers like Unfuddle) in one step.

  1. A few days back, I did some upgrading and broke a feature, which prompted one of my customers, Casey from Techskull to send a support request.

    21043e00a94f9011abd9dcc949b89f27

  2. As soon as I got wind of it, I fixed the bug.

    A4a47ba30fd100db28d114dcf2027476

  3. Casey replied to ask me to look at a screenshot she took.

    I didn’t even notice the title of the friendly URL as the first thought I had was: did I miss something out?

    5fd1f87f27d65a1dcd2283b6361fd8c8

  4. Only to be super, super pleasantly surprised! =)

    Thank you so much Casey!

    I can’t adequately describe how much this means to me and my work on Freshlog.

    I actually teared a little.

    6bdb80cc279bf3e30d32f8f257e3cae6

A chapter titled “Make a dent in the universe” in the book Rework by 37signals reads:

“To do great work, you need to feel that you’re making a difference. That you’re putting a meaningful dent in the universe. That you’re part of something important …”

“… You want your customers to say, ‘This makes my life better.’ You want to feel that if you stopped doing what you do, people would notice.”

So true. This is why I love what I do.