- 浏览: 2551617 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
AMAZON DynamoDB(2)Local DB
Download the latest DynamoDB on Local
>wget https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz
Put the directory to a location, command to start the DB
>java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
Initializing DynamoDB Local with the following configuration:
Port:8000
InMemory:false
DbPath:null
SharedDb:true
shouldDelayTransientStatuses:false
CorsParams:*
Some parameters
-cors CORS for javascript
-dbPath
-delayTransientStatuses
-help
-inMemory
-optimizeDbBeforeStartup
-port
-sharedDb //all clients with the same set of tables
List the tables
> aws dynamodb list-tables --endpoint-url http://localhost:8000
{
"TableNames": []
}
Command Line from Client
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.CLI.html
Create table Music, Partition Key is Artist, Sort Key is SongTitle
> aws dynamodb create-table \
> --table-name Music \
> --attribute-definitions \
> AttributeName=Artist,AttributeType=S \
> AttributeName=SongTitle,AttributeType=S \
> --key-schema AttributeName=Artist,KeyType=HASH AttributeName=SongTitle,KeyType=RANGE \
> --provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1 \
> --endpoint-url http://localhost:8000
{
"TableDescription": {
"TableArn": "arn:aws:dynamodb:ddblocal:000000000000:table/Music",
"AttributeDefinitions": [
{
"AttributeName": "Artist",
"AttributeType": "S"
},
{
"AttributeName": "SongTitle",
"AttributeType": "S"
}
],
"ProvisionedThroughput": {
"NumberOfDecreasesToday": 0,
"WriteCapacityUnits": 1,
"LastIncreaseDateTime": 0.0,
"ReadCapacityUnits": 1,
"LastDecreaseDateTime": 0.0
},
"TableSizeBytes": 0,
"TableName": "Music",
"TableStatus": "ACTIVE",
"KeySchema": [
{
"KeyType": "HASH",
"AttributeName": "Artist"
},
{
"KeyType": "RANGE",
"AttributeName": "SongTitle"
}
],
"ItemCount": 0,
"CreationDateTime": 1520271161.651
}
}
Put Some Data into The Table
> aws dynamodb put-item \
> --table-name Music \
> --item \
> '{"Artist": {"S": "No One You Know"}, "SongTitle": {"S": "Call Me Today"}, "AlbumTitle": {"S": "Somewhat Famous"}}' \
> --return-consumed-capacity TOTAL \
> --endpoint-url http://localhost:8000
> aws dynamodb put-item --table-name Music --item '{ "Artist": {"S":"Carl Luo"}, "SongTitle": {"S": "Fly in the sky"}, "AlbumTitle":{"S": "Songs About Life"} }' --return-consumed-capacity TOTAL --endpoint-url http://localhost:8000
Query the data
> aws dynamodb query --table-name Music --key-conditions file:///opt/dynamodb/condition.json --endpoint-url http://localhost:8000
{
"Count": 1,
"Items": [
{
"Artist": {
"S": "No One You Know"
},
"SongTitle": {
"S": "Call Me Today"
},
"AlbumTitle": {
"S": "Somewhat Famous"
}
}
],
"ScannedCount": 1,
"ConsumedCapacity": null
}
The condition.json file is as follow:
cat condition.json
{
"Artist": {
"AttributeValueList": [
{
"S": "No One You Know"
}
],
"ComparisonOperator": "EQ"
},
"SongTitle": {
"AttributeValueList": [
{
"S": "Call Me Today"
}
],
"ComparisonOperator": "EQ"
}
}
Here is one JavaScript Shell
http://localhost:8000/shell/#
Create tables and loading sample Data
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SampleData.html
References:
http://sillycat.iteye.com/blog/2410028
Download the latest DynamoDB on Local
>wget https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz
Put the directory to a location, command to start the DB
>java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
Initializing DynamoDB Local with the following configuration:
Port:8000
InMemory:false
DbPath:null
SharedDb:true
shouldDelayTransientStatuses:false
CorsParams:*
Some parameters
-cors CORS for javascript
-dbPath
-delayTransientStatuses
-help
-inMemory
-optimizeDbBeforeStartup
-port
-sharedDb //all clients with the same set of tables
List the tables
> aws dynamodb list-tables --endpoint-url http://localhost:8000
{
"TableNames": []
}
Command Line from Client
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.CLI.html
Create table Music, Partition Key is Artist, Sort Key is SongTitle
> aws dynamodb create-table \
> --table-name Music \
> --attribute-definitions \
> AttributeName=Artist,AttributeType=S \
> AttributeName=SongTitle,AttributeType=S \
> --key-schema AttributeName=Artist,KeyType=HASH AttributeName=SongTitle,KeyType=RANGE \
> --provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1 \
> --endpoint-url http://localhost:8000
{
"TableDescription": {
"TableArn": "arn:aws:dynamodb:ddblocal:000000000000:table/Music",
"AttributeDefinitions": [
{
"AttributeName": "Artist",
"AttributeType": "S"
},
{
"AttributeName": "SongTitle",
"AttributeType": "S"
}
],
"ProvisionedThroughput": {
"NumberOfDecreasesToday": 0,
"WriteCapacityUnits": 1,
"LastIncreaseDateTime": 0.0,
"ReadCapacityUnits": 1,
"LastDecreaseDateTime": 0.0
},
"TableSizeBytes": 0,
"TableName": "Music",
"TableStatus": "ACTIVE",
"KeySchema": [
{
"KeyType": "HASH",
"AttributeName": "Artist"
},
{
"KeyType": "RANGE",
"AttributeName": "SongTitle"
}
],
"ItemCount": 0,
"CreationDateTime": 1520271161.651
}
}
Put Some Data into The Table
> aws dynamodb put-item \
> --table-name Music \
> --item \
> '{"Artist": {"S": "No One You Know"}, "SongTitle": {"S": "Call Me Today"}, "AlbumTitle": {"S": "Somewhat Famous"}}' \
> --return-consumed-capacity TOTAL \
> --endpoint-url http://localhost:8000
> aws dynamodb put-item --table-name Music --item '{ "Artist": {"S":"Carl Luo"}, "SongTitle": {"S": "Fly in the sky"}, "AlbumTitle":{"S": "Songs About Life"} }' --return-consumed-capacity TOTAL --endpoint-url http://localhost:8000
Query the data
> aws dynamodb query --table-name Music --key-conditions file:///opt/dynamodb/condition.json --endpoint-url http://localhost:8000
{
"Count": 1,
"Items": [
{
"Artist": {
"S": "No One You Know"
},
"SongTitle": {
"S": "Call Me Today"
},
"AlbumTitle": {
"S": "Somewhat Famous"
}
}
],
"ScannedCount": 1,
"ConsumedCapacity": null
}
The condition.json file is as follow:
cat condition.json
{
"Artist": {
"AttributeValueList": [
{
"S": "No One You Know"
}
],
"ComparisonOperator": "EQ"
},
"SongTitle": {
"AttributeValueList": [
{
"S": "Call Me Today"
}
],
"ComparisonOperator": "EQ"
}
}
Here is one JavaScript Shell
http://localhost:8000/shell/#
Create tables and loading sample Data
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SampleData.html
References:
http://sillycat.iteye.com/blog/2410028
发表评论
-
Update Site will come soon
2021-06-02 04:10 1677I am still keep notes my tech n ... -
NodeJS12 and Zlib
2020-04-01 07:44 475NodeJS12 and Zlib It works as ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 336Traefik 2020(1)Introduction and ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 435Private Registry 2020(1)No auth ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 384Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 478NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 423Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 337Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 247GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 450GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 328GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 314Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 317Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 293Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 312Serverless with NodeJS and Tenc ... -
NodeJS MySQL Library and npmjs
2020-02-07 06:21 288NodeJS MySQL Library and npmjs ... -
Python Library 2019(1)requests and aiohttp
2019-12-18 01:12 261Python Library 2019(1)requests ... -
Hadoop Docker 2019 Version 3.2.1
2019-12-10 07:39 294Hadoop Docker 2019 Version 3.2. ... -
Nginx and Proxy 2019(1)Nginx Enable Lua and Parse JSON
2019-12-03 04:17 448Nginx and Proxy 2019(1)Nginx En ... -
Data Solution 2019(13)Docker Zeppelin Notebook and Memory Configuration
2019-11-09 07:15 294Data Solution 2019(13)Docker Ze ...
相关推荐
Amazon DynamoDB 是一个键/值和文档数据库,可以在任何规模的环境中提供个位数的毫秒级性能。它是一个完全托管、多区域多主的持久数据库,具有适用于 Internet 规模的应用程序的内置安全性、备份和恢复和内存缓存。...
DynamoDBLocal-1.11.86.jar
Amazon DynamoDB Local 的包装器,用于从 Node.js 启动和停止它。 这个模块包装了亚马逊的 。 它只是公开了一种叫做spawn()方法,它只不过是调用并返回它的结果。 const dynamoDbLocalProcess = dynamoDbLocal . ...
无服务器dynamodb本地 该插件需要 无服务器@ ^ 1 Java Runtime Engine(JRE)版本6.x或更高版本 产品特点 在本地安装DynamoDB 使用支持的所有参数(例如端口,inMemory... 启动DynamoDB Local并迁移(DynamoDB将处理
关于这张图片此dynamodb本地容器图像: 将数据持久保存到shared-local-instance.db ,以便在重新启动和删除容器之后可以再次读取数据。 使用sharedDb,以便应用程序可以访问数据,而不受区域限制使用DynamoDb的默认...
您可以在Node.js程序中启动DynamoDB Local,并轻松指定数据库文件的位置。 发行说明可以在找到 正在安装 npm install local-dynamo 用法 从命令行: $ node bin/launch_local_dynamo.js --database_dir=/database...
本地DynamoDB 这是一个示例存储库, dynamoDB在...Config中的dynamoDB port在.env.local DYNAMO_PORT=8040 DYNAMO_ENDPOINT=http://localhost:8040 DynamoDB 通过AWS托管的无SQL数据库服务 可扩展,可靠 用例 参考
无服务器和DynamoDB Boilerplate脱机就绪 先决条件 >> V.6的NodeJ 全局安装无服务器 npm install -g serverless AWS-CLI生成凭证(允许伪造),请参阅:...在安装了aws-cli type following命令并设置了凭证之后...
Amazon DynamoDB 是一种完全托管的 NoSQL 数据库服务,提供快速且可预测的性能,同时还能够实现无缝扩展。使用 DynamoDB,您可以免除操作和扩展分布式数据库的管理工作负担,因而无需担心硬件预置、设置和配置、复制...
在AWS(Amazon Web Services)的云服务矩阵中,DynamoDB、ElasticCache、RDS(Relational Database Service)以及RedShift和SimpleDB是五个非常关键的数据存储和管理服务,它们各自针对不同的数据处理场景和需求。...
java8集合源码用于管理研究数据湖的 AWS SAM 应用程序 这是一个示例应用程序,用于演示如何使用 AWS ...amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb -dbPath /data 创建 DynamoDB 表。
dynamodb管理员 , , 等的GUI。用法用作全局安装的应用npm install -g dynamodb-admin# For Windows:set DYNAMO_ENDPOINT=...
设置环境以在AWS EC2上运行visualApp应用程序: 1.Create an AWS EC2 instance and add the IAM role that has administrative privileges.2.SCP Upload the visualAPP.tar application onto EC2 using AWS ...
Amazon DynamoDB:构建NoSQL数据库驱动的应用程序 Amazon DynamoDB是一个键值和文档数据库,可在任何规模上提供单位毫秒的性能。 它是一个完全托管的,多区域,多活动,持久的数据库,具有针对Internet规模应用程序...
最近更新支持本地dynamodb流(v0.3) 滴下{electron,monorepo}以快速发展连接dynamodb-local(docker docker run -p 8000:8000 amazon/dynamodb-local ){ " region " : " dynamon " , " endpoint " : " ...
Amazon DynamoDB是一款由亚马逊提供的高性能、完全托管的NoSQL数据库服务,旨在提供极低延迟的数据访问。它非常适合需要高吞吐量、可预测性能以及对数据可用性和一致性有严格要求的应用程序。而`aws-dynamodb-scala`...
Amazon DynamoDB 设计模式 此存储库包含示例数据模型和源代码,用于演示 Amazon DynamoDB 的设计模式。 例子 数据模型和源代码在/examples文件夹下列出。 设备状态日志 - [数据模型] 网上商店 - [数据模型] 使用 ...
DynamoDB是亚马逊提供的完全托管的NoSQL数据库服务,允许用户无需管理服务器即可存储和检索任意量的数据。DynamoDB支持多种数据类型,包括标量值、文档和集合类型。它能够为数据提供快速的访问速度,并且能够自动...
DynamoDB Cookbook by Tanmay Deshpande, Over 90 hands-on recipes to design Internet scalable web and mobile applications with Amazon DynamoDB
弹簧数据动力学模型使用Spring-Data-Rest的Amazon DynamoDB Spring-Data存储库演示开始按照Amazon示例教程中的描述创建并填充Amazon DynamoDB“论坛”,“线程”和“回复”表: 使用您的DynamoDB终端节点和AWS凭证...