vert.x vs akka

19
Vert.x VS Akka 한한한 (Chang-Hwan Han) [email protected]

Upload: chang-hwan-han

Post on 07-Jan-2017

745 views

Category:

Software


2 download

TRANSCRIPT

Vert.x VS Akka한창환 (Chang-Hwan Han)

[email protected]

2

Polyglot event-driven application framework http://vertx.io/ https://github.com/eclipse/vert.x

Architecture◦ 네트워크 처리에 Apache Netty 를 서버 엔진으로 사용◦ 노드간 통신을 지원하기 위해 데이타그리드 솔루션 HazelCast 사용

Vert.x

3

Features◦ Polyglot

Java,JavaScript,Python,Groovy,Scala 등 지원◦ Simple concurrency mode

Node.JS 와 같은 단일 스레드 형태◦ Node.JS 보다 빠른 성능◦ Embedded Vertx

독립 서버 동작이 가능하며 라이브러리 형태로도 사용이 가능◦ Simple, asynchronous programming model

Vert.x

4

Vert.x Architecture

5

Vert.x Architecture

6

Toolkit and runtime for building concurrent, distributed, and fault tolerant event-driven applications

http://akka.io/ https://github.com/akka/akka

Actor 를 근간으로 하는 high level 의 application framework

Akka

7

Features◦ Simple Concurrency & Distribution

◦ Resilient by Design

◦ High Performance 단일 시스템에서 초당 5 천만 가능 적은 메모리를 사용하여 1GB 로 250 만 Actor 가능

◦ Elastic & Decentralized

◦ Extensible

Akka

8

Akka Architecture

9

Akka Architecture

10

Akka Architecture

11

Akka Vert.x Quasar Norbert

Interprocess com-munication 5 2 3 1

Failure detector 5 4 4 4

Recovery system 5 0 4 0

Programming model 2 1 2 1

… … … … …

Final score 20 8 17 6

Vert.x VS Akka

Why we chose Akka for our cloud device solution(https://techblog.king.com/why-we-choose-akka-for-our-cloud-device-solution/)

12

Vert.x VS Akka

노드간 통신 (Interprocess communication)◦ Akka

Message 를 Actor 사이에서 완벽한 투명성을 가지고 전달 FIFO Message 로 Actor 간 전송 계층간의 Actor 에게도 Message 를 보낼 수 있음 Event bus 지원

◦ Vert.x Pub/Sub 방식 중앙 Event Bus

고장 감지 (Failure detector)◦ Akka

Gossip-based Membership 프로토콜 이용 서드 파티 소프트웨어 필요 없음 (cluster-aware routers and metrics)

◦ Vert.x 클러스터 상태를 유지를 위한 Memory Data Grid databases Hazelcast 사용 ( 분산 환경 데이터 공유 In-Memory Data Grid)

13

Vert.x VS Akka

회복 시스템 (Recovery system)◦ Akka

여러개의 퍼시스턴스 시스템을 사용 가능 매우 유연한 방식

◦ Vertx 와 Norbert 는 회복 시스템을 제공하지 않음 프로그래밍 모델 (Programming model)

◦ Akka 부모 , 자식으로 계층화되는 actor model 액터 시스템 패러다임 - 동시성 이슈를 간단하게 해줌

◦ Vertx actor-like 모델을 사용 계층적이지 않음

14

Vert.x VS Akka

Computation model:◦ Vert.x is based on Event Driven model◦ Akka is based on Actor Model of concurrency

Reactive Streams:◦ Vert.x has Reactive Streams builtin◦ Akka supports Reactive Streams via Akka Streaming◦ Akka has stream operators ( via Scala DSL ) that is very concise and

clean.

HTTP Support◦ Vert.x has builtin support of creating network services ( HTTP, TCP etc )◦ Akka has Akka HTTP for that

Scala support◦ Vert.x is written in Java◦ Akka is written in Scala and it fun to work onetc.

15

Vert.x VS Akka

Remote services◦ Vert.x supports services, so we need to explicitly create services◦ Akka has Actors which can be deployed anywhere on the newtork, with

support clustering, replication, load-balancing, superivsion etc.

16

Compare Vert.x and Akka's popularity and activity

Vert.x Akka

Repository

5,366  Stars 6,265

491  Watchers 544

1,024  Forks 2,002

2 days ago  Last Commit about 13 hours ago

More

Java  Language Scala

17

Interest over time of Vert.x and Akka

18

What are your thoughts on Scala and Akka?

Tim Fox( Vert.x 를 만든 사람 ) 의 Akka 에 대한 인터뷰 I respect and appreciate the power of Scala, and those who can program in it. To me the major

problem Scala has is its too hard and tries to do many things, which means it will never be truly mainstream like Java. But if you have a super intelligent dev team who can handle it then Scala may be a great choice.

Akka is a great system that I have a lot of respect for it too. In some areas it takes a similar ap-proach to Vert.x - e.g. Vert.x has an "actor-like" approach for concurrency and we try and avoid mutable shared data. Also both Vert.x and Akka interoperate using the new reactive streams "s-tandard". Both Vert.x and Akka are riding the same Zeitgeist (if that makes sense!) to a certain extent.

I don't see Vert.x vs Akka as an "either-or" situation. I think it will be common to see installations that use both Vert.x and Akka happily talking to each other in a nice scalable reactive way.

요약◦ 스칼라와 스칼라 개발자들에 대해 존경하고 좋아한다 .◦ 아카는 뛰어난 시스템이고 어떤 부분에서는 Vert.x 와 매우 비슷하다 .◦ Vert.x 도 Akka 처럼 상태변경이 없는 순수성을 지향하고 데이터 공유 및 변경가능성에 대해 피하려고 한다 .◦ 새로운 Reactive Stream 표준에 있어서 Vert.x 와 Akka 는 상부 상조할 것이다 .◦ 어떻게 보면 Vert.x 와 Akka 모두 같은 시대정신을 갖고 있다 .◦ Vert.x 와 Akka 는 같이 사용할 수도 있을 것이고 , 리액티브의 길에 있어서 좋은 동반자가 될 것이다 .

19

1. Vert.x VS Akka (https://java.libhunt.com/project/vertx/vs/akka)

2. Why we chose Akka for our cloud device solution(https://techblog.king.com/why-we-choose-akka-for-our-cloud-device-solution/)

3. Difference in message-passing model of Akka and Vert.x(http://stackoverflow.com/questions/21481238/difference-in-message-passing-model-of-akka-and-vert-x)

4. Interview with Tim Fox About Vert.x 3, the Original Reactive, Microservice Toolkit for the JVM (https://www.infoq.com/articles/vertx-3-tim-fox)

5. Akka wiki (https://en.wikipedia.org/wiki/Akka_(toolkit))

6. Vert.x wiki (https://en.wikipedia.org/wiki/Vert.x)

Reference