background preloader

Amazon RDS & DynamoDB

Facebook Twitter

How to integrate Amazon AWS PHP SDK with Zend Framework. I was really excited when I heard that Amazon released the AWS PHP SDK.

How to integrate Amazon AWS PHP SDK with Zend Framework

They hired the developer behind CloudFusion, Ryan Parman. Some things lend themselves well to a library, because they aren’t that fast-moving. Zend Framework’s services are extremely useful. However, if you’ve ever attended a talk by one of the AWS devs, they inevitably reach a slide where they show you the list of products they’ve released and when. The pace is rather impressive. Even Zend, with a huge list of contributors, will have a tough time keeping up. Connecting to MySQL using JDBC. How to install LAMP on a EC2 Amazon AMI. Launch the instance and connect with ssh.

How to install LAMP on a EC2 Amazon AMI

Update the server sudo yum update Install php and MySQL packages sudo yum install https mod_ssl mysql mysql-server php php-mysql php-xml. How to create a MySQL Workbench connection to Amazon EC2 server. I’ve been working with Amazon Web Services (AWS) Elastic Cloud Computing (EC2) quite a bit recently.

How to create a MySQL Workbench connection to Amazon EC2 server

I’ve also started working with Ubuntu at the same time. The result is the ability to quickly spin up new instances of Ubuntu server to use for various reasons without all the hassle of new hardware, or even alot of configuration headache. Using Amazon Machine Images (AMIs), an administrator can spin up an instance that is already configured, patched, and ready to run. Using this technique and technology that is new to me has created a bit of a learning curve, and one thing that caught me off guard was the need to use keypairs instead of username/password to access the servers, which is more secure, and is the default method for accessing AWS EC2 servers.

I was able to easily figure out how to access an AWS EC2 using a keypair with SSH command line, and Filezilla, but MySQL Workbench seemed a little more complex. Above you can see the diagram, which shows my new connection dialogue screen. DynamoDBMapper (AWS SDK for Java - 1.3.19) Object mapper for domain-object interaction with DynamoDB.

DynamoDBMapper (AWS SDK for Java - 1.3.19)

To use, annotate domain classes with the annotations found in the com.amazonaws.services.dynamodb.datamodeling package. A minimal example: @DynamoDBTable(tableName = "TestTable") public class TestClass { private Long key; private double rangeKey; private Long version; private Set<Integer> integerSetAttribute; @DynamoDBHashKey public Long getKey() { return key; } public void setKey(Long key) { this.key = key; } @DynamoDBRangeKey public double getRangeKey() { return rangeKey; } public void setRangeKey(double rangeKey) { this.rangeKey = rangeKey; } @DynamoDBAttribute(attributeName = "integerSetAttribute") public Set<Integer> getIntegerAttribute() { return integerSetAttribute; } public void setIntegerAttribute(Set<Integer> integerAttribute) { this.integerSetAttribute = integerAttribute; } @DynamoDBVersionAttribute public Long getVersion() { return version; } public void setVersion(Long version) { this.version = version; } }

Load Data into Tables Using the AWS SDK for Java in Amazon DynamoDB. In the preceding step, you created sample tables using the console.

Load Data into Tables Using the AWS SDK for Java in Amazon DynamoDB

Now, you can upload the sample data to these tables. The following Java code example uses the AWS SDK for Java to upload the sample data. For step-by-step instructions on configuring your AWS access keys, setting the default endpoint and running the sample, see Running Java Examples for DynamoDB. Note After you run this program, see Verify Data Load to view the tables and data in the DynamoDB console. Building Applications with DynamoDB. Backbone-dynamodb. Backbone.js sync for DynamoDB Server side Backbone.js sync implementation for DynamoDB.

backbone-dynamodb

Installation Execute the following command at the root of your project: npm install backbone-dynamodb AWS Credentials You can set the AWS credentials and region using any of the following methods: Client#scan — Documentation for amazonwebservices/aws-sdk-for-ruby (master) Using the Object Persistence Model with Amazon DynamoDB. The AWS SDK for Java provides a high-level object persistence model, enabling you to map your client-side classes to DynamoDB tables.

Using the Object Persistence Model with Amazon DynamoDB

The individual object instances then map to items in a table. The object persistence model provides a DynamoDBMapper class, which provides an entry point to DynamoDB. The DynamoDBMapper class provides you with a connection to the DynamoDB database and enables you to access your tables, perform various create, read, update and delete (CRUD) operations, and execute queries. Note The object persistence model lets you query database tables and perform item operations such as saving, updating, or deleting. The AWS SDK for Java provides a set of annotation types, so that you can map your classes to tables.

