Creating Self-Contained Web Applications

Been thinking lately about how I don’t want to have to eternally babysit every web application I’ve ever made. So it seems like I have a few options for future applications:

  1. Use existing community-driven projects and customize.
  2. Create application that allows for script files and database to be dynamically added, changed, or deleted.
  3. Create application that “virtualizes” the database and abstracts script files.

When I first started working with web application development… I used existing community-driven projects and customized them to try to match the needs of the user(s). At some point, however, I got tired of running up against places that were too hard to customize… which eventually lead me to create web applications from scratch. Web applications from scratch are great (at first,) because they are tailor-made from the very start. But custom applications readily become a liability for users when the application developer has decided to stop supporting the application.

One of my earlier applications tried the second method (of creating an application that allows for user additions, changes, and deletions to the application itself,) and it all seemed to work for a while. But there are dangers in allowing users to change the very foundations they are standing on in order to make those changes. (For example, would you want to be a high-rise window washer with the ability to cut your own safety rope by inadvertently saying a few words?) This second approach seems great at first but the dangers that come along with this method may not be worth the risk.

The third approach of “virtualizing” the database might be a safer approach to a user-customizable web application. The term “virtualizing” here refers more to the idea of “abstraction” instead of other modern-day definitions for virtualization. When a database is “virtualized” it is basically made up of unchanging table columns that point to changeable table rows. It allows for user customization for the web application… while not actually changing the database structure. This method can optionally include a similar “virtualization” pattern for actual script files, as well. This approach would potentially complicate moving this database to another framework or application, however, because database tables would end up being further abstracted than usual.

At any rate, it still seems like there should be something easier between all of these approaches; and there probably is (aside from the “just have someone else do it” option…) I just have to find a better approach, I guess.

rsync notes

This isn’t necessarily the best way to use rsync… but here is a fairly simple (uneducated) way of getting two-way communication going between a source and backup host.

Steps:

  1. Generate keys on source-host: ssh-keygen -t rsa (or ssh-keygen -t dsa)
  2. Copy source-host public key to backup-host using ssh-copy-id1:
    ssh-copy-id -i id_rsa.pub backup-user@backup-host
  3. Generate keys on backup-host: ssh-keygen -t rsa
  4. Copy backup-host public key to source-host using ssh-copy-id:
    ssh-copy-id -i id_rsa.pub source-user@source-host
  5. Make sure ssh-agent is installed and running on backup-host.2
  6. Use ssh-add to add key to ssh-agent on backup-host3.
  7. Finally, run rsync on backup-host:
    rsync -avz -e ssh source-user@source-host:/path/for/backup/source backup_to_here

Notes:

  1. From this article. (I ended up making these keys for the opposite servers… for example: creating public key on source server is actually meant to be put into backup server authorized_keys file… and creating public key on backup server is actually meant to be put into source server authorized_keys file.)
  2. From ssh-agent article. (source)
  3. If ssh-add doesn’t seem to work, try running this in the shell: eval `ssh-agent`. (source)
  4. On Mac OS X, I seemed to have to run rsync in a new session before I got the pop-up dialog box asking if I’d like to remember this ssh passphrase in the Keychain Access utility.

See Also:

There’s got to be a better way…

Been tired of thinking about web programming and frameworks, lately. There’s got to just be some way to easily get stuff up online, right? Something that doesn’t require the “repeat yourself” (from the supposed DRY with Rails,) that inevitably seems to happen (due to my laziness, at least,) all too often. Thinking about an easy way to just get things up without a lot of hassle. o_O

DW Recording: Day 40

Got the lead part(s) done for a song, today. This song is originally supposed to be some kind of country song. But at the end, it turned into some sort of fusion or funk kind of song, ha ha. I think I’m liking the idea of funk, lately.