If you haven’t already done so, now would be a good time
to watch Steve Jobs’ 2005 Stanford commencement address.
Mobile Lua – iOS and Android apps with Corona
On Thursday (May 26, 2011), I presented at the St. Louis Mobile Dev group, on cross-mobile-platform development with Lua. There are various ways to do this (including rolling your own), but for simplicity I used Ansca’s Corona product. The talk was somewhat impromptu, so I didn’t record audio or video. The slides are available as a PDF: 2011-Lua-Corona-Mobile-Dev.pdf
From this blog, you might get the impression that I use Lua extensively. That is not true; 95% of my work does not involve Lua in any way.
Crafting a Summer Intern Program
Inspired by Fog Creek’s summer intern program, for the last few years we’ve (occasionally) thought about a summer intern program at Oasis Digital. We’ll going to try it out this summer, with a single intern; a more substantial program is possible in the future.
Read more at the Oasis Digital blog, where I’ve moved this post.
Cloudy Data Storage, circa 2001
Around 2000-2001, Oasis Digital built a system for a client which (in retrospect) took a “cloudy” approach to data storage. 2001 is a few years before that approach gained popularity, so it’s interesting to look back and see how our solution stacks up.
The problem domain was the storage of check images for banks; the images came out of a check-imaging device, a very specialized camera/scanner capable of photographing many checks per second, front and back. For example, to scan 1000 checks (a smallish run), it generated 2000 images. All of the images from a run were stored in a single archive file, accompanied by index data. OCR/mag-type data was also stored.
I don’t recall the exact numbers (and probably wouldn’t be able to talk about them anyway), so the numbers here are estimates to convey a sense of the scale of the problem in its larger installations:
- Many thousands of images per day.
- Archive files generally between 100 MB and 2 GB
- Hundred, then thousands, of these archive files
- In an era when hard drives were much smaller than they are today
Our client considered various off-the-shelf high-capacity storage systems, but instead worked with us to contruct a solution roughly as follows.
Hardware and Networking
- Multiple servers were purchased and installed, over time.
- Servers were distributed across sites, connected by a WAN.
- Multiple hard drives (of capacity C) were installed in each server, without RAID.
- Each storage drive on each server was made accessible remotely via Windows networking
Software
- To keep the file count managable, the files were kept in the many-image archives.
- A database stored metadata about each image, including what file to find it in.
- The offset of the image data within its archive file was also stored, so that it could be read directly without processing the whole archive.
- Each archive file was written to N different drives, all on different servers, and some at different physical sites.
- To pick where to store a new file, the software could simply look through the list of possibility and check for sufficient free space.
- A database kept track of where (all) each archive file was stored.
- An archive file could be read from any of its locations. Client software would connect to the database, learn of all the locations for a file.
This system was read-mostly, and writes were not urgent. For writes, if N storage drives weren’t available, the operator (of the check-scanning system) would try again later. CAP and other concerns weren’t important for this application.
Helpful Properties
- Even if some servers, sites, or links were down, files remained generally accessible.
- Offline media storage could be added, though I don’t recall if we got very far down that path.
- The system was very insensitive to details like OSs, OS versions, etc. New storage servers and drives could be added with newer OS versions and bigger drive sizes, without upgrading old storage.
- Drives could be made read-only once full, to avoid whole classes of possible corruption.
- By increasing the number of servers, and number of hard drives over time, this basic design could scale quite far (for the era, anyway).
This approach delivered for our client a lot of the benefits of an expensive scalable storage system, at a fraction of the cost and using only commodity equipment.
Why do I describe this as cloud-like? Because from things I’ve read, this is similar (but much less sophisticated, of course) to the approach taken inside of Amazon S3 and other cloud data storage systems/services.
Key Lesson
Assume you are willing to pay to store each piece of data on N disks. You get much better overall uptime (given the right software) if those N disks are in N different machines spread across sites, than you do by putting those N disks in a RAID on the same machine. Likewise, you can read a file much faster from an old slow hard drive in the same building than you can from a RAID-6 SAN across an 2000-era WAN. The tradeoff is software complexity.
Upcoming Talk: Lua on iPhone and Android (using Corona)
This Thursday (May 26, 2011), I will give a talk at the St. Louis Mobile Dev group on cross-mobile-platform development with Lua. There are various ways to do this (including rolling your own), but for simplicity I’m using Ansca’s Corona product.
As usual, I’ll zoom through some slides, and concentrate instead on the code. For some background on Lua, you may want to watch the video of my 20-minute Lua talk from last year’s Strange Loop.
Update: slides are available here.
Coming this fall: Strange Loop 2011
Coming this fall, Alex Miller is putting on the third year of his Strange Loop conference, Strange Loop 2011. It’s not in “The Loop” this time, because The Loop isn’t big enough to hold it!
I heartily recommend Strange Loop for any software developer interested in learning more about a wide variety of technical topics. Unlike many other events, this one stays close to the technology all the way through – you might see a higher ratio of code-to-text on the slides here, than at any other conference.
(Again this year, my firm Oasis Digital is a sponsor, and I’ll probably submit a talk. I hesitate a bit though, because if I give a talk, I have to miss someone else’s talk in that timeslot.)