1. Placement Groups
โถ Sometimes you want to control over the EC2 Instance placement strategy
โถ That strategy can be defined using placement groups
โถ When you create a placement group, you specify one of the following strategies for the group:
- Cluster: clusters instances into a low-latency group in a single Availability Zone
- Spread: spreads instances across underlying hardware (max 7 instances per group per AZ) - critical applications
- Partition: spreads instances across many different partitions (which rely on different sets of racks) within an AZ, Scales to 100s of EC2 instances per group (Hadoop, Cassaandra, Kafka)
๋ฐฐ์น๊ทธ๋ฃน์ด๋ AWS์์ EC2 ์ธ์คํด์ค์ ๋ฐฐ์น๋ฅผ ๊ฒฐ์ ํ๋ ๋ฐฉ์์ผ๋ก, ์ง์ ํ๋์จ์ด์ ์ํธ์์ฉํ์ง ์์ง๋ง ๋ฐฐ์น ์ ๋ต์ ์ง์ ํ ์ ์๋ค.
1. ํด๋ฌ์คํฐ ๋ฐฐ์น ๊ทธ๋ฃน (Cluster Placement Group)
โถ ๋จ์ผ ๊ฐ์ฉ ์์ญ(AZ) ๋ด์์ ์งง์ ์ง์ฐ ์๊ฐ, ๋์ ๋คํธ์ํฌ ์ฑ๋ฅ์ ์ ๊ณตํ๋๋ก ์ธ์คํด์ค๋ฅผ ๋ฐฐ์น
โถ HPC(High Performance Computing) ์ํฌ๋ก๋, ๊ธฐ๊ณ ํ์ต, ๋น
๋ฐ์ดํฐ ์ฒ๋ฆฌ์ ์ ํฉ
โถ ์ธ์คํด์ค๊ฐ์ ๊ฑฐ๋ฆฌ๋ฅผ ๋งค์ฐ ๊ฐ๊น๊ฒ ํด์ ๋คํธ์ํฌ ์ฑ๋ฅ์ ๊ทน๋ํ ํ๋ ๋ฐฉ๋ฒ
2. ๋ถ์ฐ ๋ฐฐ์น ๊ทธ๋ฃน (Spread Placement Group)
โถ ์ธ์คํด์ค๋ฅผ ๊ฐ๊ธฐ ๋ค๋ฅธ ํ๋์จ์ด ๋์ ๋ฐฐ์นํ์ฌ ์ฅ์ ๋ฐ์ ์ ์ํฅ์ ์ต์ํ
โถ ์ ํ์ฌํญ: ๊ฐ์ฉ ์์ญ(AZ)๋ณ๋ก ์ต๋ 7๊ฐ ์ธ์คํด์ค
โถ ์ค์ํ(Critical) ์ ํ๋ฆฌ์ผ์ด์
์ ์คํํ ๋ ์ฌ์ฉ
โถ ์ธ์คํด์ค๊ฐ์ ๊ฑฐ๋ฆฌ๋ฅผ ๋งค์ฐ ๋ฉ๋ฆฌ ์ค์ ํด์ ์ํฅ๊ณผ ๊ฐ์ญ์ ์ต์ํ
3. ๋ถํ ๋ฐฐ์น ๊ทธ๋ฃน (Partition Placement Group)
โถ ์ฌ๋ฌ ํํฐ์
(Partition) ์ ์ธ์คํด์ค๋ฅผ ๋ถ์ฐ ๋ฐฐ์นํ์ฌ ํน์ ํ๋์จ์ด ์ฅ์ ๋ก๋ถํฐ ๊ฒฉ๋ฆฌ
โถ ๊ฐ ํํฐ์
์ ์๋ก ๋ค๋ฅธ ํ๋์จ์ด ๋์ ์์นํ์ง๋ง, ๋์ผ ํํฐ์
๋ด์์๋ ๊ฒฉ๋ฆฌ๋์ง ์์
โถ ์๋ฐฑ ๊ฐ์ EC2 ์ธ์คํด์ค๋ก ํ์ฅ ๊ฐ๋ฅ
โถ Hadoop, Cassandra, Kafka ๊ฐ์ ๋ถ์ฐ ์์คํ
์ ์ ํฉ
1-1. Placement Groups Cluster
โถ All your EC2 intances are going to be in the same AZ
โถ Pros:
- Great network (10Gbps bandwidth between instances with Enhanced Networking enabled - recommanded)
- ๋ชจ๋ ์ธ์คํด์ค ๊ฐ์ ์ด๋น ์ฝ 10๊ธฐ๊ฐ๋ฐ์ดํธ์ ๋์ญํญ์ ํ๋ณดํ๊ธฐ ๋๋ฌธ์ ํฅ์๋ ๋คํธ์ํน์ ํ์ฑํ ํ ์ ์๋ค. ๋ฐ๋ผ์ ์ง์ฐ ์๊ฐ์ด ์งง๊ณ ์ฒ๋ฆฌ๋์ด ๋ง์ ๋คํธ์ํฌ๋ฅผ ํ๋ณดํ ์ ์๋ค. ๊ทธ๋์ ์ด๋ค ์ข ๋ฅ์ ๊ณ์ฐ ์์ ์์๋ ๋ฐ์ด๋ ์ฑ๋ฅ์ ์ป์ ์ ์๋ค.
โถ Cons:
- If the AZ fails, all instances fails at the same time
โถ Use case:
- Big Data job that needs to complete fast
- Application that needs extremely low latency and high network throughput
1-2. Placement Groups Spread
โถ Pros:
- Can span across Availability Zone (AZ)
- Reduced risk is simultaneous failure
- EC2 Instances are on different physical hardware
โถ Cons:
- Limited to 7 instances per AZ per placement group
โถ Use case:
- Application that needs to maximize high availability
- Critical Applications where each instance must be isolated from failure from each other
1-3. Placements Groups Partition
โถ Each partition represent a hardware rack in AWS
โถ Up to 7 partitions per AZ
โถ Can span across multiple AZs in the same region
โถ Up to 100s of EC2 instances
โถ The instances in a partition do not share racks with the instances in the other partitions
โถ A partition failure can affect many EC2 but won't affect other partitions
โถ EC2 instances get across to the partition information as metadata
โถ Use cases: ํํฐ์ ์ ์ธ์ํ๋ ๋น ๋ฐ์ดํฐ ์ ํ๋ฆฌ์ผ์ด์ such as HDFS, HBase, Cassandra, Kafka
1-4. ๋ฐฐ์น๊ทธ๋ฃน ์ค์ต
โ How to create placement group
- AWS ์ฝ์ → EC2 → "Placement groups" → "Create placement group"
- AWS CLI → aws ec2 create-placement-group --group-name my-group --strategy cluster
- Terraform → resource "aws_placement_group" "example" { name = "my-group" strategy = "cluster" }
โ How to launch Instances in a group
AWS ์ฝ์ ๋ก๊ทธ์ธ → EC2 ๋์๋ณด๋ ์ด๋ → ์ผ์ชฝ ๋ฉ๋ด์์ "์ธ์คํด์ค ์์(Launch Instances)" ํด๋ฆญ → Advanced Detail ํญ → Placement group name ์์ ์ค์
2. Elastic Network Interfaces (ENI)
2-1. What's ENI?
โถ Logical component in a VPC that represents a virtual network card
โถ The ENI can have the following attributes:
- Primary private IPv4, one or more secondary IPv4
- One Elastic IP (IPv4) per private IPv4
- One Public IPv4
- One or more security groups
- A MAC addres
โถ You can create ENI independently and attach them on the fly (move them) on EC2 instasnces for failover
โถ Bound to a specific availabity zone (AZ)
โญ ๊ธฐ๋ณธ ENI(Virtual Network Card)์ธ Eth0์ ์ฐ๊ฒฐ๋์ด EC2 ๋คํธ์ํฌ ์ฐ๊ฒฐ์ ์ ๊ณต
- Primary Private IP, 1๊ฐ ์ด์ Secondary IP
- Private IP ๋น 1๊ฐ์ Elastic IP
- 1๊ฐ์ Public IP
- 1๊ฐ ์ด์์ Security Group ์ฐ๊ฒฐ
- MAC Address
- EC2 ์ธ์คํด์ค์ ๋
๋ฆฝ์ ์ผ๋ก ์์ฑํ๊ณ ์ฆ์ ์ฐ๊ฒฐํ๊ฑฐ๋, Failover ์ํด EC2 ์ธ์คํด์ค์์ ์ด๋ ๊ฐ๋ฅ
- ํน์ AZ์ ์ข
์๋์ด ์์
๐ ์๋ฒ๋ฅผ ์ ์ง๋ณด์ํ๊ฑฐ๋ ์ฅ์ ์กฐ์น(Failover)๊ฐ ํ์ํ ๋, ENI๋ฅผ ๋ค๋ฅธ EC2 ์ธ์คํด์ค๋ก ์ด๋ํ์ฌ ๊ฐ์ Private Static IP๋ฅผ ์ ์งํ ์ ์์. ์ฆ, ๊ฐ์ Application์ ๊ฐ๋์ค์ธ EC2 ์ธ์คํด์ค๊ฐ ๋ ๊ฐ ์๊ณ , Private IPv4๋ฅผ ํตํด ๋ค๋ฅธ ์ธ์คํด์ค๋ก ์์ธ์คํ๋ ค๋ฉด ENI๋ง ์ฎ๊ธฐ๋ฉด ๋๋ค.
๐น ๋ฌธ์ ์ํฉ ์์
๊ธฐ๋ณธ ๊ตฌ์ฑ
- EC2-1 ์ธ์คํด์ค(ํ์ฌ ์ด์ ์ค)
- ENI-1 (Private IP: 10.0.1.100)์ด EC2-1์ ์ฐ๊ฒฐ๋จ
๋ฌธ์ ๋ฐ์
- EC2-1์ด ์ฅ์ ๋ฐ์(์: ํ๋์จ์ด ๋ฌธ์ , ์ํํธ์จ์ด ์ถฉ๋)
- ENI ์ด๋ (Failover)
- EC2-1์์ ENI-1์ ๋ถ๋ฆฌ (Detach)
- ENI-1์ EC2-2(๋๊ธฐ ์๋ฒ)์ ์ฐ๊ฒฐ (Attach)
๊ฒฐ๊ณผ
- EC2-2๋ ๊ทธ๋๋ก 10.0.1.100์ ์ฌ์ฉ (์๋ก์ด IP ๋ณ๊ฒฝ ์์ด ๊ธฐ์กด ์๋น์ค ์ ์ง)
- ํด๋ผ์ด์ธํธ๋ ๋ณ๊ฒฝ ์์ด ๊ธฐ์กด ์๋ฒ์ ๊ณ์ ์ ์ ๊ฐ๋ฅ
๐น ENI ์ด๋ ๋ช ๋ น์ด (AWS CLI)
# ๊ธฐ์กด EC2-1์์ ENI ๋ถ๋ฆฌ
aws ec2 detach-network-interface --attachment-id eni-attach-12345678
# ์๋ก์ด EC2-2์ ENI ์ฐ๊ฒฐ
aws ec2 attach-network-interface --network-interface-id eni-12345678 --instance-id i-23456789 --device-index 1
2-2. ENI ์ค์ต
๋จผ์ ์ธ์คํด์ค 2๊ฐ๋ฅผ ๋ฐ์นญํ๋ค.
AWS ์ฝ์ ๋ก๊ทธ์ธ → EC2 ๋์๋ณด๋ ์ด๋ → ์ผ์ชฝ ๋ฉ๋ด์์ Instances ํด๋ฆญ → ๋คํธ์ํฌ ์ด๋ฆ ํด๋ฆญ → ํ๋จ ๋ณด๋์์ Networking ์ ํํ๊ณ Scroll down → Network Interfaces ๐
๊ฐ ์ธ์คํด์ค์๋ ํ๋์ ๋คํธ์ํฌ ์ธํฐํ์ด์ค๊ฐ ์๋๋ฐ ์ธํฐํ์ด์ค ID๋ eni-๋ก ์์ํ๊ณ , ๊ณต์ฉIP, ์ฌ์คIP, ๊ทธ๋ฆฌ๊ณ IPv4 DNS๋ฅผ ์ฌ๊ธฐ์ ํ์ธ ๊ฐ๋ฅํ๋ค. ๊ทธ๋ฆฌ๊ณ ์์ฑํ ๋ ๊ฐ์ ์ธ์คํด์ค๋ ์๋ก ๋ค๋ฅธ Network Interfaces๋ฅผ ๊ฐ์ง๋ค.
โ How to check the information of the created Network Interfaces
AWS ์ฝ์ ๋ก๊ทธ์ธ → EC2 ๋์๋ณด๋ ์ด๋ → ์ผ์ชฝ ๋ฉ๋ด ์ค Network & Security์์ Network Interfaces ์ ํ ๐
โ How to create network interface and attach to an Instance
AWS ์ฝ์ ๋ก๊ทธ์ธ → EC2 ๋์๋ณด๋ ์ด๋ → ์ผ์ชฝ ๋ฉ๋ด ์ค Network & Security์์ Network Interfaces ์ ํ → Create Network Interface → ์์ฑํ ์ธํฐํ์ด์ค ํด๋ฆญ → ์๋จ์ Actions โผ → Attach → VPC ์ ์ธ์คํด์ค๋ช ์ง์ ํ Attach ๐
- ์ด ์ธ์คํด์ค์๋ ์ค๋ช ์ ๋ง๋ถ์ผ ์ ์๋ค.
์์ฑ ํ ๋ณด๋๋ก ๋์์ค๋ฉด DemoENI ๊ฐ Available ์ํ๋ก ์์ฑ๋ ๊ฒ๊ณผ ๋ณด์กฐ Private IPv4๊ฐ ์์ฑ๋ ๊ฒ์ ํ์ธ ํ ์ ์๋ค.
โ How to move ENI to another Instance
AWS ์ฝ์ ๋ก๊ทธ์ธ → EC2 ๋์๋ณด๋ ์ด๋ → ์ผ์ชฝ ๋ฉ๋ด ์ค Network & Security์์ Network Interfaces ์ ํ → ์ธํฐํ์ด์คaud ํด๋ฆญ → ์๋จ์ Actions โผ → Detach ๐ → ์๋จ์ Actions โผ → Attach → VPC ์ ์ธ์คํด์ค๋ช ์ง์ ํ Attach ๐
๐ก EC2 ์ธ์คํด์ค๋ฅผ ์ข ๋ฃํ๋ฉด?
๊ธฐ๋ณธ ๋คํธ์ํฌ ์ธํฐํ์ด์ค(eth0)๋ ๊ธฐ๋ณธ์ ์ผ๋ก ์๋์ผ๋ก ์ญ์ ๋๋ค. ์๋ํ๋ฉด "Terminate ์ ์ญ์ " ์ต์ ์ด ํ์ฑํ๋์ด ์๊ธฐ ๋๋ฌธ์ด๋ค. ๊ทธ๋ฌ๋ ์ง์ ์์ฑํ ๋คํธ์ํฌ ์ธํฐํ์ด์ค(Secondary ENI)๋ ์ธ์คํด์ค ์ข ๋ฃ ํ์๋ ์๋์ผ๋ก ์ญ์ ๋์ง ์๊ณ ๋จ์์๋ค. ์ถ๊ฐ ENI๋ ๋ค๋ฅธ ์ธ์คํด์ค์ ์ฌ์ฐ๊ฒฐํ ์ ์๊ณ , ํ์ ์ ์๋์ผ๋ก ์ญ์ ํด์ผ ํ๋ค.
๐ก ENI ์ ๋ํด ๋ ์๊ณ ์ถ๋ค๋ฉด? (์ ๋ฆฌ ์ ๋ ๋ธ๋ก๊ทธ)
New – Elastic Network Interfaces in the Virtual Private Cloud | Amazon Web Services
If you look closely at the services and facilities provided by AWS, you’ll see that we’ve chosen to factor architectural components that were once considered elemental (e.g. a server) into multiple discrete parts that you can instantiate and control in
aws.amazon.com
3. EC2 Hibernate (์ ์ ๋ชจ๋)
We know we can stop, terminate instances
- Stop - the data on disk (EBS) is kept intact in the next start
- Terminate - any EBS volumes (root) also set-up to be destroyed is lost
On start, the following happens:
- First start: the OS boots & the EC2 User Data script is run
- Following starts: the OS boots up
- Then your application starts, caches get warmed up, and that can take time!
3-1. What's Hibernate?
โถ The in-memory (RAM) state is preserved
โถ The instance boot is much faster! (the OS is not stopped / restarted - it's frozen!)
โถ Under the hood: the RAM state is written to a file in the root EBS volume
โถ The root EBS volume must be encrypted
โถ Use cases:
- Long-running processing
- Saving the RAM state
- Services that take time to initialize
์๋ฅผ ๋ค์ด, ์คํ์ค์ธ EC2 ์ธ์คํด์ค๊ฐ ์๋ค. RAM์๋ ๋ฐ์ดํฐ๊ฐ ์๋ค. ์ ์ ๋ชจ๋๋ฅผ ์ผ๋ฉด ์คํ ์ค์ธ ์ธ์คํด์ค๋ ์ค์ง ์ํ๋ก ์ ํ๋๊ณ RAM์ ๋ด์ฉ์ EBS ๋ณผ๋ฅจ์ ๋คํ๋๋ค. ๊ทธ๋ฆฌ๊ณ ์ธ์คํด์ค๋ฅผ ์ข ๋ฃํ๋ฉด RAM์ด ์ฌ๋ผ์ง๋ค. ํ์ง๋ง EBS ๋ณผ๋ฅจ์๋ ์ฌ์ ํ RAM์ด ๋คํ๋์ด ์์ผ๋ ์ธ์คํด์ค๋ฅผ ๋ค์ ์คํํ๋ฉด ๋์คํฌ์์ RAM์ ๋ถ๋ฌ์ EC2 ์ธ์คํด์ค ๋ฉ๋ชจ๋ฆฌ๋ก ๊ฐ์ ธ๊ฐ๋ค.
์ด๋ ๊ฒ ํ๋ฉด EC2 ์ธ์คํด์ค๋ฅผ ์ค์งํ ์ ์ด ์๋ ๊ฒ์ฒ๋ผ ์ฌ์ฉ ํ ์ ์๋ค.
โญ Hibernate ์ฃผ์์ฌํญ - ์ธ์คํด์ค ์ ํ ์ ํ / EBS ๋ฃจํธ ๋ณผ๋ฅจ / ์ค์ ๊ณต๊ฐ ํ์
- Hibernate ๊ธฐ๋ฅ์ ์ผ๋ถ ์ธ์คํด์ค ์ ํ์์๋ง ์ง์๋๋ค. ์๋ฅผ ๋ค์ด, M, C, R ์๋ฆฌ์ฆ์ ์ธ์คํด์ค๋ ์ง์ ๋จ
- Hibernate ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ ค๋ฉด ์ธ์คํด์ค์ ๋ฃจํธ ๋ณผ๋ฅจ์ด EBS์ฌ์ผ ํ๋ค.
- ์ธ์คํด์ค๊ฐ ๋ฉ๋ชจ๋ฆฌ ์ํ๋ฅผ ์ ์ฅํ ์ ์๋ ์ถฉ๋ถํ EBS ์คํ ๋ฆฌ์ง๊ฐ ํ์ํ๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก RAM ํฌ๊ธฐ์ ๋ ๋ฐฐ๋งํผ์ ์ค์ ๊ณต๊ฐ์ด ํ์ํจ.
- ๋ฃจํธ EBS ๋ณผ๋ฅจ์์ํธํ๋์ด์์ด์ผ ํ๋ค.
3-2. Hibernate ์ค์ต
AWS ์ฝ์ ๋ก๊ทธ์ธ → EC2 ๋์๋ณด๋๋ก ์ด๋ → Launch Instance → Stop - Hibernate behavior → Enable๋ก ๋ณ๊ฒฝํ๊ธฐ ๐
→ Configure storage → Advanced → Add new volume → Encrypted ์ค์ ์ Yes๋ก ๋ฐ๊พธ๊ธฐ → KMS๋ ๊ธฐ๋ณธ ๊ฐ์ธ awg/ebs๋ก ์ง์ → Instances ์์ ์ธ์คํด์ค๋ช ํด๋ฆญ → ์ฐ์ธก ์๋จ Instance state → Hibernate Instance
Storage Size๋ 8GiB Volume ์ด๋ฉด t2.micro์ ์ถฉ๋ถํ๋ค.
์? Launch Instance ํ ๋ Instance type ํญ์์ ํ์ธ ๊ฐ๋ฅ!
โ AWS CLI ์์ Hibernate ๊ธฐ๋ฅ์ ํ์ฑํ ํ๋ ๋ฒ
์ธ์คํด์ค๋ฅผ ์์ํ ๋ --hibernate ์ต์ ์ ์ฌ์ฉํ๋ค.
aws ec2 start-instances --instance-ids i-1234567890abcdef0 --hibernate
์ธ์คํด์ค๋ฅผ ์ค์งํ ๋๋ Shutdown์ ํ๋๋ผ๋, Hibernate๋ฅผ ์ค์ ํด ๋์๋ค๋ฉด ๋ฉ๋ชจ๋ฆฌ ์ํ๊ฐ EBS์ ์ ์ฅ๋๋ค.
aws ec2 stop-instances --instance-ids i-1234567890abcdef0 --hibernate
์ด์ Hibernate๋ ์ธ์คํด์ค๋ฅผ ์ฌ์์ํ๋ฉด, ์ค์ง๋๊ธฐ ์ ์ํ ๊ทธ๋๋ก ๋ณต๊ตฌ๋๋ค.
โญ Hibernate ์ ์๋ํ๋์ง ํ์ธ๋ฒโญ
๊ทธ๋ฅ ๋จ์ํ๊ฒ ์๊ฐํด์ aws ์ฝ์์์ uptime ๋ช ๋ น์ด๋ก ํ์ธ ๊ฐ๋ฅ ํ๋ค.
`uptime` ๋ช ๋ น์ด๋ ์์คํ ์ ๊ฐ๋ ์๊ฐ์ ํ์ธํ๋ ๋ฐ ์ฌ์ฉ๋๋ค. ์ด ๋ช ๋ น์ด๋ฅผ ์คํํ๋ฉด ์์คํ ์ด ๋ถํ ๋ ์ดํ๋ถํฐ ํ์ฌ๊น์ง์ ์๊ฐ, ์์คํ ์ ํ๊ท ๋ก๋(load average), ๊ทธ๋ฆฌ๊ณ ํ์ฌ ์์คํ ์ ์๊ฐ ๋ฑ์ ์ถ๋ ฅํ๋ค.
$ uptime
14:15:23 up 5 days, 3:47, 3 users, load average: 0.25, 0.30, 0.20
โถ ํ์ฌ ์๊ฐ: 14:15:23 — ์์คํ
์ ํ์ฌ ์๊ฐ
โถ ์
ํ์ (up): up 5 days, 3:47 — ์์คํ
์ด ๋ถํ
๋ ํ 5์ผ 3์๊ฐ 47๋ถ ๋์ ๊ณ์ ์คํ ์ค
โถ ์ฌ์ฉ์ ์: 3 users — ์์คํ
์ ํ์ฌ ๋ก๊ทธ์ธํ ์ฌ์ฉ์ ์
โถ ๋ก๋ ํ๊ท (load average): 0.25, 0.30, 0.20 — ์์คํ
์ 1๋ถ, 5๋ถ, 15๋ถ ํ๊ท ๋ก๋ ๊ฐ
๐ก ๋ก๋ ํ๊ท (Load Average)
1๋ถ, 5๋ถ, 15๋ถ ํ๊ท ๋ก๋๋ ์์คํ ์ CPU์ ๋์คํฌ์ ๋ํ ์ต๊ทผ์ ์์ฒญ ์๋ฅผ ๋ํ๋ด๋ฉฐ, ๊ฐ์ด ๋์์๋ก ์์คํ ์ด ๊ณผ๋ถํ ์ํ์ผ ์ ์์์ ๋ํ๋ธ๋ค.
Hibernate ํ๊ธฐ ์ ์ ์ธ์คํด์ค๋ฅผ ์คํํ๊ณ uptime ๋ช
๋ น์ด๋ฅผ ์ฐ์ด๋ณด์. ์ฌ๊ธฐ์ 1๋ถ์ด ๋์๋ค๊ณ ๊ฐ์ ํด ๋ณด์.
๋ง์ฝ์ Hibernate ๋ฅผ ํ์ง ์๊ณ ์ธ์คํด์ค๋ฅผ ์ค์งํ๋ค๊ฐ ๋ค์ ์คํํ๋ค๋ฉด ?
uptime ๋ช
๋ น์ด๋ 0๋ถ์ผ๋ก ๋ฆฌ์
๋์๋ค๊ฐ, ๋ค์ ์์ํ๋ ์๊ฐ์ด ์ธก์ ๋ ๊ฒ์ด๋ค. ์์คํ
์ด ์์ ํ ์ข
๋ฃ๋์๊ธฐ ๋๋ฌธ์ ๊ฐ๋ ์๊ฐ์ด ์ด๊ธฐํ๋๋ค.
์ผ๋ฐ์ ์ธ ์ค์ง/์์๊ณผ๋ ๋ฌ๋ฆฌ, Hibernate๋ ์์คํ
์ ๊ฐ๋ ์๊ฐ์ ์ค๋จ ์์ด ๊ณ์ ์ด์ด ๋๊ฐ ์ ์๋ ๋ฐฉ์์ด๋ค. ๊ทธ๋์ Hibernate ๋ฅผ ํ๋ฉด ์๊ฐ์ด ๋ฉ์ถ์ง ์์ ๊ฒ์ฒ๋ผ ๊ณ์๋ ์๊ฐ์ด ํ์๋๋ค. ์์คํ
์ด Hibernate ์ํ์์ ๋ฉ๋ชจ๋ฆฌ ๋ด์ฉ์ ์ ์ฅํ๊ณ , ๊ทธ ์ํ๋ก ๋ณต์๋๊ธฐ ๋๋ฌธ์ ์ด์ ์ ์คํ๋ ์๊ฐ๋ ๊ทธ๋๋ก ์ ์ง๋๋ ๊ฒ์ด๊ณ . ์ด๋ก ์ธํด ์์คํ
์ ๋ง์น ์ค์ง๋์ง ์์ ๊ฒ์ฒ๋ผ ๋์ํ๋ค. ์ฆ, ์ด์์ฒด์ ๊ฐ ๋ณด๊ธฐ์๋ ์ด ์ธ์คํด์ค๋ ํ ๋ฒ๋ ์ค์ง๋ ์ ์ด ์๊ธฐ ๋๋ฌธ์ 1๋ถ ์ด์์ ์๊ฐ์ด ์ฐํ ๊ฒ์ด๋ค.