Posted by turbogeek
on August 21, 2004 at 4:30 PM PDT
Daniel Brookshier gives you the inside scoop on how JXTA, Swing, and Java are used to create a P2P application for backing up data.
JXTATM For Business
Well, I keep saying that JXTA is where business needs to go to make a buck. Companies are indeed listening. 312 Inc. has just released a new JXTA product called LeanOnMe . LeanOnMe is a Peer-to-Peer off site backup tool. Simply, you choose the files you want backed up and choose another computer in the 312 Inc. peer network and your files can be backed up on demand or any time you specify. Of course you can also recover your files and all you need is the software and your password.
Im all for backup. It is just hard to do. I was in Orlando last week for Hurricane Charlie. Lucky me. But my critical data was backed up despite the trees being snapped in half by the wind. But my data was backed up.
Caution: I work for 312 Inc.
Before I continue, under full disclosure, 312 Inc hired me to do some consulting. So I could profit from you buying this software. I wont get much, but some, just the same. I am biased toward LeanOnMe and my friends at 312, so take this all in with a dose of salt and by all means, question my motives. It is more important to me that you understand that this a real live JXTA-based, 100% Java, Swing application.
Buying a copy, more than helping me, will help LeanOnMe be a success, and thus helping JXTA be a success by proving P2P applications work. But only do it if it makes sense to you. Only you can know that you cant live without a product.
If you like the idea of P2P backups, you can download the app and try it for a while for free. If you want keep on using it, use the discount code 312sun and you get 10% off. Like I said, Im not as much interested in you buying than I am in you seeing that P2P and JXTA are real. Buy it or not, please try it to see how well JXTA performs.
I just want to talk about why JXTA was a good choice for this application. I'm pushing JXTA here. If you think LeanOnMe is cool too, tha's just a bonus.
JXTA and Backup
So, what makes LeanOnMe really different because of JXTA? Most backup systems use either a local tape/disk or an off site server. This system uses another computer, any computer running LeanOnMe software. That's 'any computer. and 'anywhere'. By using JXTA, 312 has avoided the problem with centralized systems and taken advantage of terabytes of unused storage. But there is more to it than that. There are indeed terabytes of unused servers all over the world left over from the dot bomb.
Why use JXTA? How does it work? How well does JXTA work in this model? Read on.
First, why JXTA? The first reason is simple enough: JXTA provides the ability to find a specific computer anywhere on the internet. Another reason is that JXTA is stable and fairly quick now that we have reached JXTA 2.3.
JXTA is also general purpose. Unlike many other P2P systems based on file sharing, JXTA is communications based. Anything can be communicated, including encrypted backups or their status. Unlike file sharing, random replication of files is also not desirable. You only need a few copies and you need to know specifically where they are to recover them. There is also a need for a protocol specific to the application to manage the files. JXTAs Pipe approach does not constrain communications and thus any protocol can be applied.
JXTA is also open source. In part, open source has made it possible for people like myself to understand a lot of the code and how best to use it. I wont say I am all-knowing. JXTA is complex, but my knowledge has helped the development process. Open source has also helped because I have added a few pieces to the system, including the BinaryID that is used in the LeanOnMe application. The system uses the BinaryID to create a well-known-ID to connect pipes quickly with existing data about peers.
JXTA is also easily customized. In this case, 312 has created an isolated peer network . By isolating the network, 312 has further created a safety net that adds to security.
This is just the first version of LeanOnMe , so there will be many features added in the future, but the application is very solid and very familiar to anyone that has used a piece of backup software. Because it uses the peer network, adding innovative P2P functionality will be a breeze. This means some freedom to the developer too. For example 312 can add chat, workgroup management and almost any other network feature you might need. And more importantly they can add the feature without adding server infrastructure.
How Does it Work?
So, how does it work? First, in the first version it is not 100% P2P. There is a server component. LeanOnMe uses an LDAP server to keep track of where backups are stored. A couple of reasons for this are that you can recover because you can locate your backup through the data in the LDAP. Secondly, by controlling access to the LDAP, 312 can also ensure you are who you say you are. So this centralization gives your security and 312 a little control. Everything else is P2P.
Some more interesting aspects of the way the system works is that it uses the same presence mechanism as JxtaNetMap . Essentially the RDV reports peers entering and leaving the network on a propagation pipe that that all the peers subscribe to. This allows the application to know what other peers are available and online.
As for file transfers, 312 rolled their own and used the BiDiPipe for the transport. They have great features like the ability to restart a file transfer if there is an error. Its fast too! If you have good bandwidth it is far faster than tape or some of the slower backup media.
Security is important in a P2P application. First, data is going to computers that you may not control. Secondly, there is no isolation from listeners. This is the internet, not a happily isolated corporate network. What did 312 do to make sure data was safe?
The security is interesting and seems airtight. There are two passwords. One key is used for access to the system and one for your key store. If you have these, you can unlock your files even if the original computer is totally destroyed. If you have your original data on a laptop (read easily dropped or stolen laptop), this is the kind of access you need.
Of course, the backups are encrypted. The act of encryption and decryption is done on the source computer and via the passwords entered at runtime. The result is that there is no spreading of passwords required. It also means that the computers where these files are stored do not have access to the keys. This prevents your friends from snooping around in your data.
But backups are about the source computer too because it can be destroyed, so we need an independent way of accessing our data. By having the mapping data to where our data is stored in the LDAP (with its own backups), even with all our primary computers destroyed; we could still locate and access backups. Yes, a centralized vulnerability, but it makes sense in this case. It is a minor convenience to keep the LDAP backed up and highly available compared to doing the same thing with a high bandwidth data storage center.
A second aspect of security is that of the warm fuzzy of trust. Because this is P2P, you can choose any computer. So, we can choose to back up to specific computers and thus to specific people. So I can back up to my friends and familys computers because I trust them. My friend or my own computers certainly have a little trust than I can put to the average person. Even with an encrypted backup, some would like that extra security blanket or knowing the person that owns the equipment where important data is stored.
The third piece of security is communications. LeanOnMe uses JXTA's encrypted pipes to ensure that all communications are hidden from prying eyes. But why encrypt communications when the backups themselves are encrypted? This is just protecting the application itself. By encrypting communications you are hiding the protocol and the specific actions. Call it paranoia or being prudent, it certainly does not hurt.
P2P is Greater than Client/Server
The story here is that P2P with JXTA has provided a solution that was not possible before. The P2P model creates the opportunity and JXTA provides the possibility. Add hard work and a good design and you too can succeed with JXTA.
But what really changes when you move form client server to P2P? The first is freedom of choice. In the client/server model, there is only one place that the files can go. With P2P, the files can be located on any machine or even multiple machines. The freedom means that you not only can ensure that your data is in Idaho when Florida is hit by a hurricane, but also on your desktop and your laptop.
P2P also means that the applications still work behind your cable modem, NAT, and firewall. The evils of IP being changed by DHCP are also eliminated. Simply you can get to the computer with the backup data. This increases your freedom of choice. Back to your home PC and your laptop. Without JXTAs ability to cross the cable modem boundary, you would not be able to access your data on that home PC if you were on the road.
P2P Does Not Need To Be Pure P2P To Work
LeanOnMe is using JXTA , but it is also using the LDAP. Thats not pure P2P, so whats the point? It could be solved with a distributed system but in this case the data is probably better centralized.
Not all things need to be P2P. As it is, 99% of the work is P2P so the cost of the LDAP server is low for 312. Secondly, the scalability is much higher with less equipment. With 99% of the traffic between peers, the network scales itself as its members are added with their own resources.
Swing Scores Again
Another aspect important to developers is that it is written with Swing. I am a Swing advocate. I have used Swing since its early betas and because of my knowledge do not cow the rumors that it is slow and complicated. These rumors are once again put to the test. The interface is fast and looks great. It is successfully running on my Apple PowerBook and my dual processor G5 along with other machines running Linux and Windows. Stop bashing Swing, here is another example of a great application done right.
There are hundreds of other Swing applications, including NetBeans. Nothing wrong with Swing in applications as I see it and as is seen by thousands of other dedicated Swing developers.
P2P is Greater than Client/Server
I have talked a lot about the aspects of why backup works in P2P and a little about the foundations of the application and how it uses JXTA . The warm fuzzy you should get is that JXTA is something that you can depend on to create a business on. Though 312 is cornering the P2P backup space, there are thousands more applications that can use JXTA .
You have fewer excuses now. JXTA is ready for prime time. Get out there and write something we will be proud to call JXTA Connected.
Java == platform independence
XML == application independence
JXTA == network independence