- DynamoDB - Best Practices
- DynamoDB - Error Handling
- DynamoDB - Table Activity
- DynamoDB - MapReduce
- DynamoDB - CloudTrail
- DynamoDB - Monitoring
- DynamoDB - Data Backup
- DynamoDB - Data Pipeline
- Web Identity Federation
- DynamoDB - Conditions
- DynamoDB - Permissions API
- DynamoDB - Access Control
- DynamoDB - Aggregation
- Local Secondary Indexes
- Global Secondary Indexes
- DynamoDB - Indexes
- DynamoDB - Scan
- DynamoDB - Querying
- DynamoDB - Batch Retrieve
- DynamoDB - Batch Writing
- DynamoDB - Delete Items
- DynamoDB - Update Items
- DynamoDB - Getting Items
- DynamoDB - Creating Items
- DynamoDB - API Interface
- DynamoDB - Delete Table
- DynamoDB - Query Table
- DynamoDB - Load Table
- DynamoDB - Create Table
- DynamoDB - Data Types
- DynamoDB - Operations Tools
- DynamoDB - Environment
- DynamoDB - Basic Concepts
- DynamoDB - Overview
- DynamoDB - Home
DynamoDB Useful Resources
Selected Reading
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
选读
DynamoDB - Aggregation
DynamoDB does not provide aggregation functions. You must make creative use of queries, scans, indices, and assorted tools to perform these tasks. In all this, the throughput expense of queries/scans in these operations can be heavy.
You also have the option to use pbraries and other tools for your preferred DynamoDB coding language. Ensure their compatibipty with DynamoDB prior to using it.
Calculate Maximum or Minimum
Utipze the ascending/descending storage order of results, the Limit parameter, and any parameters which set order to find the highest and lowest values.
For example −
Map<String, AttributeValue> eaval = new HashMap<>(); eaval.put(":v1", new AttributeValue().withS("hashval")); queryExpression = new DynamoDBQueryExpression<Table>() .withIndexName("yourindexname") .withKeyConditionExpression("HK = :v1") .withExpressionAttributeValues(values) .withScanIndexForward(false); //descending order queryExpression.setLimit(1); QueryResultPage<Lookup> res = dynamoDBMapper.queryPage(Table.class, queryExpression);
Calculate Count
Use DescribeTable to get a count of the table items, however, note that it provides stale data. Also, utipze the Java getScannedCount method.
Utipze LastEvaluatedKey to ensure it depvers all results.
For example −
ScanRequest scanRequest = new ScanRequest().withTableName(yourtblName); ScanResult yourresult = cpent.scan(scanRequest); System.out.println("#items:" + yourresult.getScannedCount());
Calculating Average and Sum
Utipze indices and a query/scan to retrieve and filter values before processing. Then simply operate on those values through an object.
Advertisements