Docs Menu
Docs Home
/
Relational Migrator
/

์Šคํ‚ค๋งˆ ๋งคํ•‘

์ด ํŽ˜์ด์ง€์˜ ๋‚ด์šฉ

  • ๋งคํ•‘ ๊ทœ์น™
  • ์˜ˆ์‹œ
  • ํ…Œ์ด๋ธ” ๊ตฌ์กฐ ๋น„์ •๊ทœํ™” ์‚ฌ์šฉ ์‚ฌ๋ก€
  • ๋งคํ•‘ ๊ทœ์น™ ๊ฒฐ๊ณผ
  • ๋งคํ•‘ ๊ทœ์น™ ๊ตฌํ˜„

์Šคํ‚ค๋งˆ ๋งคํ•‘์€ ์†Œ์Šค ๊ด€๊ณ„ํ˜• ์Šคํ‚ค๋งˆ๊ฐ€ ๋Œ€์ƒ MongoDB database ์—์„œ ํ‘œํ˜„๋˜๋Š” ๋ฐฉ์‹์„ ๊ฒฐ์ •ํ•˜๋Š” ํ”„๋กœ์„ธ์Šค์ž…๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž ์ง€์ • ๋งคํ•‘ ๊ทœ์น™์„ ํ†ตํ•ด Relational Migrator์—์„œ ์Šคํ‚ค๋งˆ ๋งคํ•‘ ํ”„๋กœ์„ธ์Šค๋ฅผ ์ด‰์ง„ํ•ฉ๋‹ˆ๋‹ค.

์Šคํ‚ค๋งˆ ๋งคํ•‘ ์„ค๊ณ„ ํ”„๋กœ์„ธ์Šค ์ค‘์— Relational Migrator๋Š” ๊ด€๊ณ„ํ˜• ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์˜ ์Šคํ‚ค๋งˆ์—์„œ ์†Œ์Šค ๋ฐ์ดํ„ฐ ๋ชจ๋ธ์„ ์ž๋™์œผ๋กœ ํŒŒ์ƒํ•ฉ๋‹ˆ๋‹ค. ๋Œ€์ƒ ๋ฐ์ดํ„ฐ ๋ชจ๋ธ์€ ๋‹ค์Œ์„ ์‚ฌ์šฉ์ž ์ง€์ •ํ•˜์—ฌ ์˜ํ–ฅ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ๋งคํ•‘ ๊ทœ์น™ ์˜ต์…˜

  • ํ”„๋กœ์ ํŠธ ID ํ•„๋“œ ์˜ต์…˜

์Šคํ‚ค๋งˆ ๋งคํ•‘ ๊ฐœ๋…

์ด ์„น์…˜์—์„œ๋Š” ์Šคํ‚ค๋งˆ ๋งคํ•‘ ํ”„๋กœ์„ธ์Šค์— ๋Œ€ํ•œ ์‹œ๋‚˜๋ฆฌ์˜ค์™€ ๊ตฌํ˜„ ์˜ˆ์‹œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด ์˜ˆ์ œ์—์„œ๋Š” ๊ด€๊ณ„ํ˜• ๋ฐ์ดํ„ฐ ๋ชจ๋ธ์„ MongoDB ๋ฐ์ดํ„ฐ ๋ชจ๋ธ๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

MongoEnterprises relational database๋ฅผ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ ๋ชฉํ‘œ๋Š” database์˜ ๋ชจ๋“  ํ…Œ์ด๋ธ”์„ ํ‰๋ฉดํ™”ํ•˜์—ฌ ๋ชจ๋“  ์ฃผ๋ฌธ ๋ฐ ๊ณ ๊ฐ ๋ฐ์ดํ„ฐ๋ฅผ ๋‹จ์ผ MongoDB collection์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

๋‹ค์Œ ์ด๋ฏธ์ง€๋Š” Relational Migrator๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋น„์ •๊ทœํ™”ํ•  ๊ด€๊ณ„ํ˜• ๋ฐ์ดํ„ฐ ๋ชจ๋ธ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

๊ด€๊ณ„ํ˜• Realm ๋ฐ์ดํ„ฐ ๋ชจ๋ธ

Relational Migrator๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ ๋ชฉํ‘œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ MongoDB ๋ฐ์ดํ„ฐ ๋ชจ๋ธ์„ ๋‹ฌ์„ฑํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. Order ์ปฌ๋ ‰์…˜์—๋Š” Customer, Order, Product ๋ฐ Order Line ํ…Œ์ด๋ธ”์˜ ๋ชจ๋“  ํ•˜์œ„ ์š”์†Œ๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ปฌ๋ ‰์…˜์—๋Š” ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜๋œ ํ…Œ์ด๋ธ”์— ๋Œ€ํ•œ ์ค‘์ฒฉ๋œ ๊ฐ์ฒด๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฒฐ๊ณผ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

{
"_id": {
"OrderID": 1
},
"CustomerID": 1,
"OrderStatusID": 1,
"TotalAmount": 550,
"Customer": {
"CustomerID": 1,
"Name": "Joelynn Fawthrop",
"Address1": "86 Dwight Pass",
"Address2": "Carregal",
"Address3": "3800-854"
},
"OrderLines": [
{
"OrderLineID": 1,
"OrderID": 1,
"ProductID": 1,
"Quantity": 1,
"Product": {
"ProductID": 1,
"Name": "MongoDB 5.0 Action Figure",
"Price": 50
}
},
{
"OrderLineID": 4,
"OrderID": 1,
"ProductID": 3,
"Quantity": 1,
"Product": {
"ProductID": 3,
"Name": "Gold Plated MongoDB Compass",
"Price": 500
}
}
],
"OrderStatus": {
"OrderStatusID": 1,
"Name": "Order Placed"
}
}

Relational Migrator๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋Œ€์ƒ ๋ฐ์ดํ„ฐ ๋ชจ๋ธ ๊ฒฐ๊ณผ๋ฅผ ๋‹ฌ์„ฑํ•˜๋ ค๋ฉด ๋‹ค์Œ ๋งคํ•‘ ๊ทœ์น™ ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜์—ฌ Order ํ…Œ์ด๋ธ”์„ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

๊ด€๊ณ„ํ˜• ํ…Œ์ด๋ธ”
๋งคํ•‘ ๊ทœ์น™ ์œ ํ˜•
๋ฃจํŠธ ๊ฒฝ๋กœ

์ฃผ๋ฌธ

์ƒˆ ๋ฌธ์„œ

N/A

OrderLine

OrderLines

๊ณ ๊ฐ

Customer

์ฃผ๋ฌธ ์ƒํƒœ

OrderStatus

์ œํ’ˆ

OrderLInes.Product

๋Œ์•„๊ฐ€๊ธฐ

๋งคํ•‘ ๊ทœ์น™