AWS DMS · Schema Conversion Tool

Move a database into AWS without taking it offline. DMS runs a replication instance that reads the source, writes the target, and — with CDC — keeps chasing the changes until you are ready to cut over. The source database stays available the whole time; that single property is why DMS is the answer to almost every "migrate with minimal downtime" question.

Chuyển một database lên AWS mà không phải tắt nó. DMS chạy một replication instance đọc nguồn, ghi đích, và — với CDC — bám theo mọi thay đổi cho tới lúc bạn sẵn sàng cắt chuyển. Database nguồn vẫn phục vụ suốt quá trình; chính đặc tính đó khiến DMS là đáp án cho gần như mọi câu hỏi "di trú với downtime tối thiểu".

SCT is the other half, and only sometimes. It rewrites the schema when the engine changes. Same engine on a new platform? You do not need it — and the exam will offer it to you anyway.

SCT là nửa còn lại, và chỉ đôi khi cần. Nó viết lại schema khi engine thay đổi. Cùng engine nhưng nền tảng mới? Bạn không cần nó — và đề thi vẫn cứ mời bạn chọn nó.

Reach for it / not the right toolKhi nào dùng / khi nào không

Reach for DMSChọn DMS

  • Lifting a production database to AWS with near-zero downtime — full load, then CDC until lag is flat, then flip the connection string.Đưa một database production lên AWS với downtime gần bằng không — full load, rồi CDC cho tới khi độ trễ phẳng, rồi đổi connection string.
  • Getting off a commercial engine: SQL Server or Oracle onto Aurora / PostgreSQL / MySQL. Pair it with SCT.Thoát khỏi engine thương mại: SQL Server hay Oracle sang Aurora / PostgreSQL / MySQL. Đi kèm với SCT.
  • Feeding an analytics or search copy from an OLTP database — into Redshift, S3, OpenSearch or Kinesis Data Streams, kept fresh by CDC.Nuôi một bản sao phục vụ phân tích hoặc tìm kiếm từ database OLTP — sang Redshift, S3, OpenSearch hay Kinesis Data Streams, luôn mới nhờ CDC.
  • Consolidating many small databases, or replicating continuously between two live systems for months, not just once.Gộp nhiều database nhỏ, hoặc sao chép liên tục giữa hai hệ thống đang chạy trong nhiều tháng, chứ không chỉ một lần.

Not the right toolKhông phải chỗ dùng

  • Moving files rather than rows — that's DataSync, Snow Family or Storage Gateway, not DMS.Chuyển file chứ không phải bản ghi — đó là DataSync, Snow Family hay Storage Gateway, không phải DMS.
  • Getting data out of OpenSearch. OpenSearch is a target only; there is no OpenSearch source endpoint, ever.Lấy dữ liệu ra khỏi OpenSearch. OpenSearch chỉ là đích; không bao giờ có source endpoint OpenSearch.
  • An in-place major version upgrade of the same instance — that's an RDS engine upgrade or a blue/green deployment.Nâng cấp phiên bản lớn tại chỗ trên cùng một instance — đó là engine upgrade của RDS hoặc blue/green deployment.
  • Porting stored procedures and application SQL. SCT flags them and converts what it can, but the leftovers are hand work.Chuyển stored procedure và SQL trong ứng dụng. SCT đánh dấu và chuyển được phần nào, phần còn lại phải làm tay.

Sources and targetsNguồn và đích

Most engines go both ways. The ones worth memorising are the one-way entries — the analytics and streaming destinations you can only write to, and the sources you can only read from. Phần lớn engine đi được cả hai chiều. Cái đáng thuộc là các dòng một chiều — những đích phân tích và streaming chỉ ghi vào được, và những nguồn chỉ đọc ra được.

