The ramblings of a programmer on a quest to learn a little bit of everything.
Hey everyone,
My post today is going to be about deployment, a subject I dreaded as a beginner web developer. When I first made scholtek.com, my deployment strategy consisted of accessing the web server with Filezilla, and copying everything into the public root on my server. It was slow, and not at all scalable. It didn't allow any room for extra build processes such as minification or image compression. My builds were handled manually, one painful step at a time.
With my recent move to Django, and my new experience of deployment done by professionals at work, I decided to make things easier. The first thing I needed was a server that actually gave me some control. Up to this point, I'd been using the cheapest plan from HostGator - for shared hosting it worked very well. On my peak day, the site had more than 12,000 hits and HostGator never complained. For someone just starting out, they're a great option. But now I wanted to flexibility available with a Virtual Private Server, which provides a nice little sandbox where I can do whatever I want. Most of my experience was been with Amazon's elastic compute cloud offerings, which I enjoyed using and think is a clear choice if you're going to scale to hundreds of thousands of hits per day, but I decided to go with Digital Ocean, which boasted one click Django deployment, and a cheapest plan at $5 per month.
As can be expected, the VPS for this server is not a powerhouse. It provides 512MB memory and a single core, but even that is likely to outperform a shared hosting plan, and I have the advantage of a very low consumption website. All of the content currently on scholtek.com is static content, meaning it's the same for each and every user of the site. That provides a lot of room for caching and other optimization, which I have yet to test out (don't worry - that blog post will come as well!), and so the plan I have should be just fine.
The other benefit of Digital Ocean is their wealth of documentation. In particular, I found an article on automatically deploying with git. I'll leave the details to the article, but the summary is:
If that sounds extremely easy, it's because it was. So this complicated manual deployment method I've been using for the past year was replaced in under 20 minutes using git and a VPS. To any web developers out there, I can't recommend this approach strongly enough.
-Keilan
Hello Gamers,
If any of you are exceedingly observant, or enjoy poking around my source code, you might have noticed some changes around the site recently. This is because I've migrated from a site that I cobbled together using php (which I don't know) to using Django, a python framework that simplifies a lot of web development. It's also the framework that I have the most experience with as I use it professionally. I decided to migrate the site for a number of reasons:
So far the transition has been quite painless - I used fairly limited php and so the Django template system has been more than adequate to replace it, and in cases where it wasn't, it was quite simple to write extra template tags to take over. My code repetition has been reduced greatly, and I feel much more confident in my ability to extend the site. My next step is to find an affordable VPS to deploy on, and set up some handy functionality like automatic minification and one click deployment. But that's a separate post.
To be continued...
-Keilan