Welcome Guest, Not a member yet? Register   Sign In
New AWS SimpleDB library
#1

[eluser]Unknown[/eluser]
Released today is a new CI library for the Amazon Web Services SimpleDB library that is designed to lower the barriers to entry for those familiar with mySQL. The new library class provides an intuitive, easy-to-use set of functions to access and manipulate AWS SimpleDB. Example:

$this->load->library('mypaws');
$rows=mypaws->select('*')->from('orders')->where("'order_date' > '2009-01-01'")->limit(10)->go();

The CI library leverages the myPawsSDB library to wrap the Amazon SimpleDB library that so far provides: INSERT, SELECT, UPDATE, DELETE, CREATE TABLE, DELETE TABLE, SHOW TABLES and SHOW COLUMNS operations.

The package is designed to be easy to use for those familiar with PHP and mySQL as the AWS SimpleDB implementation details are hidden and data results are returned as associative arrays as is generally done in PHP.

The library available under the Apache 2.0 License for download at:

http://code.google.com/p/cipaws/

Contributors and collaborators are welcome as it is hoped to grow this project to include a CI database driver.
#2

[eluser]bd3521[/eluser]
I wonder how the latency is relying on amazon for every db query.
#3

[eluser]Unknown[/eluser]
I suspect latency would be what you'd expect in using a remote database. There are cases where a local database has it's advantages. A value add of using SimpleDB is that AWS handles a lot of database management and scaling issues for you.
#4

[eluser]Unknown[/eluser]
It's a shame, but the library seems very buggy. I copied and pasted the sample code mentioned here http://code.google.com/p/cipaws/wiki/Samplesand I get all these PHP notices:

[code]
DROP TABLE orders
Status: OK. Box Usage: 0.0055590278. Response ID: 386c1502-5986-1d7c-a1e9-a735773bcd97

CREATE TABLE orders
Status: OK. Box Usage: 0.0055590278. Response ID: c7f08891-070f-9319-74e9-689dc7967c43

INSERT INTO TABLE orders
- 1: array(3) { ["order_date"]=> string(10) "2001-08-22" ["product_id"]=> string(6) "myPaws" ["quantity"]=> int(5) }
Status: OK. Box Usage: 0.0000219961. Response ID: 558dc3ad-77db-a32a-14cc-4a11eb0be093
- 2: array(3) { ["order_date"]=> string(10) "2005-11-08" ["product_id"]=> string(3) "aws" ["quantity"]=> int(3) }
Status: OK. Box Usage: 0.0000219961. Response ID: 295acb3b-f200-6b07-314f-1a560b95a691
- 3: array(3) { ["order_date"]=> string(10) "2007-03-24" ["product_id"]=> string(4) "paws" ["quantity"]=> int(7) }
Status: OK. Box Usage: 0.0000219961. Response ID: a6276352-9818-4695-ddb0-e573ef9880cf
- 4: array(3) { ["order_date"]=> string(10) "2006-10-09" ["product_id"]=> string(4) "paws" ["quantity"]=> int(8) }
Status: OK. Box Usage: 0.0000219961. Response ID: 44ddb11f-a877-7b8d-f0e3-dbf5421fc1fc
- 5: array(3) { ["order_date"]=> string(10) "2005-09-17" ["product_id"]=> string(4) "paws" ["quantity"]=> int(7) }
Status: OK. Box Usage: 0.0000219961. Response ID: 5af011a8-4a20-dc5b-2f9f-4f9ab25db202
- 6: array(3) { ["order_date"]=> string(10) "2007-06-06" ["product_id"]=> string(6) "myPaws" ["quantity"]=> int(1) }
Status: OK. Box Usage: 0.0000219961. Response ID: af3328eb-583a-9172-309b-5bbe7f11a7c3
- 7: array(3) { ["order_date"]=> string(10) "2004-01-19" ["product_id"]=> string(3) "aws" ["quantity"]=> int(9) }
Status: OK. Box Usage: 0.0000219961. Response ID: 0624df18-d30b-3866-1984-d791efbd1432
- 8: array(3) { ["order_date"]=> string(10) "2001-09-28" ["product_id"]=> string(4) "paws" ["quantity"]=> int(9) }
Status: OK. Box Usage: 0.0000219961. Response ID: f44dcfa2-2ede-d7f0-cfa5-ef9e2fc8d3ae
- 9: array(3) { ["order_date"]=> string(10) "2002-02-04" ["product_id"]=> string(3) "aws" ["quantity"]=> int(7) }
Status: OK. Box Usage: 0.0000219961. Response ID: ec47629a-e3d2-5804-26cd-2ee2b924f771

SELECT * FROM TABLE orders ORDER BY order_date
A PHP Error was encountered

Severity: Notice

Message: Undefined index: product_id

Filename: paws/pawsSDB.php

Line Number: 316

A PHP Error was encountered

Severity: Notice

Message: Undefined index: quantity

Filename: paws/pawsSDB.php

Line Number: 316

A PHP Error was encountered

Severity: Notice

Message: Undefined index: order_date

Filename: paws/pawsSDB.php

Line Number: 316

A PHP Error was encountered

Severity: Notice

Message: Undefined index: product_id

Filename: paws/pawsSDB.php

Line Number: 316

A PHP Error was encountered

Severity: Notice

Message: Undefined index: quantity

Filename: paws/pawsSDB.php

Line Number: 316

A PHP Error was encountered

Severity: Notice

Message: Undefined index: order_date

Filename: paws/pawsSDB.php

Line Number: 316

A PHP Error was encountered




Theme © iAndrew 2016 - Forum software by © MyBB