# Github 는 Foreign Key 를 전혀 사용하지 않습니다 (2016)

> Clean Markdown view of GeekNews topic #878. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=878](https://news.hada.io/topic?id=878)
- GeekNews Markdown: [https://news.hada.io/topic/878.md](https://news.hada.io/topic/878.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2019-11-10T09:08:45+09:00
- Updated: 2019-11-10T09:08:45+09:00
- Original source: [github.com](https://github.com/github/gh-ost/issues/331)
- Points: 4
- Comments: 1

## Topic Body

FK는

- 샤딩을 어렵게 합니다

- 성능을 저하시키고

- 온라인 스키마 이관 에도 문제가 됩니다.

그래서 우린 FK를 사용하지 않습니다. 어디에서도.

= 이 리포는 "MySQL" 용 스키마 이관 도구인 gh-ost 의 얘기라 다른 DB와는 맞지 않을수 있고, ( 3년전 이슈지만, 새 댓글에 postgres 11은 FK 샤딩도 된다는 얘기가 있어서 작성자가 다시 댓글을 담 )

= 테이블간에 ID로 레퍼런싱은 하지만, FOREIGN KEY 제약을 사용하지는 않는 다는 이야기.

## Comments



### Comment 9984

- Author: coremaker
- Created: 2022-05-12T10:15:23+09:00
- Points: 1

무결성 체크를 어떤식으로 하는지가 관건이겠네요.
