Amazon SimpleDB Javascript interface possible?


I’m checking out amazon simpledb documentation. They mention only server side languages.

Is there anyway to insert data into the db directly from the client side without going through a server?

If not, how come?


Yes and no. Since you need to protect your secret key for AWS (hackers could use it to abuse your account), you can’t authenticate requests in JS directly.

While you could create an implementation in JS, it would be inherently insecure. Practical for some internal uses, it could never be safely deployed (as that would expose your secret key). What you could do instead is use your server to authenticate the requests to SimpleDB and let the JS perform the actual request to Amazon. Though it’s a bit roundabout, it would work.

The downside is that you’d need to do a bunch of processing on the client side. You’re also likely fetching more data than your app consumes/outputs, so processing the data on the client instead of on the server would likely encounter more latency simply because you’re transferring more data to the user and processing it more slowly.

Hope this helps

Leave a Reply