What's new? | Help | Directory | Sign in
Google
js3db
Javascript Object Database built on Amazon S3
  
  
  
  
    
License: MIT License
Labels: Javascript, AmazonS3, JSON
Links:
Join project
Project owners:
  monsur

JS3DB stores and retrieves Javascript objects as JSON using Amazon S3. One could use this to create an entire application in HTML/Javascript, with Amazon S3 as the datastore.

Overview

Browser-based applications have come a long way over the last few years. Rich desktop-like applications can live inside a single HTML file, fueled by Javascript and Ajax.

However these applications lack an inherent method for storing data. Javascript's same-origin policy prevents an application on one domain from saving data to another domain.

JS3DB gets around these limitations by using Amazon S3 to store all files and data. Amazon S3 provides a simple web services interface that can be used to store and retrieve data.

Installation

  1. Grab the latest code from the downloads page.
  2. Unpack and copy the code to your Amazon S3 bucket. I recommend S3Fox to easily create buckets and transfer files to S3.
  3. Edit the ACL for each file to allow everyone read access.
  4. Visit the test page at http://s3.amazonaws.com/your-bucket-name/test.html

Example

You can test out JS3DB here: http://s3.amazonaws.com/js3db/test.html

How It Works

Here's a quick overview of how JS3DB works:

Using this system, a developer could create an application without worry about building an maintaining a server component.

The JS3DB library has a few layers:

Really all you need to take advantage of storage is JS3DB. The JS3DB.Auth classes offer an easy way to integrate with applications.

A note about security: This implementation of JS3DB has the option of storing your S3 credentials in a cookie. The cookie is not encrypted and is not secure. Its best to use this option for testing purposes only. I'm not sure of a better way to persist S3 credentials on the client side; any suggestions are welcome.

Known Issues

Shout Outs

The JS3DB library is built upon the following javascript libraries:

Contact

Send any questions and comments to monsur at gmail.