Midrange News for the IBM i Community

Backup, Backup, Backup Published by: Bob Cozzi on 21 Jun 2011 view comments
© 2011 Robert Cozzi, Jr. All rights reserved.

© Robert Cozzi, Jr. All rights reserved. Reproduction/Redistribution prohibited.
A midrangeNews.com Publication

Backup, Backup Backup

In the 1980s, Jim Sloan of IBM Rochester was one of the original Planners of what we now call "IBM i" operating system. He introduced a new term back then, regarding the save/restore procedures of the System/38 shop. He said there are 3 things you need to do for data security "Backup, Backup, Backup". So simple and yet powerful a message was this that T-Shirts were made with the slogan on them.

In the non-IBM i world, PCs running Windows, Mac OS X and Linux can backup to the cloud on an on-going basis. Some examples are the one I like, DropBox.com which gives you a "sky drive" in the cloud and automatically syncs between everything (except IBM i). I have an iPhone, a Mac, an iPad and a Windows PC. The files that I move into DropBox appear as if by magic on every one of those devices automatically. It's like the ultimate shared network drive. You can sign up for a free dropbox account here (that's what I use) that gives you something like 2GB of space, and then you can purchase more space as needed. I've been using it for over a year and have zero issues with it.

In fact, when I do PC-based development for my clients, I'll zip-up the project, including the source code, and create a folder on my dropbox drive and copy their work to that drive. That way I don't have to worry about it and its always available to them anytime they want it. I love Dropbox!

Amazon also offers a virtual or "cloud" storage mechanism. It isn't as integrated or as simple as Dropbox. But the advantage is it is extremely fast and virtually unlimited in size. With Amazon Web Servers (AWS) S3 you pay for only the space you use. If you need lots of storage or very high-speed (servers spread out across North America and the World) perhaps S3.Amazon.com is something you should look at.

There are also online services dedicated to backup. The one I recommend today for PC-level data is www.Carbonite.com Carbonite costs about $60/year for personal use and $230 for business use. Great for PCs and servers, not so much for IBM i databases, however.

Sponsored by: CNX Corp Valence

DUR - Disaster UnRecovery

No good deed goes unpunished. If you have a great backup plan in place, the weakest link is the person responsible for the backup media (tapes). If that person doesn't do their job well, you are screwed. Backup tapes sitting on someone's desk or "on the AS/400" do you no good if there's a fire during work hours. Yes, fire doesn't break out only during the night.

If there's a system failure, sure you can restore from the tapes sitting on your desk. Typically IBM or your BP will expedite a new box to your location in a day or so. But what if your building burns down during normal work hours? Will your backup tapes from the night before be destroyed along with the system itself?

It is surprising to me that people actually have started to think about their backup media as if they were like a lawyer argues a point in court. "Because this one event occurred once, it will occur again and again." To a lawyer an a one-off event is called a "pattern". To science or math it might be referred to as an event or spectacle, but a "pattern of one" does not a make a pattern.

Simply because it rained today does NOT mean it will rain tomorrow. Simply because it's a beautiful Sunny day today does not mean tomorrow will be as great. Software developers often plan backup procedures using a sunny day scenario and actually feel good about it. This could be the reason behind so much of the crappy code I see in shops. Much of it appears to have been written by programmers with far too much self-esteem and way too little programming skill. But that's another story in itself.

What if the building burns down during business hours? I bet you run out of the building without even thinking about the backup tapes. On-site backups serve no useful purpose except to ship the media off somewhere for safe keeping.

Just remember what Bob says: "If your system is saved to tape and those tapes are at the same location as your system, YOU ARE NOT BACKED UP." Get your backup media off-site as soon as possible after the backup.

DR Disaster Recovery

High Availability (HA) is not Disaster Recovery (DR). If you have a backup system in the same room as your primary system and you have something like Mimix or Vision running, that's H/A (high availability). If you loose power in one system but the other stays up, that's HA. If the building burns down and you loosing both systems, your HA system is obviously not a DR system.

Disaster Recovery is when you put your HA system in another location, not in another room or on another floor in the same building, but in a completely different location. Here's a grading chart I've prepared to rate your Disaster Recovery environment:

  1. Cross-Country: An off-site location at least 600 miles away
  2. Out-of-Town: An off-site location at least 1 to 600 miles away.
  3. Down-the-Street: An off-site location 1/2 to 1 mile away.
  4. Same-Block: A location within 1/2 mile from the primary system.
  5. Same building as the primary system.

If your backup or DR site is in the same building, you failed.

The Same Block has a higher likelihood of being safer than in the same building. If, however, there is a big fire or some other large destructive event, being down the block isn't going to save anything.