EndpointEndpoint SourceNguồn TargetĐích
Oracle · MS SQL Server · MySQL · MariaDB · PostgreSQL · SAP — on-premises or on EC2Oracle · MS SQL Server · MySQL · MariaDB · PostgreSQL · SAP — on-premises hoặc trên EC2 ✓ ✓
MongoDB · DB2 — source side onlyMongoDB · DB2 — chỉ phía nguồn ✓ —
Azure SQL Database — the way in from AzureAzure SQL Database — đường vào từ Azure ✓ —
Amazon RDS, all engines including AuroraAmazon RDS, mọi engine kể cả Aurora ✓ ✓
Amazon S3 — files in, files outAmazon S3 — file vào, file ra ✓ ✓
DocumentDBDocumentDB ✓ ✓
Amazon Redshift — the warehouse landing zoneAmazon Redshift — bãi đáp cho kho dữ liệu — ✓
Amazon DynamoDB — relational rows flattened into itemsAmazon DynamoDB — hàng quan hệ được làm phẳng thành item — ✓
OpenSearch Service — target only, so DMS can never replicate OpenSearch data outOpenSearch Service — chỉ là đích, nên DMS không bao giờ sao chép dữ liệu OpenSearch ra ngoài — ✓
Kinesis Data Streams — CDC as an event streamKinesis Data Streams — CDC dưới dạng luồng sự kiện — ✓
Read the direction, not the nameĐọc chiều, đừng đọc tên A question that says "replicate the search index into a database" is dead on arrival — OpenSearch has no source endpoint. Same shape for Redshift, DynamoDB and Kinesis Data Streams: they receive, they don't emit. Câu hỏi kiểu "sao chép chỉ mục tìm kiếm vào một database" là sai ngay từ đầu — OpenSearch không có source endpoint. Redshift, DynamoDB và Kinesis Data Streams cũng vậy: chúng nhận, chúng không phát.

When SCT is needed — and when it isn'tKhi nào cần SCT — và khi nào không

One question decides it: does the engine change? If PostgreSQL stays PostgreSQL, the schema already speaks the target's language and SCT has nothing to do. Moving from on-premises to RDS is a change of platform, not of engine. Chỉ một câu hỏi quyết định: engine có đổi không? Nếu PostgreSQL vẫn là PostgreSQL thì schema đã nói đúng ngôn ngữ của đích và SCT chẳng có việc gì. Chuyển từ on-premises sang RDS là đổi nền tảng, không phải đổi engine.

Two migration paths compared. In the first, an on-premises PostgreSQL database flows through a DMS replication instance straight into RDS PostgreSQL, with no Schema Conversion Tool anywhere on the path, because the engine has not changed. In the second, an on-premises Oracle database first passes through the Schema Conversion Tool, which rewrites the schema, before reaching the replication instance and finally Aurora MySQL. The rule underneath states that the same engine needs DMS alone, a different engine needs SCT for the schema and then DMS for the rows. SAME ENGINE · PLATFORM CHANGES ONLY PostgreSQL on-premises replication instance EC2 · DMS runs here RDS PostgreSQL same engine no SCT nothing to do DIFFERENT ENGINE · SCT FIRST Oracle on-premises SCT rewrite schema replication instance moves the rows Aurora MySQL new engine the only question that matters: same engine DMS alone — RDS is just a platform different engine SCT for the schema, then DMS for the rows SCT converts structure and never moves data; DMS moves data and never converts structure

Same shape on both rows — the only difference is the SCT box. If the engine name on the left matches the engine name on the right, that box disappears and the answer that offers SCT is the wrong answer.

Hai hàng cùng một hình dạng — khác biệt duy nhất là hộp SCT. Nếu tên engine bên trái trùng tên engine bên phải, hộp đó biến mất và đáp án nào có SCT chính là đáp án sai.

The trap, spelled outCái bẫy, nói thẳng "Migrate our on-premises PostgreSQL to RDS PostgreSQL — which tools?" The distractor is SCT + DMS. The answer is DMS on its own. RDS is a hosting platform; the engine never changed, so there is no schema to convert. "Di trú PostgreSQL on-premises sang RDS PostgreSQL — dùng công cụ nào?" Đáp án gây nhiễu là SCT + DMS. Đáp án đúng là chỉ DMS. RDS là nền tảng lưu trú; engine không hề đổi, nên không có schema nào để chuyển.

What SCT is actually for: OLTP — SQL Server or Oracle → MySQL, PostgreSQL, Aurora. OLAP — Teradata or Oracle → Redshift. It produces DDL for the target, plus an assessment report listing everything it could not convert automatically. SCT thực sự dùng cho: OLTP — SQL Server hay Oracle → MySQL, PostgreSQL, Aurora. OLAP — Teradata hay Oracle → Redshift. Nó sinh DDL cho đích, kèm báo cáo đánh giá liệt kê mọi thứ nó không tự chuyển được.

Task shapes and the cutoverCác dạng task và lúc cắt chuyển

Pick the task type from how much downtime you can afford. Full load + CDC is the default for anything live: copy everything, then chase the changes, then cut over in a maintenance minute rather than a maintenance weekend. Chọn loại task theo mức downtime bạn chịu được. Full load + CDC là mặc định cho mọi hệ thống đang chạy: sao hết, rồi bám theo thay đổi, rồi cắt chuyển trong một phút bảo trì thay vì cả cuối tuần bảo trì.

