boto3 vs AWS SDK for JavaScript v3: Design Philosophy
boto3 and the AWS SDK for JavaScript v3 solve the same problem with different philosophies.
Busca en todas las páginas de la documentación
boto3 and the AWS SDK for JavaScript v3 solve the same problem with different philosophies.
boto3 leans into a batteries-included Python experience: one install, method calls, and an optional higher-level resource layer. SDK v3 leans into modularity and the browser and Lambda constraints of JavaScript: per-service packages, a command pattern, and middleware.
This page compares them axis by axis. Every difference is about surface and packaging - the underlying AWS operations are identical.
pip install boto3 gives you every service; you never add a per-service dependency.@aws-sdk/client-<service> per service, keeping only what you use.aws-sdk v2 bundled everything like boto3; v3 deliberately broke that apart.# --- Python (boto3) ---
# pip install boto3 (covers every service)
import boto3
s3 = boto3.client("s3")
ddb = boto3.client("dynamodb")// --- TypeScript (AWS SDK v3) ---
// npm install @aws-sdk/client-s3 @aws-sdk/client-dynamodb
import { S3Client } from "@aws-sdk/client-s3";
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
const s3 = new S3Client({});
const ddb = new DynamoDBClient({});snake_case method hanging directly off the client (s3.list_buckets()).PascalCase Command object passed to client.send().# --- Python (boto3) ---
import boto3
s3 = boto3.client("s3")
response = s3.list_buckets() # operation is a method// --- TypeScript (AWS SDK v3) ---
import { S3Client, ListBucketsCommand } from "@aws-sdk/client-s3";
const s3 = new S3Client({});
const response = await s3.send(new ListBucketsCommand({})); // operation is a commandresource layer (s3.Bucket("x").objects.all()).lib-* helpers instead of a broad resource abstraction.# --- Python (boto3) ---
import boto3
# Resource layer: object-oriented convenience over the client.
s3 = boto3.resource("s3")
for obj in s3.Bucket("my-bucket").objects.all():
print(obj.key)// --- TypeScript (AWS SDK v3) ---
import { S3Client, paginateListObjectsV2 } from "@aws-sdk/client-s3";
// No resource layer: use the command/paginator surface directly.
const s3 = new S3Client({});
for await (const page of paginateListObjectsV2({ client: s3 }, { Bucket: "my-bucket" })) {
for (const obj of page.Contents ?? []) console.log(obj.Key);
}client.middlewareStack.add(...)).client.meta.events (for example before-send) rather than a Smithy middleware stack.dicts; optional type stubs (boto3-stubs/botocore-stubs) add hints if you want them.undefined, so you write ?? []; boto3 raises KeyError on missing keys.send returns a promise, so you await calls naturally in async JavaScript.Promise.all; boto3 uses threads or an async wrapper.No. Both are generated from the same service models, so operation coverage is effectively identical. The differences are packaging, surface, and helpers.
The command pattern lets v3 run each call through Smithy middleware and tree-shake unused operations, keeping browser and Lambda bundles small. boto3 has no such constraint on the server.
An optional object-oriented interface over the low-level client (for example s3.Bucket(...)). It is convenient but hides the exact API calls; SDK v3 has no equivalent broad resource layer.
Server-side Python does not pay a bundle penalty, so a monolith is convenient. JavaScript runs in browsers and Lambda where size matters, so v3 splits every service into its own package.
SDK v3 is TypeScript-first with strong input/output types. boto3 returns plain dicts by default, though optional stub packages add type hints for editors and type checkers.
SDK v3 exposes a middleware stack you add steps to. boto3 exposes an event system via client.meta.events. Both let you inspect or modify requests, through different mechanisms.
boto3 itself is synchronous. For async Python you use a separate library like aioboto3. SDK v3 is promise-based, so awaiting calls is the default.
No. It is convenience over the same operations. Anything a resource does, the low-level client can do; the resource just reads more naturally.
boto3 has no "v3" - that is the JavaScript SDK's major version. In JavaScript, use v3 (@aws-sdk/client-*), not the retired v2 monolith (aws-sdk).
boto3's method calls are terser and need no per-operation import, which many beginners find simpler. SDK v3's commands are more verbose but give strong typing and small bundles.
Packaging does. SDK v3's modularity yields smaller bundles and faster Lambda cold starts. The surface and resource-layer choices are mostly ergonomics, not runtime speed.
Stack versions: This page was written for boto3 1.43.x (Python 3.10+) and the AWS SDK for JavaScript v3 (Node.js 18+).
Revisado por Chris St. John·Última actualización: 23 jul 2026