Down the street might be okay when the building containing the primary system is damaged. A simple fire, or flood may not spread beyond a few blocks or even to the next building. So being at least 2500 feet away is good enough if you don't live in an area where Hurricanes, Tornadoes, levy breaks, Earth Quakes, Volcanoes, or other such things that impact more than a few hundred feet occur. 

Out of Town locations are good enough if  you live in a relatively safe geographic location. If there are no hurricanes, flooding, Earthquakes, volcanoes or tsunamis in your area, make sure your DR system is several miles (or several hundred miles) away. That way if a tornado, fire, flood hits your office, the chances of it also impacting the 600-mile away backup DR site are greatly reduced.

Cross Country is the best choice for DR today. If your office is in Chicago, your DR system should be in a place like Albuquerque, Phoenix, New York State, or the Denver area; locations with few natural disasters. DR locations in places like southern California, New Orleans, or most parts of Florida are questionable. Those locations often have natural disasters themselves and hence don't make good backup venues.

With today's relatively high-speed connectivity, you can easily switch over to your HA system to a DR site and continue to use it in a way similar to what you do today.

Save/Restore to an Off-Site Server

Backup, Backup, Backup is critical but Off-Premises Backup Media is the key. If you backup and do not remove the backup tapes from the location where the system resides, you are not backed up. Always make sure you have a set of tapes for each day of the week (yes 7 sets if necessary) and rotate them. Never have the current backup tapes on site. Once the backup finishes, get those tapes out of there! It's up to you to decide if you can let the backup "run overnight" and then remove "last nights" backup when people go home for the evenings. But remember, you'll have those backups on-site so if the building burns down, odds are so will the most current backup. If you do have 7 sets of tapes that you cycle through, then at least you only have to go back one day. You could also think about acquiring a fireproof safe and move the backup tapes to that fireproof safe first thing in the morning (if there's no overnight operator).

Earlier I mentioned a few PC-oriented backup services. The problem with all these services is that they use a form of hierarchical file system similar to that used on the IFS under IBM "i". Sadly I know of no IBM i-based backup system that allows us to target these services. While I certainly have the skill set necessary to build such a system, as of this point, I haven't had a client ask me to create one.

The way I would approach this kind of tool is to build a backup system that uses a savefile (savf) or virtual tape system. First save the objects to a save file, then copy the save file to the IFS. Then transfer that save file to dropbox or Amazon's S3 servers immediately.

This would require a lot of bandwidth, obviously, and while dropbox and Amazon S3 can handle whatever you throw at them, many companies are stuck with an antiquated T1 line running 1.5Mbs. Unlike places such as South Korea where most companies enjoy 30Mbs connection speed. (Aren't U.S. Telephone monopolies great?)  So because U.S. Businesses are so far behind the rest of the world, this kind of remote backup might seem undesirable.

Having said that, we do have HA and DR sites running today, and they do incremental data transfers. This means that data is continuously pumped out of one system into another as its changed. Perhaps something like that could be built for an "IBM i backup system in the sky".

Once data is copied onto the IFS, it is a simple matter of using FTP or a custom Sockets program to pump the data to the remote system. Most of these services have their own set of APIs so building an "i" tool that interfaces with them may not be as complex as we think. If you need a good SOCKETS library to use with RPG, I've already written one, and its free. It is called iSockets and is available for free download here.

Bottom Line

The bottom line is if your backup tapes are sitting "on your AS/400" you are just asking for trouble. If you have a great backup plan in place, review it and make sure you ask yourself "how do we recover if". If you have a backup plan rate (in my grading scheme, above) that rated a C or worse, review your plan and try to get higher up the scale. Stuff happens, and the weakest link is always going to fail in a disaster.

Call Me

Bob Cozzi is available for consulting or on-site training in RPG IV, SQL, and CGI/Web as well as perform contract programming. Currently many shops are asking Cozzi to join them for 1 to 3 days of Q&A and consulting with their RPG staff. The Staff gets to ask real-world questions that apply to their unique situations. Contact Cozzi by sending him an email at: bob at rpgworld.com

Bob also accepts your questions for use in future RPG Report articles or content for midrangeNews.com. Topics of interest include: RPG IV, Web development with RPG IV, APIs, C/C++ or anything else IBM i development related (except subfiles, data areas and RPGII/III because Bob doesn't care about that stuff) write your questions using the Feedback link on the midrangeNews.com website. 

You can subscribe to RPG Report (we call it "follow") by visiting the RPG Report page on midrangeNews.com and then click the FOLLOW link in the table of contents for that page. To unsubscribe, simply click that same link. You must be signed up and signed in to midrangeNews.com to start following RPG Report.

Follow Bob Cozzi on Twitter

Return to midrangenews.com home page.
Sort Ascend | Descend