More Related Content Similar to FRENDS 발표자료 - 취미 개발기 (20) More from Daegeun Kim (6) FRENDS 발표자료 - 취미 개발기414. 2
# booster라는 자체 라이브러리를 만들어서 사용.!
ids = []!
with db(config, ‘main’, autocommit=False) as s,!
cache(config) as c:!
booster = new_booster(c, ‘cx:topics’)!
query = s.query(topic.c.id, topic.c.name) !
.filter(topic.c.hidden == False) # (1)!
rows = booster.mget(ids, query,!
addition=lambda x: topic.c.id.in_(x), # (2)!
key_fn=lambda r: r.id) # (3)!
!
(1)은 캐쉬에 없을 때 사용할 쿼리!
(2)는 lambda에 전달되는 x는 캐쉬에 없는 PK 목록!
(3)은 db조회한 후 각 레코드는 이 함수를 호출하고 cx:topics:PK 값으로
캐쉬에 저장.!
780.
구현
0 1 2 3!
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1!
+-+-+-+-+-------+-+-------------+-------------------------------+!
|F|R|R|R| opcode|M| Payload len | Extended payload length |!
|I|S|S|S| (4) |A| (7) | (16/64) |!
|N|V|V|V| |S| | (if payload len==126/127) |!
| |1|2|3| |K| | |!
+-------------------------------+-------------------------------+!
| Extended payload length continued, if payload len == 127 |!
+ - - - - - - - - - - - - - - - +-------------------------------+!
| |Masking-key, if MASK set to 1 |!
+-------------------------------+-------------------------------+!
| Masking-key (continued) | Payload Data |!
+-------------------------------+-------------------------------+!
: Payload Data continued ... :!
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +!
| Payload Data continued ... |!
+-------------------------------+-------------------------------+!
!
http://datatracker.ietf.org/doc/rfc6455/
929.
!
| 0x00000001 | 0x0000014a 0x2d575a68 | 0x00000001 | 0x00000001 |
| op code | unix timestamp (ms) | proto ver | flags |
1008.
Server
이전되지 않고 남아있는 API는 Android Volley로 처리
이전된 API는 Persistent WebSocket connection!으로!
WebSocket은 Storage와 접근하지는 않는다.
인증정보는 캐쉬. 멤캐쉬가 아닌 내부 LRU형태로 캐쉬.
인증서버
POST http://xxx.com/api/v1/user/authorize
Authorization: Bearer xxxxxx
…
1304. 나는 정제를 이렇게~
로그 chunk! 조회
대상이 뭔고??
actor 가입한 주
Map 단계
같은 키를 가진
로그를 그루핑하고
Reduce!
계산했으면 결과
반영