Skip to Content
웹 API 설계
book

웹 API 설계

by Brenda Jin, Saurabh Sahni, Amir Shevat
May 2025
Beginner to intermediate
232 pages
2h 58m
Korean
O'Reilly Media, Inc.
Content preview from 웹 API 설계

7장. 변경 사항 관리

이 작품은 AI를 사용하여 번역되었습니다. 여러분의 피드백과 의견을 환영합니다: translation-feedback@oreilly.com

좋은 디자인은 시간이 지나도 변하지 않습니다. 오늘 훌륭한 디자인을 만들었다고 해서 변화가 진행 중일 때도 계속 좋은 디자인이 될 것이라는 보장은 없습니다. 좋은 API는 제품이나 비즈니스의 발전과 함께 적응하고 변화할 수 있어야 합니다.

갑작스러운 변경은 많은 API의 일반적인 함정 중 하나입니다. 이 장에서는 일관성을 유지하면서 변화에 접근하는 방법과 API가 발전함에 따라 이전 버전과의 호환성을 보장하는 방법에 대해 설명합니다.

일관성을 향해

일관성은 모든 종류의 우수한 경험의 특징이며, API도 예외는 아닙니다. 일관성은 신뢰를 구축합니다. 신뢰는 번성하는 개발자 생태계를 만들기 위한 토대입니다.

다음은 일관성의 몇 가지 특징입니다:

  • 개발자는 시스템에서 데이터에 액세스하는 방법에 대한 정신적 모델을 구축할 수 있습니다.

  • 응답 객체는 엄격한 유형과 의미 있는 이름으로 공식화되며, 즉 각 모델은 엔드포인트에 관계없이 동일합니다.

  • 개발자는 여러 엔드포인트에서 동일한 요청 패턴을 사용할 수 있으므로 미들웨어의 필요성이 줄어들고 애플리케이션의 성능과 확장에 도움이 됩니다.

  • 의미 있는 오류와 함께 요청이 예측 가능하게 실패합니다.

때로는 최선의 의도에도 불구하고 API가 일관되지 않을 수 있습니다. Slack의 API를 예로 들어보겠습니다. API 엔드포인트는 중앙의 설계 감독 없이 시간이 지남에 따라 점진적으로 추가되었습니다. 회사 내 각 제품 그룹은 API 메서드를 독립적으로 설계하고 릴리스했습니다. 그 결과 불일치가 발생했습니다. 표 7-1은 두 개의 유사한 API 메서드 channels.join 와 channels.invite 에 대한 단순화된 요청 패턴을 보여줍니다.

표 7-1. 2017년에 두 가지 Slack API 메서드에 대한 간소화된 요청: channels.join 및 channels.invite
채널 이름을 받습니다. 채널 ID를 사용합니다.
// Join a channel
channels.join({
  channel: "channel-name"
})
// Invite a user to a channel
channels.invite({
  channel: "C12345",
  user: "U23456"
})

표 7-1에서 한 엔드포인트는 채널을 문자열 이름으로 사용하는 반면 다른 엔드포인트는 채널을 ID로 사용하는 방법을 볼 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

실무로 통하는 인과추론 with 파이썬

실무로 통하는 인과추론 with 파이썬

마테우스 파쿠레
자바스크립트 + 리액트 디자인 패턴

자바스크립트 + 리액트 디자인 패턴

애디 오스마니(Addy Osmani)

Publisher Resources

ISBN: 9798341654952