Author: alien

  • Khóa học miễn phí DynamoDB – Data Types nhận dự án làm có lương

    DynamoDB – Data Types



    Data types supported by DynamoDB include those specific to attributes, actions, and your coding language of choice.

    Attribute Data Types

    DynamoDB supports a large set of data types for table attributes. Each data type falls into one of the three following categories −

    • Scalar − These types represent a single value, and include number, string, binary, Boolean, and null.

    • Document − These types represent a complex structure possessing nested attributes, and include lists and maps.

    • Set − These types represent multiple scalars, and include string sets, number sets, and binary sets.

    Remember DynamoDB as a schemaless, NoSQL database that does not need attribute or data type definitions when creating a table. It only requires a primary key attribute data types in contrast to RDBMS, which require column data types on table creation.

    Scalars

    • Numbers − They are limited to 38 digits, and are either positive, negative, or zero.

    • String − They are Unicode using UTF-8, with a minimum length of >0 and maximum of 400KB.

    • Binary − They store any binary data, e.g., encrypted data, images, and compressed text. DynamoDB views its bytes as unsigned.

    • Boolean − They store true or false.

    • Null − They represent an unknown or undefined state.

    Document

    • List − It stores ordered value collections, and uses square ([…]) brackets.

    • Map − It stores unordered name-value pair collections, and uses curly ({…}) braces.

    Set

    Sets must contain elements of the same type whether number, string, or binary. The only limits placed on sets consist of the 400KB item size limit, and each element being unique.

    Action Data Types

    DynamoDB API holds various data types used by actions. You can review a selection of the following key types −

    • AttributeDefinition − It represents key table and index schema.

    • Capacity − It represents the quantity of throughput consumed by a table or index.

    • CreateGlobalSecondaryIndexAction − It represents a new global secondary index added to a table.

    • LocalSecondaryIndex − It represents local secondary index properties.

    • ProvisionedThroughput − It represents the provisioned throughput for an index or table.

    • PutRequest − It represents PutItem requests.

    • TableDescription − It represents table properties.

    Supported Java Datatypes

    DynamoDB provides support for primitive data types, Set collections, and arbitrary types for Java.


    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí DynamoDB – Create Table nhận dự án làm có lương

    DynamoDB – Create Table



    Creating a table generally consists of spawning the table, naming it, establishing its primary key attributes, and setting attribute data types.

    Utilize the GUI Console, Java, or another option to perform these tasks.

    Create Table using the GUI Console

    Create a table by accessing the console at . Then choose the “Create Table” option.

    GUI Console

    Our example generates a table populated with product information, with products of unique attributes identified by an ID number (numeric attribute). In the Create Table screen, enter the table name within the table name field; enter the primary key (ID) within the partition key field; and enter “Number” for the data type.

    Create Table

    After entering all information, select Create.

    Create Table using Java

    Use Java to create the same table. Its primary key consists of the following two attributes −

    • ID − Use a partition key, and the ScalarAttributeType N, meaning number.

    • Nomenclature − Use a sort key, and the ScalarAttributeType S, meaning string.

    Java uses the createTable method to generate a table; and within the call, table name, primary key attributes, and attribute data types are specified.

    You can review the following example −

    import java.util.Arrays;
    
    import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
    import com.amazonaws.services.dynamodbv2.document.DynamoDB;
    import com.amazonaws.services.dynamodbv2.document.Table;
    
    import com.amazonaws.services.dynamodbv2.model.AttributeDefinition;
    import com.amazonaws.services.dynamodbv2.model.KeySchemaElement;
    import com.amazonaws.services.dynamodbv2.model.KeyType;
    import com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput;
    import com.amazonaws.services.dynamodbv2.model.ScalarAttributeType;
    
    public class ProductsCreateTable {
       public static void main(String[] args) throws Exception {
          AmazonDynamoDBClient client = new AmazonDynamoDBClient()
             .withEndpoint("http://localhost:8000");
    
          DynamoDB dynamoDB = new DynamoDB(client);
          String tableName = "Products";
          try {
             System.out.println("Creating the table, wait...");
             Table table = dynamoDB.createTable (tableName,
                Arrays.asList (
                   new KeySchemaElement("ID", KeyType.HASH), // the partition key
                                                             // the sort key
                   new KeySchemaElement("Nomenclature", KeyType.RANGE)
                ),
                Arrays.asList (
                   new AttributeDefinition("ID", ScalarAttributeType.N),
                   new AttributeDefinition("Nomenclature", ScalarAttributeType.S)
                ),
                new ProvisionedThroughput(10L, 10L)
             );
             table.waitForActive();
             System.out.println("Table created successfully.  Status: " +
                table.getDescription().getTableStatus());
    
          } catch (Exception e) {
             System.err.println("Cannot create the table: ");
             System.err.println(e.getMessage());
          }
       }
    }
    

    In the above example, note the endpoint: .withEndpoint.

    It indicates the use of a local install by using the localhost. Also, note the required ProvisionedThroughput parameter, which the local install ignores.


    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí DynamoDB – Operations Tools nhận dự án làm có lương

    DynamoDB – Operations Tools



    DynamoDB provides three options for performing operations: a web-based GUI console, a JavaScript shell, and a programming language of your choice.

    In this tutorial, we will focus on using the GUI console and Java language for clarity and conceptual understanding.

    GUI Console

    The GUI console or the AWS Management Console for Amazon DynamoDB can be found at the following address −

    It allows you to perform the following tasks −

    • CRUD
    • View Table Items
    • Perform Table Queries
    • Set Alarms for Table Capacity Monitoring
    • View Table Metrics in Real-Time
    • View Table Alarms
    GUI Console

    If your DynamoDB account has no tables, on access, it guides you through creating a table. Its main screen offers three shortcuts for performing common operations −

    • Create Tables
    • Add and Query Tables
    • Monitor and Manage Tables

    The JavaScript Shell

    DynamoDB includes an interactive JavaScript shell. The shell runs inside a web browser, and the recommended browsers include Firefox and Chrome.

    JavaScript Shell

    Note − Using other browsers may result in errors.

    Access the shell by opening a web browser and entering the following address −http://localhost:8000/shell

    Use the shell by entering JavaScript in the left pane, and clicking the “Play” icon button in the top right corner of the left pane, which runs the code. The code results display in the right pane.

    DynamoDB and Java

    Use Java with DynamoDB by utilizing your Java development environment. Operations confirm to normal Java syntax and structure.


    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí DynamoDB – Delete Table nhận dự án làm có lương

    DynamoDB – Delete Table



    In this chapter, we will discuss regarding how we can delete a table and also the different ways of deleting a table.

    Table deletion is a simple operation requiring little more than the table name. Utilize the GUI console, Java, or any other option to perform this task.

    Delete Table using the GUI Console

    Perform a delete operation by first accessing the console at −

    .

    Choose Tables from the navigation pane, and choose the table desired for deletion from the table list as shown in the following screeenshot.

    Delete Table using the GUI Console

    Finally, select Delete Table. After choosing Delete Table, a confirmation appears. Your table is then deleted.

    Delete Table using Java

    Use the delete method to remove a table. An example is given below to explain the concept better.

    import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
    import com.amazonaws.services.dynamodbv2.document.DynamoDB;
    import com.amazonaws.services.dynamodbv2.document.Table;
    
    public class ProductsDeleteTable {
       public static void main(String[] args) throws Exception {
          AmazonDynamoDBClient client = new AmazonDynamoDBClient()
             .withEndpoint("http://localhost:8000");
    
          DynamoDB dynamoDB = new DynamoDB(client);
          Table table = dynamoDB.getTable("Products");
          try {
             System.out.println("Performing table delete, wait...");
             table.delete();
             table.waitForDelete();
             System.out.print("Table successfully deleted.");
          } catch (Exception e) {
             System.err.println("Cannot perform table delete: ");
             System.err.println(e.getMessage());
          }
       }
    }
    

    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí DynamoDB – Query Table nhận dự án làm có lương

    DynamoDB – Query Table



    Querying a table primarily requires selecting a table, specifying a partition key, and executing the query; with the options of using secondary indexes and performing deeper filtering through scan operations.

    Utilize the GUI Console, Java, or another option to perform the task.

    Query Table using the GUI Console

    Perform some simple queries using the previously created tables. First, open the console at

    Choose Tables from the navigation pane and select Reply from the table list. Then select the Items tab to see the loaded data.

    Select the data filtering link (“Scan: [Table] Reply”) beneath the Create Item button.

    Query Table using the GUI Console

    In the filtering screen, select Query for the operation. Enter the appropriate partition key value, and click Start.

    The Reply table then returns matching items.

    Reply Table

    Query Table using Java

    Use the query method in Java to perform data retrieval operations. It requires specifying the partition key value, with the sort key as optional.

    Code a Java query by first creating a querySpec object describing parameters. Then pass the object to the query method. We use the partition key from the previous examples.

    You can review the following example −

    import java.util.HashMap;
    import java.util.Iterator;
    
    import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
    import com.amazonaws.services.dynamodbv2.document.DynamoDB;
    import com.amazonaws.services.dynamodbv2.document.Item;
    import com.amazonaws.services.dynamodbv2.document.ItemCollection;
    import com.amazonaws.services.dynamodbv2.document.QueryOutcome;
    import com.amazonaws.services.dynamodbv2.document.Table;
    import com.amazonaws.services.dynamodbv2.document.spec.QuerySpec;
    import com.amazonaws.services.dynamodbv2.document.utils.NameMap;
    
    public class ProductsQuery {
       public static void main(String[] args) throws Exception {
          AmazonDynamoDBClient client = new AmazonDynamoDBClient()
             .withEndpoint("http://localhost:8000");
    
          DynamoDB dynamoDB = new DynamoDB(client);
          Table table = dynamoDB.getTable("Products");
          HashMap<String, String> nameMap = new HashMap<String, String>();
          nameMap.put("#ID", "ID");
          HashMap<String, Object> valueMap = new HashMap<String, Object>();
          valueMap.put(":xxx", 122);
          QuerySpec querySpec = new QuerySpec()
             .withKeyConditionExpression("#ID = :xxx")
             .withNameMap(new NameMap().with("#ID", "ID"))
             .withValueMap(valueMap);
    
          ItemCollection<QueryOutcome> items = null;
          Iterator<Item> iterator = null;
          Item item = null;
          try {
             System.out.println("Product with the ID 122");
             items = table.query(querySpec);
             iterator = items.iterator();
    
             while (iterator.hasNext()) {
                item = iterator.next();
                System.out.println(item.getNumber("ID") + ": "
                   + item.getString("Nomenclature"));
             }
          } catch (Exception e) {
             System.err.println("Cannot find products with the ID number 122");
             System.err.println(e.getMessage());
          }
       }
    }
    

    Note that the query uses the partition key, however, secondary indexes provide another option for queries. Their flexibility allows querying of non-key attributes, a topic which will be discussed later in this tutorial.

    The scan method also supports retrieval operations by gathering all the table data. The optional .withFilterExpression prevents items outside of specified criteria from appearing in results.

    Later in this tutorial, we will discuss scanning in detail. Now, take a look at the following example −

    import java.util.Iterator;
    
    import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
    import com.amazonaws.services.dynamodbv2.document.DynamoDB;
    import com.amazonaws.services.dynamodbv2.document.Item;
    import com.amazonaws.services.dynamodbv2.document.ItemCollection;
    import com.amazonaws.services.dynamodbv2.document.ScanOutcome;
    import com.amazonaws.services.dynamodbv2.document.Table;
    import com.amazonaws.services.dynamodbv2.document.spec.ScanSpec;
    import com.amazonaws.services.dynamodbv2.document.utils.NameMap;
    import com.amazonaws.services.dynamodbv2.document.utils.ValueMap;
    
    public class ProductsScan {
       public static void main(String[] args) throws Exception {
          AmazonDynamoDBClient client = new AmazonDynamoDBClient()
             .withEndpoint("http://localhost:8000");
    
          DynamoDB dynamoDB = new DynamoDB(client);
          Table table = dynamoDB.getTable("Products");
          ScanSpec scanSpec = new ScanSpec()
             .withProjectionExpression("#ID, Nomenclature , stat.sales")
             .withFilterExpression("#ID between :start_id and :end_id")
             .withNameMap(new NameMap().with("#ID",  "ID"))
             .withValueMap(new ValueMap().withNumber(":start_id", 120)
             .withNumber(":end_id", 129));
    
          try {
             ItemCollection<ScanOutcome> items = table.scan(scanSpec);
             Iterator<Item> iter = items.iterator();
    
             while (iter.hasNext()) {
                Item item = iter.next();
                System.out.println(item.toString());
             }
          } catch (Exception e) {
             System.err.println("Cannot perform a table scan:");
             System.err.println(e.getMessage());
          }
       }
    }
    

    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí DynamoDB – Load Table nhận dự án làm có lương

    DynamoDB – Load Table



    Loading a table generally consists of creating a source file, ensuring the source file conforms to a syntax compatible with DynamoDB, sending the source file to the destination, and then confirming a successful population.

    Utilize the GUI console, Java, or another option to perform the task.

    Load Table using GUI Console

    Load data using a combination of the command line and console. You can load data in multiple ways, some of which are as follows −

    • The Console
    • The Command Line
    • Code and also
    • Data Pipeline (a feature discussed later in the tutorial)

    However, for speed, this example uses both the shell and console. First, load the source data into the destination with the following syntax −

    aws dynamodb batch-write-item -–request-items file://[filename]
    

    For example −

    aws dynamodb batch-write-item -–request-items file://MyProductData.json
    

    Verify the success of the operation by accessing the console at −

    Choose Tables from the navigation pane, and select the destination table from the table list.

    Select the Items tab to examine the data you used to populate the table. Select Cancel to return to the table list.

    Load Table using Java

    Employ Java by first creating a source file. Our source file uses JSON format. Each product has two primary key attributes (ID and Nomenclature) and a JSON map (Stat) −

    [
       {
          "ID" : ... ,
          "Nomenclature" : ... ,
          "Stat" : { ... }
       },
       {
          "ID" : ... ,
          "Nomenclature" : ... ,
          "Stat" : { ... }
       },
        ...
    ]
    

    You can review the following example −

    {
       "ID" : 122,
       "Nomenclature" : "Particle Blaster 5000",
       "Stat" : {
          "Manufacturer" : "XYZ Inc.",
          "sales" : "1M+",
          "quantity" : 500,
          "img_src" : "http://www.xyz.com/manuals/particleblaster5000.jpg",
          "description" : "A laser cutter used in plastic manufacturing."
       }
    }
    

    The next step is to place the file in the directory used by your application.

    Java primarily uses the putItem and path methods to perform the load.

    You can review the following code example for processing a file and loading it −

    import java.io.File;
    import java.util.Iterator;
    
    import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
    import com.amazonaws.services.dynamodbv2.document.DynamoDB;
    import com.amazonaws.services.dynamodbv2.document.Item;
    import com.amazonaws.services.dynamodbv2.document.Table;
    
    import com.fasterxml.jackson.core.JsonFactory;
    import com.fasterxml.jackson.core.JsonParser;
    import com.fasterxml.jackson.databind.JsonNode;
    import com.fasterxml.jackson.databind.ObjectMapper
    import com.fasterxml.jackson.databind.node.ObjectNode;
    
    public class ProductsLoadData {
       public static void main(String[] args) throws Exception {
          AmazonDynamoDBClient client = new AmazonDynamoDBClient()
             .withEndpoint("http://localhost:8000");
    
          DynamoDB dynamoDB = new DynamoDB(client);
          Table table = dynamoDB.getTable("Products");
          JsonParser parser = new JsonFactory()
             .createParser(new File("productinfo.json"));
    
          JsonNode rootNode = new ObjectMapper().readTree(parser);
          Iterator<JsonNode> iter = rootNode.iterator();
          ObjectNode currentNode;
    
          while (iter.hasNext()) {
             currentNode = (ObjectNode) iter.next();
             int ID = currentNode.path("ID").asInt();
             String Nomenclature = currentNode.path("Nomenclature").asText();
    
             try {
                table.putItem(new Item()
                   .withPrimaryKey("ID", ID, "Nomenclature", Nomenclature)
                   .withJSON("Stat", currentNode.path("Stat").toString()));
                System.out.println("Successful load: " + ID + " " + Nomenclature);
             } catch (Exception e) {
                System.err.println("Cannot add product: " + ID + " " + Nomenclature);
                System.err.println(e.getMessage());
                break;
             }
          }
          parser.close();
       }
    }
    

    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí DynamoDB – Basic Concepts nhận dự án làm có lương

    DynamoDB – Basic Concepts



    Before using DynamoDB, you must familiarize yourself with its basic components and ecosystem. In the DynamoDB ecosystem, you work with tables, attributes, and items. A table holds sets of items, and items hold sets of attributes. An attribute is a fundamental element of data requiring no further decomposition, i.e., a field.

    Primary Key

    The Primary Keys serve as the means of unique identification for table items, and secondary indexes provide query flexibility. DynamoDB streams record events by modifying the table data.

    The Table Creation requires not only setting a name, but also the primary key; which identifies table items. No two items share a key. DynamoDB uses two types of primary keys −

    • Partition Key − This simple primary key consists of a single attribute referred to as the “partition key.” Internally, DynamoDB uses the key value as input for a hash function to determine storage.

    • Partition Key and Sort Key − This key, known as the “Composite Primary Key”, consists of two attributes.

      • The partition key and

      • The sort key.

      DynamoDB applies the first attribute to a hash function, and stores items with the same partition key together; with their order determined by the sort key. Items can share partition keys, but not sort keys.

    The Primary Key attributes only allow scalar (single) values; and string, number, or binary data types. The non-key attributes do not have these constraints.

    Secondary Indexes

    These indexes allow you to query table data with an alternate key. Though DynamoDB does not force their use, they optimize querying.

    DynamoDB uses two types of secondary indexes −

    • Global Secondary Index − This index possesses partition and sort keys, which can differ from table keys.

    • Local Secondary Index − This index possesses a partition key identical to the table, however, its sort key differs.

    API

    The API operations offered by DynamoDB include those of the control plane, data plane (e.g., creation, reading, updating, and deleting), and streams. In control plane operations, you create and manage tables with the following tools −

    • CreateTable
    • DescribeTable
    • ListTables
    • UpdateTable
    • DeleteTable

    In the data plane, you perform CRUD operations with the following tools −

    Create Read Update Delete

    PutItem

    BatchWriteItem

    GetItem

    BatchGetItem

    Query

    Scan

    UpdateItem

    DeleteItem

    BatchWriteItem

    The stream operations control table streams. You can review the following stream tools −

    • ListStreams
    • DescribeStream
    • GetShardIterator
    • GetRecords

    Provisioned Throughput

    In table creation, you specify provisioned throughput, which reserves resources for reads and writes. You use capacity units to measure and set throughput.

    When applications exceed the set throughput, requests fail. The DynamoDB GUI console allows monitoring of set and used throughput for better and dynamic provisioning.

    Read Consistency

    DynamoDB uses eventually consistent and strongly consistent reads to support dynamic application needs. Eventually consistent reads do not always deliver current data.

    The strongly consistent reads always deliver current data (with the exception of equipment failure or network problems). Eventually consistent reads serve as the default setting, requiring a setting of true in the ConsistentRead parameter to change it.

    Partitions

    DynamoDB uses partitions for data storage. These storage allocations for tables have SSD backing and automatically replicate across zones. DynamoDB manages all the partition tasks, requiring no user involvement.

    In table creation, the table enters the CREATING state, which allocates partitions. When it reaches ACTIVE state, you can perform operations. The system alters partitions when its capacity reaches maximum or when you change throughput.


    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí DynamoDB – Home nhận dự án làm có lương

    DynamoDB Tutorial

    DynamoDB Tutorial







    DynamoDB is a fully-managed NoSQL database service designed to deliver fast and predictable performance. It uses the Dynamo model in the essence of its design, and improves those features. It began as a way to manage website scalability challenges presented by the holiday season load.

    This tutorial introduces you to key DynamoDB concepts necessary for creating and deploying a highly-scalable and performance-focused database.

    Audience

    This tutorial targets IT professionals, students, and management professionals who want a solid grasp of essential DynamoDB concepts.

    After completing this tutorial, you will achieve intermediate expertise in DynamoDB, and easily build on your knowledge to solve more challenging problems.

    Prerequisites

    This tutorial assumes general knowledge of database technology, programming, Java or Java-like programming languages, and querying languages. It also assumes familiarity with typical database operations in an application.

    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí DynamoDB – Overview nhận dự án làm có lương

    DynamoDB – Overview



    DynamoDB allows users to create databases capable of storing and retrieving any amount of data, and serving any amount of traffic. It automatically distributes data and traffic over servers to dynamically manage each customer”s requests, and also maintains fast performance.

    DynamoDB vs. RDBMS

    DynamoDB uses a NoSQL model, which means it uses a non-relational system. The following table highlights the differences between DynamoDB and RDBMS −

    Common Tasks RDBMS DynamoDB
    Connect to the Source It uses a persistent connection and SQL commands. It uses HTTP requests and API operations
    Create a Table Its fundamental structures are tables, and must be defined. It only uses primary keys, and no schema on creation. It uses various data sources.
    Get Table Info All table info remains accessible Only primary keys are revealed.
    Load Table Data It uses rows made of columns. In tables, it uses items made of attributes
    Read Table Data It uses SELECT statements and filtering statements. It uses GetItem, Query, and Scan.
    Manage Indexes It uses standard indexes created through SQL statements. Modifications to it occur automatically on table changes. It uses a secondary index to achieve the same function. It requires specifications (partition key and sort key).
    Modify Table Data It uses an UPDATE statement. It uses an UpdateItem operation.
    Delete Table Data It uses a DELETE statement. It uses a DeleteItem operation.
    Delete a Table It uses a DROP TABLE statement. It uses a DeleteTable operation.

    Advantages

    The two main advantages of DynamoDB are scalability and flexibility. It does not force the use of a particular data source and structure, allowing users to work with virtually anything, but in a uniform way.

    Its design also supports a wide range of use from lighter tasks and operations to demanding enterprise functionality. It also allows simple use of multiple languages: Ruby, Java, Python, C#, Erlang, PHP, and Perl.

    Limitations

    DynamoDB does suffer from certain limitations, however, these limitations do not necessarily create huge problems or hinder solid development.

    You can review them from the following points −

    • Capacity Unit Sizes − A read capacity unit is a single consistent read per second for items no larger than 4KB. A write capacity unit is a single write per second for items no bigger than 1KB.

    • Provisioned Throughput Min/Max − All tables and global secondary indices have a minimum of one read and one write capacity unit. Maximums depend on region. In the US, 40K read and write remains the cap per table (80K per account), and other regions have a cap of 10K per table with a 20K account cap.

    • Provisioned Throughput Increase and Decrease − You can increase this as often as needed, but decreases remain limited to no more than four times daily per table.

    • Table Size and Quantity Per Account − Table sizes have no limits, but accounts have a 256 table limit unless you request a higher cap.

    • Secondary Indexes Per Table − Five local and five global are permitted.

    • Projected Secondary Index Attributes Per Table − DynamoDB allows 20 attributes.

    • Partition Key Length and Values − Their minimum length sits at 1 byte, and maximum at 2048 bytes, however, DynamoDB places no limit on values.

    • Sort Key Length and Values − Its minimum length stands at 1 byte, and maximum at 1024 bytes, with no limit for values unless its table uses a local secondary index.

    • Table and Secondary Index Names − Names must conform to a minimum of 3 characters in length, and a maximum of 255. They use the following characters: AZ, a-z, 0-9, “_”, “-”, and “.”.

    • Attribute Names − One character remains the minimum, and 64KB the maximum, with exceptions for keys and certain attributes.

    • Reserved Words − DynamoDB does not prevent the use of reserved words as names.

    • Expression Length − Expression strings have a 4KB limit. Attribute expressions have a 255-byte limit. Substitution variables of an expression have a 2MB limit.


    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí DynamoDB – Environment nhận dự án làm có lương

    DynamoDB – Environment



    The DynamoDB Environment only consists of using your Amazon Web Services account to access the DynamoDB GUI console, however, you can also perform a local install.

    Navigate to the following website −

    Click the “Get Started with Amazon DynamoDB” button, or the “Create an AWS Account” button if you do not have an Amazon Web Services account. The simple, guided process will inform you of all the related fees and requirements.

    After performing all the necessary steps of the process, you will have the access. Simply sign in to the AWS console, and then navigate to the DynamoDB console.

    Be sure to delete unused or unnecessary material to avoid associated fees.

    Local Install

    The AWS (Amazon Web Service) provides a version of DynamoDB for local installations. It supports creating applications without the web service or a connection. It also reduces provisioned throughput, data storage, and transfer fees by allowing a local database. This guide assumes a local install.

    When ready for deployment, you can make a few small adjustments to your application to convert it to AWS use.

    The install file is a .jar executable. It runs in Linux, Unix, Windows, and any other OS with Java support. Download the file by using one of the following links −

    • Tarball

    • Zip archive

    Note − Other repositories offer the file, but not necessarily the latest version. Use the links above for up-to-date install files. Also, ensure you have Java Runtime Engine (JRE) version 6.x or a newer version. DynamoDB cannot run with older versions.

    After downloading the appropriate archive, extract its directory (DynamoDBLocal.jar) and place it in the desired location.

    You can then start DynamoDB by opening a command prompt, navigating to the directory containing DynamoDBLocal.jar, and entering the following command −

    java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
    

    You can also stop the DynamoDB by closing the command prompt used to start it.

    Working Environment

    You can use a JavaScript shell, a GUI console, and multiple languages to work with DynamoDB. The languages available include Ruby, Java, Python, C#, Erlang, PHP, and Perl.

    In this tutorial, we use Java and GUI console examples for conceptual and code clarity. Install a Java IDE, the AWS SDK for Java, and setup AWS security credentials for the Java SDK in order to utilize Java.

    Conversion from Local to Web Service Code

    When ready for deployment, you will need to alter your code. The adjustments depend on code language and other factors. The main change merely consists of changing the endpoint from a local point to an AWS region. Other changes require deeper analysis of your application.

    A local install differs from the web service in many ways including, but not limited to the following key differences −

    • The local install creates tables immediately, but the service takes much longer.

    • The local install ignores throughput.

    • The deletion occurs immediately in a local install.

    • The reads/writes occur quickly in local installs due to the absence of network overhead.


    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc