Central Dogma - ์ก๋ฏผ์ฐ๋
LINEโs Git-based highly-available service configuration repository
- Central Dogma๋ Git, ZooKeeper ์ HTTP/2์ ๊ธฐ๋ฐํ๋ ๋ฉํฐ-๋ง์คํฐ๋ก ๋์ํ๋ ๊ณ ๊ฐ์ฉ์ฑ ๋ฒ์ ๊ด๋ฆฌ ์๋น์ค ์ค์ ์ ์ฅ์๋ก์, LINE์ ์คํ์์ค ํ๋ก์ ํธ ์ ๋๋ค.
- Central Dogma์ ๊ธฐ๋ฅ ์๊ฐ์ ๋๋ถ์ด ์ค์ ๊ด๋ฆฌ ์ํฌํ๋ก์ฐ ๊ด์ ์์ ์ด๋ป๊ฒ ๋ณํ๋ฅผ ๊ฐ์ ธ์๋์ง ์๊ฐํฉ๋๋ค.
Central Dogma
- Github : https://github.com/line/centraldogma
๋ฐฐ๊ฒฝ
- ์ค์ ํ์ผ์ ์ด๋ ์์น์ ์์ ํ๊ฒ ์ ์ฅํด์ผํ ๊น?
- HardCoding
- HardCoding์ ๋ฌธ์ ์ ?
- ์๋ฒ ์ค์ง
- ๋ณ๊ฒฝ
- ์๋ฒ ์ฌ์์
- Central Dogma
- ์ด๋ฐ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ๋ฑ์ฅ
- ์ฃผ๋ก JSON
- HA(High Available)
- JSON ์ผ๋ถ๋ถ๋ง ์์ ๊ฐ๋ฅ
- ํน์ ๋ถ๋ถ์ด ๋ณ๊ฒฝ๋์์ ๊ฒฝ์ฐ notification
- Mirroring from an external Git repository
- Stores anything textual
- Start Time
- Bean Properties
- Run time์๋ ๋ณ๊ฒฝ ๊ฐ๋ฅ
- User Ip ๋ธ๋๋ฆฌ์คํธ
- A/B Test๋ฅผ ์ํ ๋ณ์
- scheduled maintenance notice
- Bussiness rule ์คํฌ๋ฆฝํธ๋ค
- Start Time
- ๊ณ ๊ฐ์ฉ์ฑ(Highly-available)
- Multi-master
- Eventually consistent
- Fast read/ Slow write
- ZooKeeper as a replication log queue
- ZooKeeper๋ Ram์ ์ฌ์ฉ
- ZooKeeper๋ Write๊ฐ ๋๋ฆฌ๊ธฐ ๋๋ฌธ์ ์ ์ํ ๊ฒ.
- Version-controlled
- jGit as a back-end storage
- History - diffs and authors
- Bigger than Ram
- Focus on simplicity
- Integer revision numbers : Integer๋ง์ผ๋ก ์ต์ ์ธ์ง ์๋์ง ํ๋จ ๊ฐ๋ฅ
- Linear history : no branches
- Advanced query mechanism
- first-class JSON support
- JSON์ Query ํํ๋ก ์กฐํํ ์ ์๋ค.
- Fine-grained access control
- Apache Shiro as the authentication layer
- Four roles
- Administrator, Owner, Member and Guest
๊ฐ์น
- Queryable
- Watchable
- Highly-available
- Accessible from same network
์์ผ๋ก ํด์ผ ํ ๊ฒ.
- Go client improvements
- Web UI improvements
- Independence from Apache Shiro
- Replace Zookeeper With Raft
Slide
Armeria - ์ดํฌ์น๋
Armeria๋ฅผ ์ด์ฉํ ๋น๋๊ธฐ ๋ง์ดํฌ๋ก์๋น์ค ๊ฐ๋ฐ
- Armeria๋ Java, Netty, HTTP/2, gRPC ์ Thrift ์ ๊ธฐ๋ฐํ LINE์ ์คํ์์ค ๋ฆฌ์กํฐ๋ธ ๋น๋๊ธฐ ๋ง์ดํฌ๋ก์๋น์ค ํ๋ ์์ํฌ ์ ๋๋ค.
- ๋ถ์ฐ tracing๊ณผ ์๋น์ค discovory์ ๊ฐ์ ๊ฐ๋ ฅํ ๊ธฐ๋ฅ์ ์ง์ํ๋ฉด์๋ ๋ฐฐ์ฐ๊ธฐ ์ฌ์ด Armeria์ ๋ํด์ ์์๋ณด๊ณ , ์ ๋น๋๊ธฐ๋ก ๋์ํ๋ ๋ฆฌ์กํฐ๋ธ ๋ง์ดํฌ๋ก์๋น์ค ํ๋ ์์ํฌ๊ฐ ๋ชจ๋ ๊ท๋ชจ์ ์๋น์ค์์ ๊ผญ ํ์ํ์ง ์์๋ด ๋๋ค.
Armeria
-
๋น๋๊ธฐ๋ฅผ ์งํฅ
-
1000๊ฐ์ ์์ฒญ์ด ์ค๋ฉด 1000๊ฐ์ Thread๊ฐ ์ผ์ ์์ํด์ผ ํ๋ค.
-
์ค์ ๋ก๋ just waiting for the backend.
-
Java Thread Default Stack size : 2MB
-
Shard 1๊ฐ๊ฐ ์ค๋ฅ๊ฐ ๋ ๊ฒฝ์ฐ?
- ์ ์ ์๋ต์ ๊ธฐ๋ค๋ฆฌ๋ Thread๊ฐ์๊ฐ ์ฆ๊ฐํ๋ฉด์..
- ์๋ฒ๊ฐ ์ ๋ฉด ์ฅ์ ๋ฐ์.
-
Reactive Streams
- ์๋ต ๊ฒฐ๊ณผ๊ฐ ํฐ ๊ฒฝ์ฐ
- ์๊ฐ์ ์ผ๋ก ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ ์ฆ๊ฐ.
- Out of Memory ๋ฐ์.
- Pagenation?
- ์ถ๊ฐ์ ์ธ Resource ์์.
- ๋ฌด์ ํ์ผ์๋ ์๋ Response?
- Stock quotes
- HTTP ๋ฌธ์ ์ธ๊ฐ?
- ๊ทธ๊ฑด ์๋๋ค.
- ๋๊ธฐ ๋ฌธ์ ๋ก ์ธํ ๋ฌธ์ ๋ฐ์.
- ์๋ต์ด ์์ ๊ฒฝ์ฐ
- ์๋ต ๊ฒฐ๊ณผ๊ฐ ํฐ ๊ฒฝ์ฐ
-
Armeria ์ง์ Protocol
- HTTP2 ์ง์
- Reactive Streams API
- gRPC, Thrift, REST services
- Tomcat or Jetty
- RPC ์ง์
- 1st Class citizen in web framework
- binary Protocol
-
- OpenSSL-based faster TLS connection
-
Thrift
-
์ ์ฌ์ฉํ ๊น?
- gRPC
- HTTP/1.2, TLS on off
- gRPC-Web support, i.e.
- Thrift
- HTTP/2
- TTEXT a.k.a human-readable JSON
- gRPC
-
Decorate
- AOP
- Request throttling
- Metric collection
- Distributed tracing Zipkin
- HTTP content encoding
- CORS
- Automatic retries
- Circuit breakers
-
๋น๋๊ธฐ Stack Trace ์ด๋ ค์
- Heap Dump
Slide
Redis - ์ต์ข ์ด๋
LINE, 25 billion messages per day
-
LINE์์๋ ๋ฉ์์ง ์๋น์ค๋ฅผ ์ํ Storage system์ผ๋ก Redis์ HBase, Kafka๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
-
๋งค์ผ 250์ต๊ฑด ์ด์์ ๋ฉ์์ง๋ฅผ ๋ฐฐ๋ฌํ๊ธฐ ์ํด์, 1,000๋ ์ด์์ ๊ณ ์ฑ๋ฅ ๋ฌผ๋ฆฌ ์๋ฒ์์ 14,000๊ฐ ์ด์์ Redis ๋ ธ๋๋ฅผ, 60์ฌ๊ฐ ํด๋ฌ์คํฐ์ ๋๋ ์ ์ด์ฉํ๊ณ ์์ต๋๋ค.
-
์ฌ๊ธฐ์์๋ ๋ง์ I/O์ ์๋ต์๋๊ฐ ์ค์ํ ๋ฉ์์ง์ ์ํด์, ์ด๋ป๊ฒ Redis ๊ด๋ จ facility๋ฅผ ๊ฐ๋ฐ ๋ฐ ์ด์ํ์ฌ ๋์ ํธ๋ํฝ์ ์งง์ ์๋ต์๋๋ก ์ ์งํ ์ ์๋์ง์ ๋ํด์ ์ค๋ช ํฉ๋๋ค.
-
๋ด์ฉ์๋, ํด๋ผ์ด์ธํธ ์ค๋ฉ์ ์ด๋ป๊ฒ ํ๊ณ ์๋์ง, ๊ณต์ Redis ํด๋ฌ์คํฐ ๋์ ๊ฒฝํ, ๋ด๋ถ ๋ชจ๋ํฐ๋ง ์์คํ , ๋น๋๊ธฐ Redis ํด๋ผ์ด์ธํธ ๋์ ๊ฒฝํ ๋ฑ์ ๋ค๋ฃน๋๋ค.
-
Redis 3.0 Clustering ์ง์
-
LINE
- 25 billion messages per day
- 420000 messages in Happy New Year
- Messaging server
- Asynchronous Task Processor
- Kafka
- Redis
- Cache or Database
- ์ข ๋ฅ๋ณ๋ก ์ฌ์ฉ
- 1000๊ฐ ์ด์ ๋จธ์
- 192 - 256 Gb Memory
- Hbase
- Back up
- Cold data
- ZooKeeper
- Master, Slave ๊ด๊ณ ์ ๋ณด ๊ด๋ฆฌ
- Client sharding
- pros
- shrot response
- ์๋ฒ ๋น์ฉ ์ ๊ฐ
- cons
- fat client
- pros
-
Switch Packet Drop
-
Redis Upgrade ํ๊ธฐ ํ๋ค๋ค.
Slide
๋ด๊ฐ ์ป์ ๊ฒ.
- ํ์ฌ ๋ด๊ฐ ๊ฒฝํํ๊ณ ์๋ ๋น์ทํ Architecture์์ Scale์ด ์ปค์ง ๊ฒฝ์ฐ์ ๋ฐ์ํ๋ ๋ฌธ์ ๋ค์ ํด๊ฒฐํ๋ ๋ฐฉ๋ฒ๋ค์ธ๊ฒ ๊ฐ๋ค.
- ์ค์ ํ์ผ ๋ํ ์๋ฒ ์๊ฐ ๋ง์ผ๋ฉด ๋ง์์๋ก ๊ด๋ฆฌ ์ด๋ ค์์ Line์ ์ ๋ ๊ฒ ๋ฌธ์ ํด๊ฒฐํ๊ณ ์คํ์์คํ ํ์๋ค.
- Monitoring์ ์ค์์ฑ. ๊ธฐ๋กํ๊ณ ๊ด์ฐฐํด์ผ ๋ฌธ์ ํด๊ฒฐ์ด ์ฝ๊ณ ๋น ๋ฅด๊ฒ ์งํ๋๋ค.
- ๋ค์ํ ์ํฉ ๊ณ ๋ คํ๊ธฐ. ์ด๋ฐ Case, ์ ๋ฐ Case ์ํฉ์ ์ฌ๋ฌ๊ฐ๋ก ๋ฐ์ํ ์ ์๋ค.
- ๋ชจ๋ฅด๋ ์ฉ์ด๊ฐ ์์ง ๋ง๊ธฐ ๋๋ฌธ์ ์ ๋ฆฌํ๊ธฐ.