Little Big Data #1 다양한 사람들의 데이터 사이언스 이야기에서 발표한 자료입니다
궁금한 것은 언제나 문의주세요 :)
행사 후기는 https://zzsza.github.io/etc/2018/04/21/little-big-data/ 에 있습니다!
(2018.5 내용 추가) 현재 회사가 없으니, 제게 관심있으신 분들도 연락 환영합니다 :)
Little Big Data #1 다양한 사람들의 데이터 사이언스 이야기에서 발표한 자료입니다
궁금한 것은 언제나 문의주세요 :)
행사 후기는 https://zzsza.github.io/etc/2018/04/21/little-big-data/ 에 있습니다!
(2018.5 내용 추가) 현재 회사가 없으니, 제게 관심있으신 분들도 연락 환영합니다 :)
Improving SparkSQL Performance by 30%: How We Optimize Parquet Pushdown and P...Databricks
Parquet is a very popular column based format. Spark can automatically filter useless data using parquet file statistical data by pushdown filters, such as min-max statistics. On the other hand, Spark user can enable Spark parquet vectorized reader to read parquet files by batch. These features improve Spark performance greatly and save both CPU and IO. Parquet is the default data format of data warehouse in Bytedance. In practice, we find that parquet pushdown filters work poorly resulting in reading too much unnecessary data for statistical data has no discrimination across parquet row groups(column data is out of order when writing to parquet files by ETL jobs).
PostgreSQL, performance for queries with groupingAlexey Bashtanov
The talk will cover PostgreSQL grouping and aggregation facilities and best practices of using them in fast and efficient manner.
In 40 minutes the audience will learn several techniques to optimise queries containing GROUP BY, DISTINCT or DISTINCT ON keywords.
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021StreamNative
You may be familiar with the Presto plugin used to run fast interactive queries over Pulsar using ANSI SQL and can be joined with other data sources. This plugin will soon get a rename to align with the rename of the PrestoSQL project to Trino. What is the purpose of this rename and what does it mean for those using the Presto plugin? We cover the history of the community shift from PrestoDB to PrestoSQL, as well as, the future plans for the Pulsar community to donate this plugin to the Trino project. One of the connector maintainers will then demo the connector and show what is possible when using Trino and Pulsar!
NHN NEXT 게임 서버 프로그래밍 강의 자료입니다. 최소한의 필요한 이론 내용은 질문 위주로 구성되어 있고 (답은 학생들 개별로 고민해와서 피드백 받는 방식) 해당 내용에 맞는 실습(구현) 과제가 포함되어 있습니다.
참고로, 서버 아키텍처에 관한 과목은 따로 있어서 본 강의에는 포함되어 있지 않습니다.
High-speed Database Throughput Using Apache Arrow Flight SQLScyllaDB
Flight SQL is a revolutionary new open database protocol designed for modern architectures. Key features in Flight SQL include a columnar-oriented design and native support for parallel processing of data partitions. This talk will go over how these new features can push SQL query throughput beyond existing standards such as ODBC.
Spark 의 핵심은 무엇인가? RDD! (RDD paper review)Yongho Ha
요즘 Hadoop 보다 더 뜨고 있는 Spark.
그 Spark의 핵심을 이해하기 위해서는 핵심 자료구조인 Resilient Distributed Datasets (RDD)를 이해하는 것이 필요합니다.
RDD가 어떻게 동작하는지, 원 논문을 리뷰하며 살펴보도록 합시다.
http://www.cs.berkeley.edu/~matei/papers/2012/sigmod_shark_demo.pdf
Improving SparkSQL Performance by 30%: How We Optimize Parquet Pushdown and P...Databricks
Parquet is a very popular column based format. Spark can automatically filter useless data using parquet file statistical data by pushdown filters, such as min-max statistics. On the other hand, Spark user can enable Spark parquet vectorized reader to read parquet files by batch. These features improve Spark performance greatly and save both CPU and IO. Parquet is the default data format of data warehouse in Bytedance. In practice, we find that parquet pushdown filters work poorly resulting in reading too much unnecessary data for statistical data has no discrimination across parquet row groups(column data is out of order when writing to parquet files by ETL jobs).
PostgreSQL, performance for queries with groupingAlexey Bashtanov
The talk will cover PostgreSQL grouping and aggregation facilities and best practices of using them in fast and efficient manner.
In 40 minutes the audience will learn several techniques to optimise queries containing GROUP BY, DISTINCT or DISTINCT ON keywords.
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021StreamNative
You may be familiar with the Presto plugin used to run fast interactive queries over Pulsar using ANSI SQL and can be joined with other data sources. This plugin will soon get a rename to align with the rename of the PrestoSQL project to Trino. What is the purpose of this rename and what does it mean for those using the Presto plugin? We cover the history of the community shift from PrestoDB to PrestoSQL, as well as, the future plans for the Pulsar community to donate this plugin to the Trino project. One of the connector maintainers will then demo the connector and show what is possible when using Trino and Pulsar!
NHN NEXT 게임 서버 프로그래밍 강의 자료입니다. 최소한의 필요한 이론 내용은 질문 위주로 구성되어 있고 (답은 학생들 개별로 고민해와서 피드백 받는 방식) 해당 내용에 맞는 실습(구현) 과제가 포함되어 있습니다.
참고로, 서버 아키텍처에 관한 과목은 따로 있어서 본 강의에는 포함되어 있지 않습니다.
High-speed Database Throughput Using Apache Arrow Flight SQLScyllaDB
Flight SQL is a revolutionary new open database protocol designed for modern architectures. Key features in Flight SQL include a columnar-oriented design and native support for parallel processing of data partitions. This talk will go over how these new features can push SQL query throughput beyond existing standards such as ODBC.
Spark 의 핵심은 무엇인가? RDD! (RDD paper review)Yongho Ha
요즘 Hadoop 보다 더 뜨고 있는 Spark.
그 Spark의 핵심을 이해하기 위해서는 핵심 자료구조인 Resilient Distributed Datasets (RDD)를 이해하는 것이 필요합니다.
RDD가 어떻게 동작하는지, 원 논문을 리뷰하며 살펴보도록 합시다.
http://www.cs.berkeley.edu/~matei/papers/2012/sigmod_shark_demo.pdf
형태소분석기에 왜 CRF가 쓰이는지 이해하기 위해 정리한 슬라이드입니다. Graphical Models의 필요성부터 시작해 방향성(Bayesian Networks), 비방향성(Markov Random Fields) Graphical Models의 정의와 조건부독립 성질을 살펴보고, Generative와 Discriminative 모델의 차이점을 정리한 뒤 Discriminative + Undirected 모델로서 Conditional Random Fields를 소개합니다. 끝으로 형태소분석에 CRF를 사용하는 테크닉을 간단히 소개합니다.
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of FacebookThe Hive
This presentation describes the reasons why Facebook decided to build yet another key-value store, the vision and architecture of RocksDB and how it differs from other open source key-value stores. Dhruba describes some of the salient features in RocksDB that are needed for supporting embedded-storage deployments. He explains typical workloads that could be the primary use-cases for RocksDB. He also lays out the roadmap to make RocksDB the key-value store of choice for highly-multi-core processors and RAM-speed storage devices.
Polymer의 기술기반인 Web Componets를 구성하는 표준 스펙들인 Custom Elements, HTML Imports, HTML Templates 그리고 Shadow DOM을 간략히 살펴본다.
Polymer의 아키텍처 및 기본적인 사용방법 그리고 material design이 적용된 paper elements 등을 살펴본다.
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015NAVER / MusicPlatform
youtube : https://youtu.be/E_Bgv9upahI
비동기 이벤트 기반의 라이브러리로만 생각 했던 RxJava가 지금 이 시대 프로그래머에게 닥쳐 올 커다란 메시지라는 사실을 알게 된 지금. 현장에서 직접 느낀 RxJava의 본질인 Function Reactive Programming(FRP)에 대해 우리가 잘 아는 Java 이야기로 풀어 보고 ReactiveX(RxJava) 개발을 위한 서버 환경에 대한 이해와 SpringFramework, Netty에서의 RxJava를 어떻게 이용 하고 개발 했는지 공유 하고자 합니다.
Microservices are small services with independent lifecycles that work together. There is an underlying tension in that definition – how independent can you be when you have to be part of a whole? I’ve spent much of the last couple of years trying to understand how to find the right balance, and in this talk/tutorial I’ll be presenting the core seven principles that I think represent what makes microservices tick.
After a brief introduction of what microservices are and why they are important, we’ll spend the bulk of the time looking at the principles themselves, wherever possible covering real-world examples and technology:
- Modelled around business domain – using techniques from domain-driven design to find service boundaries leads to better team alignment and more stable service boundaries, avoiding expensive cross-service changes.
- Culture of automation – all organisations that use microservices at scale have strong cultures of automation. We’ll look at some of their stories and think about which sort of automation is key.
- Hide implementation details – how do you hide the detail inside each service to avoid coupling, and ensure each service retains its autonomous nature?
- Decentralize all the things! – we have to push power down as far as we can, and this goes for both the system and organisational architecture. We’ll look at everything from autonomous self-contained teams and internal open source, to using choreographed systems to handle long-lived business transactions.
- Deploy independently – this is all about being able to deploy safely. So we’ll cover everything from deployment models to consumer-driven contracts and the importance of separating deployment from release.
- Isolate failure – just making a system distributed doesn’t make it more stable than a monolithic application. So what do you need to look for?
- Highly observable – we need to understand the health of a single service, but also the whole ecosystem. How?
In terms of learning outcomes, beginners will get a sense of what microservices are and what makes them different, whereas more experienced practitioners will get insight and practical advice into how to implement them.
2. 스킵리스트란 Log시간에 검색/추가/제거를 수행할 수 있는 정렬된 자료구조 이진검색트리를 대체할 수 있음 스킵 포인터를 사용해서 빠르게 탐색 가능 - 9호선 급행처럼 구현이 간단함! 레퍼런스 없이 Red-Black Tree를 1시간 안에 구현할 수 있나요?
3. 스킵리스트는 젊다! 1960 1980 1970 1990 Treap [Aragon & Seidel] R Tree [Guttman] AVL Tree [Avdelson- Velskii & Landis] RB Tree B Tree [Bayer] Splay Tree [Sleator & Tarjan] Skip List
4. 아이디어 : 뛰어넘기 빠른 검색을 위해 한 칸씩 뛰어넘으면서 찾으면 어떨까? 메모리 : ½ N 만큼 더 사용 검색 : 최대 N/2 + 1 노드를 검사
5. 아이디어 : 또 뛰어넘기 뛰어넘기 아이디어를 또 적용하면? 메모리 : ¾ N만큼 더 사용 속도 : 최대 N/4 + 3 노드를 검사
6. 아이디어 : 계속 뛰어넘기 2i번째 노드는2i 개의 포인터를 가지도록 만들면? 메모리 : N 만큼 더 사용 속도 : O(log N) 개의 노드만을 검사 여기까진 이진검색트리랑 다를 게 없음
7. 동적 데이터구조로서의 문제점 노드를 추가하거나 삭제하면 패턴이 무너지게 됨 다시 패턴을 만드는 데에는 O(N)이란 긴 시간이 필요함
8. 스킵리스트: 확률적 자료구조 크기의 확률분포를 유지하기! 노드 중 ½은 포인터 1개를 가짐 노드 중 ¼은 포인터 2개를 가짐 노드 중 1/2i은 포인터 i개를 가짐 규칙적인 패턴을 유지할 필요가 없어짐 하지만 여전히 높은 확률로 Log N시간에 동작함 struct Node<T> { T key; Node<T> *forward[];};
10. 매개변수 p i개의 포인터를 가진 노드가r 개라면pr개의 노드는i+1개의 포인터를 가짐 앞의 예제에서는 p = ½ p = ½일 때 가장 속도가 빠르다! 적당한 속도와 메모리 효율을 위해 p = ¼ 를 권장 포인터의 최대 개수는 log1𝑝𝑁개가 적당 대부분의 구현에서는 최대 개수를 20개 정도로 고정함
14. 노드 제거하기 같은 방식으로 BackLook배열을 유지하면서 탐색 제거하면서 앞뒤의 포인터를 이어줌 어차피 랜덤이므로 노드 크기의 분포 유지엔 영향이 없음
15. 최악의 경우 O(N) 이 되지만 모든 노드의 크기가 같아지면 보통 리스트와 동일하게 됨. 하지만 길이 100짜리 리스트가 그렇게 될 확률은? 동전을 100번 던졌을 때 전부 앞면만 나올 확률 로또 1등먹을 확률! 검색시간이 기대값(Log N)의 3배 이상 걸릴 확률은 엄청나게 낮다!
16. 메모리 사용량 비교 리스트 : 노드마다1개의 포인터 필요 이진검색트리: 노드마다2개의 포인터 필요 스킵리스트: 노드마다11−𝑝개의 포인터 필요 𝐸𝑋=𝑛=1∞𝑛𝑃(𝑋=𝑛)=𝑛=1∞𝑛𝑝𝑛−1(1−𝑝)=11−𝑝
17. 메모리 사용량 비교 p의 값에 따라 메모리 사용량을 타협할 수 있음 더 적은 메모리 만으로도 Log 시간에 검색 가능 노드당포인터 사용 이진트리 리스트 p
19. 스킵리스트는 병렬프로그래밍에 유리함 락이 길어질 확률은 매우 빠르게 작아지기 때문에 불규칙한 락 때문에 모든 스레드가 멈춰버릴 확률이 적다. 락을 포인터/노드별로로컬하게 걸 수 있어서 충돌의 위험이 더욱 작다. 하지만 Persistent하게 만들기는 트리보다 어렵다.
20. 언제 스킵리스트를 쓸까? 멀티스레드에서 자주 수정할 컨테이너가 필요할 때 순차적으로 탐색할 필요가 많은 경우 예 : 타임라인상의 이벤트 관리 정렬할 필요가 없을 땐 해쉬테이블을 쓰는 것이 좋음 cache miss/fragmentation 등으로 인해 B-Tree보다 느리게 동작하는 경우도 있으므로 신중한 결정이 필요함
21. 스킵리스트의 변형들 Indexed Skip List 엣지마다 길이를 저장해서 인덱스 접근이 가능 Deterministic Skip List 최악의 경우에도Log시간이지만 패턴 유지를 위한 비용이 필요함 1-2 skip list 바로 아래 레벨의 노드2개 이상을 지나가지 않도록 유지 2-3 tree 에 대응 1-2-3 skip list
22. 스킵리스트 구현들 Redis (BSD) 스킵리스트를 이용한 key-value 저장 서버 (ANSI C) JAVA 1.6의 ConcurrentSkipListMap, Set 스킵리스트를 이용해 구현한 멀티스레드를 지원하는 map과 set Skipdb (BSD) B-Tree대신 스킵리스트를 사용해서 구현한 버클리DB 방식의 DB Qt의 Qmap (GPL, LGPL) Qt Framework중 GUI와 관계없는 기능을 모은 QtCore모듈에 있음 STL map과 유사한 방식으로 사용 가능
23. Reference Pugh, William (June 1990). "Skip lists: a probabilistic alternative to balanced trees". Pugh, William (July 1989). “A Skip List Cookbook” Herlihy et. al. “A Probably Correct Concurrent Skip List” Fraser and Harris (2004). “Concurrent Programming Without Locks” Wikipedia : Skip List