Full load Copy the existing rows once and stop. Fine for a frozen or read-only source; anything written after the snapshot is lost.Sao các hàng hiện có một lần rồi dừng. Ổn với nguồn đã đóng băng hoặc chỉ-đọc; mọi thứ ghi sau ảnh chụp sẽ mất.
Full load + CDC The normal choice. Bulk copy, then stream every change from the source logs until lag ≈ 0, then flip the application over.Lựa chọn thông thường. Sao khối lớn, rồi truyền mọi thay đổi từ log của nguồn cho tới khi độ trễ ≈ 0, rồi chuyển ứng dụng sang.
CDC only The target already holds the data — loaded by a dump, by Snowball, or by an earlier task — and only needs the ongoing deltas.Đích đã có sẵn dữ liệu — nạp bằng dump, bằng Snowball, hay bằng task trước đó — chỉ cần phần thay đổi tiếp theo.
Replication instance An EC2 instance you size. CPU, memory and its own storage for cached changes — undersize it and CDC falls behind for good.Một EC2 instance do bạn chọn size. CPU, bộ nhớ và storage riêng để cache thay đổi — chọn nhỏ quá thì CDC tụt lại mãi mãi.

Network: DMS reaches an on-premises or cross-account source over VPC peering, VPN (site-to-site or software) or Direct Connect. Nothing exotic — the replication instance simply needs a route and a port. Mạng: DMS chạm tới nguồn on-premises hay khác account qua VPC peering, VPN (site-to-site hoặc software) hay Direct Connect. Không có gì lạ — replication instance chỉ cần một đường đi và một cổng.

Oracle specifics worth carrying into the examChi tiết Oracle đáng mang vào phòng thi As a source, Oracle supports TDE (transparent data encryption) when DMS reads redo logs with BinaryReader rather than LogMiner. As a target, Oracle supports TDE and supports BLOBs in tables that have a primary key — no primary key, no LOB. Ở vai trò nguồn, Oracle hỗ trợ TDE (mã hoá dữ liệu trong suốt) khi DMS đọc redo log bằng BinaryReader thay vì LogMiner. Ở vai trò đích, Oracle hỗ trợ TDE và hỗ trợ BLOB trong bảng có primary key — không có primary key thì không có LOB.

Snowball + DMS for very large migrationsSnowball + DMS cho khối dữ liệu rất lớn

When the database runs to many terabytes, the constraint is the wire, not the database. Ship the bulk on a Snowball Edge device and let DMS handle only the delta. SCT does the local extraction here — that is the one job where SCT touches data rather than schema. Khi database lên tới nhiều terabyte, nút thắt là đường truyền chứ không phải database. Gửi phần khối lớn bằng thiết bị Snowball Edge và để DMS chỉ lo phần chênh lệch. SCT làm việc trích xuất tại chỗ ở đây — đó là công việc duy nhất mà SCT động vào dữ liệu chứ không phải schema.

A four stage pipeline for very large migrations. Stage one, the Schema Conversion Tool runs data extraction agents locally and writes the extracted data onto a Snowball Edge device. Stage two, the device is shipped back to AWS. Stage three, AWS receives it and the device loads its data into an Amazon S3 bucket. Stage four, DMS reads those files from S3 and migrates the data into the target data store. Underneath, a parallel change data capture flow shows the source database staying live while its ongoing changes are written to the same S3 bucket and then applied to the target, so cutover happens when the lag reaches zero. BULK · SHIPPED ON A DEVICE 1 · EXTRACT SCT extraction agents, locally onto Snowball 2 · SHIP Snowball Edge travels back to AWS 3 · LOAD TO S3 AWS loads it into an S3 bucket automatically 4 · DMS MIGRATES DMS reads S3 writes the target data store MEANWHILE · CDC OVER THE WIRE source DB stays live changes keep coming CDC updates written to the same S3 bucket DMS applies them to the target cut over when lag is flat one bucket serves both flows the bulk travels by truck, the delta travels by wire SCT extracts the data here — the one time it handles rows, not schema S3 is always the hand-off point between the device and DMS

S3 is the join. The device empties into a bucket, CDC writes into the same bucket, and DMS is the only thing that ever touches the target — so the target is consistent whichever path a row arrived by.

S3 là điểm gặp. Thiết bị đổ vào một bucket, CDC ghi vào chính bucket đó, và DMS là thứ duy nhất chạm tới đích — nên đích vẫn nhất quán dù một bản ghi đến bằng đường nào.

