0
# Enhanced Libraries
1
2
High-level convenience libraries that provide simplified APIs for complex operations built on top of the core AWS service clients. These libraries offer enhanced functionality, better developer experience, and optimized performance for common use cases.
3
4
## Core Imports
5
6
```xml
7
<!-- Import BOM for version management -->
8
<dependencyManagement>
9
<dependencies>
10
<dependency>
11
<groupId>software.amazon.awssdk</groupId>
12
<artifactId>bom</artifactId>
13
<version>2.33.4</version>
14
<type>pom</type>
15
<scope>import</scope>
16
</dependency>
17
</dependencies>
18
</dependencyManagement>
19
```
20
21
## Capabilities
22
23
### S3 Transfer Manager
24
25
High-level library for efficient S3 upload, download, and copy operations with automatic multipart handling, progress tracking, and error recovery.
26
27
```xml { .api }
28
/**
29
* S3 Transfer Manager - High-level S3 transfer operations
30
* Features: Multipart uploads/downloads, progress tracking, resume capability
31
* Best for: Large file transfers, batch operations, production applications
32
*/
33
<dependency>
34
<groupId>software.amazon.awssdk</groupId>
35
<artifactId>s3-transfer-manager</artifactId>
36
<version>${awsjavasdk.version}</version>
37
</dependency>
38
```
39
40
**Key Features:**
41
- Automatic multipart upload/download for large files
42
- Progress tracking and bandwidth throttling
43
- Resume capability for interrupted transfers
44
- Concurrent transfer management
45
- Optimized for high throughput
46
47
**Usage Example:**
48
49
```xml
50
<dependencies>
51
<!-- S3 service client -->
52
<dependency>
53
<groupId>software.amazon.awssdk</groupId>
54
<artifactId>s3</artifactId>
55
</dependency>
56
57
<!-- S3 Transfer Manager -->
58
<dependency>
59
<groupId>software.amazon.awssdk</groupId>
60
<artifactId>s3-transfer-manager</artifactId>
61
</dependency>
62
63
<!-- Recommended: CRT client for best performance -->
64
<dependency>
65
<groupId>software.amazon.awssdk</groupId>
66
<artifactId>aws-crt-client</artifactId>
67
</dependency>
68
</dependencies>
69
```
70
71
### DynamoDB Enhanced Client
72
73
Object-relational mapping (ORM) library for DynamoDB providing type-safe operations, automatic marshalling, and advanced querying capabilities.
74
75
```xml { .api }
76
/**
77
* DynamoDB Enhanced Client - ORM for DynamoDB
78
* Features: Object mapping, type safety, advanced queries, batch operations
79
* Best for: Object-oriented applications, complex data models, type safety
80
*/
81
<dependency>
82
<groupId>software.amazon.awssdk</groupId>
83
<artifactId>dynamodb-enhanced</artifactId>
84
<version>${awsjavasdk.version}</version>
85
</dependency>
86
```
87
88
**Key Features:**
89
- Automatic object-to-item mapping
90
- Type-safe operations with compile-time checking
91
- Support for nested objects and collections
92
- Advanced query and scan operations
93
- Batch operations and transactions
94
- Projection and filtering support
95
96
**Usage Example:**
97
98
```xml
99
<dependencies>
100
<!-- DynamoDB service client -->
101
<dependency>
102
<groupId>software.amazon.awssdk</groupId>
103
<artifactId>dynamodb</artifactId>
104
</dependency>
105
106
<!-- DynamoDB Enhanced Client -->
107
<dependency>
108
<groupId>software.amazon.awssdk</groupId>
109
<artifactId>dynamodb-enhanced</artifactId>
110
</dependency>
111
</dependencies>
112
```
113
114
### S3 Event Notifications
115
116
Utilities for processing S3 event notifications from SQS, SNS, or Lambda triggers with automatic parsing and type safety.
117
118
```xml { .api }
119
/**
120
* S3 Event Notifications - Process S3 event messages
121
* Features: Event parsing, type safety, integration with messaging services
122
* Best for: Event-driven architectures, S3 trigger processing
123
*/
124
<dependency>
125
<groupId>software.amazon.awssdk</groupId>
126
<artifactId>s3-event-notifications</artifactId>
127
<version>${awsjavasdk.version}</version>
128
</dependency>
129
```
130
131
**Key Features:**
132
- Automatic parsing of S3 event messages
133
- Type-safe event data access
134
- Support for SQS, SNS, and Lambda event sources
135
- Event filtering and routing utilities
136
137
**Usage Example:**
138
139
```xml
140
<dependencies>
141
<!-- S3 service client -->
142
<dependency>
143
<groupId>software.amazon.awssdk</groupId>
144
<artifactId>s3</artifactId>
145
</dependency>
146
147
<!-- S3 Event Notifications -->
148
<dependency>
149
<groupId>software.amazon.awssdk</groupId>
150
<artifactId>s3-event-notifications</artifactId>
151
</dependency>
152
153
<!-- For SQS-based events -->
154
<dependency>
155
<groupId>software.amazon.awssdk</groupId>
156
<artifactId>sqs</artifactId>
157
</dependency>
158
</dependencies>
159
```
160
161
### IAM Policy Builder
162
163
Fluent API for constructing IAM policies with type safety, validation, and best practices enforcement.
164
165
```xml { .api }
166
/**
167
* IAM Policy Builder - Fluent IAM policy construction
168
* Features: Type-safe policy building, validation, best practices
169
* Best for: Dynamic policy generation, security automation
170
*/
171
<dependency>
172
<groupId>software.amazon.awssdk</groupId>
173
<artifactId>iam-policy-builder</artifactId>
174
<version>${awsjavasdk.version}</version>
175
</dependency>
176
```
177
178
**Key Features:**
179
- Fluent API for policy construction
180
- Type-safe resource ARN handling
181
- Built-in validation and best practices
182
- Support for conditions and advanced features
183
- JSON serialization and deserialization
184
185
**Usage Example:**
186
187
```xml
188
<dependencies>
189
<!-- IAM service client -->
190
<dependency>
191
<groupId>software.amazon.awssdk</groupId>
192
<artifactId>iam</artifactId>
193
</dependency>
194
195
<!-- IAM Policy Builder -->
196
<dependency>
197
<groupId>software.amazon.awssdk</groupId>
198
<artifactId>iam-policy-builder</artifactId>
199
</dependency>
200
</dependencies>
201
```
202
203
### CloudWatch Metric Publisher
204
205
Enhanced CloudWatch metrics publishing with batching, buffering, and automatic dimension management.
206
207
```xml { .api }
208
/**
209
* CloudWatch Metric Publisher - Enhanced metrics publishing
210
* Features: Batching, buffering, automatic retries, dimension management
211
* Best for: High-volume metrics, performance monitoring
212
*/
213
<dependency>
214
<groupId>software.amazon.awssdk</groupId>
215
<artifactId>cloudwatch-metric-publisher</artifactId>
216
<version>${awsjavasdk.version}</version>
217
</dependency>
218
```
219
220
**Key Features:**
221
- Automatic batching and buffering
222
- Intelligent retry handling
223
- Dimension management and validation
224
- Background publishing with minimal latency impact
225
- Integration with SDK metrics system
226
227
### EMF Metric Logging Publisher
228
229
Embedded Metric Format (EMF) publisher for CloudWatch Logs with automatic metric extraction.
230
231
```xml { .api }
232
/**
233
* EMF Metric Logging Publisher - Structured logging with metrics
234
* Features: EMF format, automatic metric extraction, cost optimization
235
* Best for: Lambda functions, container applications, cost-effective monitoring
236
*/
237
<dependency>
238
<groupId>software.amazon.awssdk</groupId>
239
<artifactId>emf-metric-logging-publisher</artifactId>
240
<version>${awsjavasdk.version}</version>
241
</dependency>
242
```
243
244
**Key Features:**
245
- Embedded Metric Format support
246
- Automatic CloudWatch metric creation from logs
247
- Cost-effective alternative to direct metric publishing
248
- Structured logging with metric extraction
249
- Lambda and container optimized
250
251
## Usage Examples
252
253
**S3 high-performance setup:**
254
255
```xml
256
<dependencies>
257
<!-- Core S3 -->
258
<dependency>
259
<groupId>software.amazon.awssdk</groupId>
260
<artifactId>s3</artifactId>
261
</dependency>
262
263
<!-- Enhanced S3 capabilities -->
264
<dependency>
265
<groupId>software.amazon.awssdk</groupId>
266
<artifactId>s3-transfer-manager</artifactId>
267
</dependency>
268
<dependency>
269
<groupId>software.amazon.awssdk</groupId>
270
<artifactId>s3-event-notifications</artifactId>
271
</dependency>
272
273
<!-- High-performance HTTP client -->
274
<dependency>
275
<groupId>software.amazon.awssdk</groupId>
276
<artifactId>aws-crt-client</artifactId>
277
</dependency>
278
</dependencies>
279
```
280
281
**DynamoDB with enhanced features:**
282
283
```xml
284
<dependencies>
285
<!-- Core DynamoDB -->
286
<dependency>
287
<groupId>software.amazon.awssdk</groupId>
288
<artifactId>dynamodb</artifactId>
289
</dependency>
290
291
<!-- Enhanced DynamoDB -->
292
<dependency>
293
<groupId>software.amazon.awssdk</groupId>
294
<artifactId>dynamodb-enhanced</artifactId>
295
</dependency>
296
</dependencies>
297
```
298
299
**Complete monitoring stack:**
300
301
```xml
302
<dependencies>
303
<!-- CloudWatch -->
304
<dependency>
305
<groupId>software.amazon.awssdk</groupId>
306
<artifactId>cloudwatch</artifactId>
307
</dependency>
308
<dependency>
309
<groupId>software.amazon.awssdk</groupId>
310
<artifactId>cloudwatchlogs</artifactId>
311
</dependency>
312
313
<!-- Enhanced monitoring -->
314
<dependency>
315
<groupId>software.amazon.awssdk</groupId>
316
<artifactId>cloudwatch-metric-publisher</artifactId>
317
</dependency>
318
<dependency>
319
<groupId>software.amazon.awssdk</groupId>
320
<artifactId>emf-metric-logging-publisher</artifactId>
321
</dependency>
322
</dependencies>
323
```
324
325
**Security and policy management:**
326
327
```xml
328
<dependencies>
329
<!-- IAM -->
330
<dependency>
331
<groupId>software.amazon.awssdk</groupId>
332
<artifactId>iam</artifactId>
333
</dependency>
334
335
<!-- Enhanced IAM -->
336
<dependency>
337
<groupId>software.amazon.awssdk</groupId>
338
<artifactId>iam-policy-builder</artifactId>
339
</dependency>
340
</dependencies>
341
```
342
343
## Performance Considerations
344
345
### S3 Transfer Manager
346
- Requires sufficient memory for concurrent transfers
347
- Works best with CRT HTTP client for maximum performance
348
- Configure thread pool sizes based on available resources
349
350
### DynamoDB Enhanced Client
351
- Adds object mapping overhead compared to low-level client
352
- Provides type safety benefits for complex data models
353
- Consider for applications prioritizing developer experience
354
355
### Metric Publishers
356
- CloudWatch Metric Publisher: Direct metrics with batching
357
- EMF Publisher: Cost-effective for high-volume scenarios
358
- Choose based on cost vs. latency requirements
359
360
## Types
361
362
```xml { .api }
363
<!-- Enhanced library dependency coordinates -->
364
<dependency>
365
<groupId>software.amazon.awssdk</groupId>
366
<artifactId>s3-transfer-manager</artifactId>
367
<version>${awsjavasdk.version}</version>
368
</dependency>
369
370
<dependency>
371
<groupId>software.amazon.awssdk</groupId>
372
<artifactId>dynamodb-enhanced</artifactId>
373
<version>${awsjavasdk.version}</version>
374
</dependency>
375
376
<dependency>
377
<groupId>software.amazon.awssdk</groupId>
378
<artifactId>s3-event-notifications</artifactId>
379
<version>${awsjavasdk.version}</version>
380
</dependency>
381
382
<dependency>
383
<groupId>software.amazon.awssdk</groupId>
384
<artifactId>iam-policy-builder</artifactId>
385
<version>${awsjavasdk.version}</version>
386
</dependency>
387
388
<dependency>
389
<groupId>software.amazon.awssdk</groupId>
390
<artifactId>cloudwatch-metric-publisher</artifactId>
391
<version>${awsjavasdk.version}</version>
392
</dependency>
393
394
<dependency>
395
<groupId>software.amazon.awssdk</groupId>
396
<artifactId>emf-metric-logging-publisher</artifactId>
397
<version>${awsjavasdk.version}</version>
398
</dependency>
399
```