TIL

2024.11.16 pinterest sharding

Gisungcu 2024. 11. 17. 21:17

https://medium.com/pinterest-engineering/sharding-pinterest-how-we-scaled-our-mysql-fleet-3f341e96ca6f

 

Sharding Pinterest: How we scaled our MySQL fleet

This is a technical dive into how we split our data across many MySQL servers. We finished launching this sharding approach in early 2012, and it’s still the system we use today to store our core…

medium.com

 

 

이전에 pinterest sharding관련 글도 읽었었는데요.

 

2024.06.12 How Pinterest Scaled to 11 Million Users With Only 6 Engineers

How Pinterest Scaled to 11 Million Users With Only 6 Engineers   How Pinterest Scaled to 11 Million Users With Only 6 EngineersScaling Pinterest — From 0 to 10s of Billions of Page Views a Month in Two Yearsmedium.compinterest가 성장함에 따

gisungcu.tistory.com

 

이번에는 좀 더 오래전에 쓰였던 pinterest sharding 글입니다.

글에서 흥미로운 점은 글로벌 키를 만드는 방식입니다.

shard id, local id, type id와 미래를 위한 2 bit의 공간으로 이루어져 있습니다. 

key을 해석하면 어느 shard에 무슨 type인지까지 유추가 가능해집니다.

 

글에서 shard id를 정하는 방법은 나와있지는 않습니다. 

궁금해서 더 찾아보니 이런 글이 있더군요.

 

Pinterestはいかにスケーラビリティと格闘してきたのか(前編)。QCon Tokyo 2013

4月23日に都内で開催されたエンジニア向けのイベント「QCon Tokyo 2013」。急速に人気サイトへと成長したPinterestが、その裏でいかにスケーラビリティと格闘してきたのかをPinterestのエンジニア

www.publickey1.jp

신규 유저는 랜덤 shard에 생성된다.

 

그리고 이전 글을 보면 유저와 관련된 핀, 보드는 같은 shard에 생성된다는 말이 있습니다.

 

이 둘을 합치면 신규 유저는 랜덤 shard에 생성되고 관련 콘텐츠는 동일 shard에 생성된다고 생각할 수 있습니다.

음 인플루언서인 경우 특정 DB에 부하가 많이 가지 않을까? 어떻게 이걸 해결했을까요

댓글에도 비슷한 질문을 찾아볼 수 있었습니다만 답변은 없었습니다.