Things that catch you outNhững chỗ dễ vấp

  • DMS does not create a good schema. It will create bare tables if the target is empty, but no secondary indexes, no foreign keys, no sequences worth having. Real projects run SCT or hand-written DDL first, then load — and add indexes after the full load, not before. DMS không tạo ra schema tử tế. Nó tạo bảng trần nếu đích rỗng, nhưng không có index phụ, không khoá ngoại, không sequence đáng dùng. Dự án thật chạy SCT hoặc DDL viết tay trước rồi mới nạp — và tạo index sau full load, không phải trước.
  • CDC needs the source configured for it. Supplemental logging on Oracle, binlog_format = ROW on MySQL, logical replication and a replication slot on PostgreSQL. Miss this and the full load succeeds while CDC quietly captures nothing. CDC cần nguồn được cấu hình sẵn. Supplemental logging trên Oracle, binlog_format = ROW trên MySQL, logical replication và replication slot trên PostgreSQL. Bỏ qua thì full load vẫn xong còn CDC lặng lẽ không bắt được gì.
  • The replication instance is yours to size. It has its own storage for cached changes; if the target writes slower than the source changes, that cache fills and the task fails. Multi-AZ is an option, and it doubles the cost. Replication instance là của bạn, bạn chọn size. Nó có storage riêng để cache thay đổi; nếu đích ghi chậm hơn tốc độ thay đổi ở nguồn, cache đầy và task hỏng. Multi-AZ là tuỳ chọn, và nó nhân đôi chi phí.
  • SCT is not one-click. The assessment report is the deliverable: it tells you which stored procedures, triggers and proprietary types need manual rewriting. Budget engineering time for the leftovers — that is where heterogeneous projects overrun. SCT không phải một cú nhấp. Báo cáo đánh giá mới là sản phẩm chính: nó cho biết stored procedure, trigger và kiểu dữ liệu độc quyền nào phải viết lại tay. Hãy dự trù thời gian kỹ thuật cho phần còn lại — đó là chỗ dự án khác engine bị vỡ tiến độ.
  • Migrating into DynamoDB or S3 means flattening a relational model. You supply object mapping rules; DMS will not invent a partition key or denormalise your joins for you. Di trú vào DynamoDB hay S3 nghĩa là làm phẳng mô hình quan hệ. Bạn phải cung cấp quy tắc object mapping; DMS sẽ không tự nghĩ ra partition key hay tự bỏ chuẩn hoá các phép join giúp bạn.
  • LOBs are the slow lane. Large objects are migrated separately from the rest of the row, and on an Oracle target they need a primary key on the table. Limited-LOB mode is fast but truncates anything past the size you set. LOB là làn chậm. Đối tượng lớn được chuyển tách rời phần còn lại của hàng, và với đích Oracle thì bảng phải có primary key. Chế độ limited-LOB nhanh nhưng cắt cụt mọi thứ vượt kích thước bạn đặt.

Exam reflexesPhản xạ khi thi

The question says…Đề nói… AnswerTrả lời
"Migrate on-premises PostgreSQL to RDS PostgreSQL""Di trú PostgreSQL on-premises sang RDS PostgreSQL" DMS alone — no SCT. Same engine; RDS is only the platformChỉ DMS — không cần SCT. Cùng engine; RDS chỉ là nền tảng
"Move Oracle or SQL Server onto Aurora""Chuyển Oracle hay SQL Server sang Aurora" SCT for the schema, then DMS for the data — heterogeneousSCT cho schema, rồi DMS cho dữ liệu — khác engine
"The database must stay online / minimal downtime""Database phải luôn online / downtime tối thiểu" DMS full load + CDC, cut over when lag reaches zeroDMS full load + CDC, cắt chuyển khi độ trễ về không
"Many terabytes, and the link is too slow""Nhiều terabyte, mà đường truyền quá chậm" SCT extracts → Snowball Edge → S3 → DMS, with CDC over the wireSCT trích xuất → Snowball Edge → S3 → DMS, còn CDC đi qua đường mạng
"Replicate OpenSearch data into another store""Sao chép dữ liệu OpenSearch sang kho khác" Not with DMS — OpenSearch is a target only, never a sourceKhông dùng DMS được — OpenSearch chỉ là đích, không bao giờ là nguồn
"Keep an analytics copy in Redshift continuously fresh""Giữ bản sao phân tích trong Redshift luôn mới" DMS CDC task with Redshift as the target endpointTask DMS CDC với Redshift làm target endpoint
"Source is Oracle with TDE and we need change capture""Nguồn là Oracle có TDE và cần bắt thay đổi" Read the redo logs with BinaryReader, not LogMinerĐọc redo log bằng BinaryReader, không phải LogMiner