views:

34

answers:

2

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?

+1  A: 

If not, how come?

Security. You authenticate to the DB with your developer account. Amazon does not know about your end users (which it would need to, in order to authenticate access directly from the browser). It is up to the application code to determine what end users are allowed to do and what not.

That said, there is the Javascript Scratchpad for Amazon SimpleDB sample application. It does access SimpleDB directly from the browser (you have to type in your AWS credendials).

Thilo
Might couchdb be what I'm looking for?
JSNewbie
Well, you still need to do configure access permissions somewhere outside of the browser (where it cannot be hacked).
Thilo
Thanks, as usual all the answers are good.
JSNewbie
+1  A: 

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

mattbasta