ProductCatalog(Id, ...) You can map a class in your client application to the ProductCatalog table as shown in the following Java code. In the preceding code, the @DynamoDBTable annotation type maps the CatalogItem class to the ProductCatalog table. Scanning Tables Using the AWS SDK for Java Low-Level API for Amazon DynamoDB. The scan method scans the entire table and you should therefore use queries to retrieve information.

Scanning Tables Using the AWS SDK for Java Low-Level API for Amazon DynamoDB

To learn more about performance related to scan and query operations, see Query and Scan Operations. Note This section explains the Java SDK low-level API. Query. TableName The name of the table containing the requested items.

Query

Type: String Length constraints: Minimum length of 3. Maximum length of 255. Required: Yes AttributesToGet The names of one or more attributes to retrieve. Query and Scan in Amazon DynamoDB. In addition to using primary keys to access and manipulate data, Amazon DynamoDB also provides two APIs for searching the data: Query and Scan.

Query and Scan in Amazon DynamoDB

QueryA Query operation searches for data in a table using only primary key attribute values. You must provide a hash key attribute name and a distinct value to search for. You can optionally provide a range key attribute name and value, and use a comparison operator to refine the search results. A query returns all of the item data for the matching primary keys (all of each item's attributes) up to 1 MB of data per query operation. A Query operation always returns results, but can return empty results.If your table has one or more secondary indexes, you can Query those indexes in the same way that you query a table.

Launch an Instance. Let's get started with Amazon Elastic Compute Cloud (Amazon EC2) by launching, connecting to, and using a Linux instance. We'll use the AWS Management Console, a point-and-click web-based interface, to complete the example architecture shown in the following diagram: The instance is an Amazon EBS-backed instance (meaning that the root volume is an Amazon EBS volume). We'll also create and attach an additional Amazon EBS volume. You can either specify the Availability Zone in which your instance runs, or let us select an Availability Zone for you. When you launch your instance, you secure it by specifying a key pair and security group. To complete this exercise, perform the following tasks: Related Topics. Amazon DynamoDB Data Model. Data Model Concepts - Tables, Items, and Attributes The DynamoDB data model concepts include tables, items and attributes.

In Amazon DynamoDB, a database is a collection of tables. A table is a collection of items and each item is a collection of attributes. In a relational database, a table has a predefined schema such as the table name, primary key, list of its column names and their data types. All records stored in the table must have the same set of columns. Tutorial EC2, configurando nuestra primera web en 10 pasos. AWS Toolkit for Eclipse: AWS Elastic Beanstalk. Getting Started with Amazon DynamoDB. DynamoDB. DynamoDB es un servicio de bases de datos NoSQL rápido y totalmente gestionado que permite almacenar y recuperar de manera fácil y económica cualquier cantidad de datos, así como atender cualquier nivel de tráfico de solicitudes. Todos los datos se almacenan en unidades de estado sólido (SSD) y se replican en 3 zonas de disponibilidad para obtener una mayor disponibilidad y durabilidad. Con DynamoDB, puede eliminar la carga administrativa que supone ejecutar y escalar un clúster de bases de datos distribuidas de gran disponibilidad, así como disfrutar de tarifas reducidas que se aplican únicamente al uso realizado.

Nuevo: Índices secundarios globales. DynamoDB FAQs. RDS for SQL Server - Free Usage Tier. AWS SDK for Java in AWS Toolkit for Eclipse. Relational Database Service (Amazon RDS) La capa gratuita de AWS incluye 750 h de microinstancias de base de datos cada mes durante un año, 20 GB de almacenamiento y 20 GB de capacidad para copias de seguridad con Amazon Relational Database Service (RDS). AWS Toolkit for Eclipse. Operations in Amazon DynamoDB. Amazon DynamoDB Developer Guide (API Version 2012-08-10) Operations in DynamoDB The DynamoDB API supports the following operations:

Limits in Amazon DynamoDB. Running Java Examples for Amazon DynamoDB. Step 2: Create Example Tables in Amazon DynamoDB. The getting started example covers the two following simple use cases. Use case 1: Product Catalog Suppose you want to store product information in DynamoDB. Each product you store has its own set of properties, and accordingly, you need to store different information about each of these products.

DynamoDB is a NoSQL database: Except for a required common primary key, individual items in a table can have any number of attributes. This enables you to save all the product data in the same table. Use case 2: Forum Application Amazon Web Services maintains several forums (see Discussion Forums) for customers to engage with the developer community, ask questions, or reply to other customer queries. In this exercise, we model this application by creating the three following tables. Working with Items Using the AWS SDK for Java Low-Level API for Amazon DynamoDB.

Overview (AWS SDK for Java - 1.3.22) AWS SDK for PHP 1.5.15. Regions and Endpoints - Amazon Web Services Glossary. To reduce data latency in your applications, most Amazon Web Services products allow you to select a regional endpoint to make your requests.