서버리스 대규모 리얼타임 웹
시스템 구축하기
taeyo
응용프로그램 플랫폼의 진화
Amazon
Serverless computing allows you to build and run
applications and services without thinking about servers.
Serverless applications don't require you to provision,
scale, and manage any servers. You can build them for
nearly any type of application or backend service, and
everything required to run and scale your application
with high availability is handled for you.
Microsoft
With serverless computing, developers rely on cloud-
based servers, infrastructure, and operating systems. The
fact is, even though it’s called serverless, servers are still
involved. But, as a fully managed service, the setup,
capacity planning, and server management are invisible
to you because they’re handled by the cloud provider. In
a traditional environment, developers must provision and
configure servers, install operating systems, and
continually manage the infrastructure. With a serverless
architecture, you’re free to create, manage, and deploy
apps that scale on demand—without worrying about
infrastructure.
Google
Serverless lets you write and deploy code without the
hassle of managing the underlying infrastructure. It
enhances developer productivity by helping focus on
what matters the most — building great applications and
abstracting away the rest. Zero server management, no
upfront provisioning, auto-scaling to meet traffic
demands, and paying only for the resources used are just
some of the benefits of serverless computing.
Wikipedia
Serverless computing is a cloud-computing execution
model in which the cloud provider acts as the server,
dynamically managing the allocation of machine
resources. Pricing is based on the actual amount of
resources consumed by an application, rather than on
pre-purchased units of capacity. It is a form of utility
computing.
Serverless 컴퓨팅 정의
Serverless의 의미
• Serverless 컴퓨팅의 개념
• 애플리케이션을 단일 기능(Function)의 클러스터로 분리하여
• 자동으로 관리되는 컴퓨팅 리소스 상에서 On-Demand로 실행하는 것
• Microservices의 확장
• Serverless는 사실 서버가 없지 않다 ☺
• 실제로는 워크로드를 처리하기 위해 서버가 필요
• 사용자가 서버를 관리, 유지보수, 프로비저닝 할 필요가 없다는 의미
• 클라우드 공급자가 모든 인프라를 관리해준다
• Serverless는 새로운 것이 아니다
• Public 하이퍼스케일 클라우드가 등장하면서 인기를 급 끌어 올렸다
공통적인 특성
$
© Microsoft Corporation
딱! 쓴 만큼만 과금서버의 추상화
공통적인 특성
$
© Microsoft Corporation
If 풍선 == App
내가 니앱이다
© Microsoft Corporation
SCALE UP
© Microsoft Corporation
SCALE OUT
필요하면 즉시 확장서버의 추상화
공통적인 특성
$
© Microsoft Corporation
사용 시간 주행 거리
TAXI
CPU 사용 시간 메모리 사용량
Serverless
서버리스 시나리오
...?
이벤트가 발생할 경우 어떤 로직을 수행할 필요가 있는 모든 곳에 활용
What is Azure Functions?
통합된 프로그래밍 모델
더욱 개선된 개발 경험
유연한 호스팅 옵션
기존 개발 경험에 영향을 주지 않으면서 비즈니스 요구에 더
적합한 개발 모델을 선택
Function?
트리거
Azure Function을 활용한 효율적인 개발 방식
데모
https://docs.microsoft.com/ko-kr/azure/functions/tutorial-static-website-serverless-api-with-database
GetUploadUrl
thumbnail
ResizeImages
GetImages
image
$web
Upload URL + Auth token
Serverless Web Pages
Serverless Backend
A.I for
Serverless
Serverless 데모 아키텍처 및 사용 리소스
Database for
Serverless
기존 업로드 파일 목록 가져오기
파일 업로드를 위한 경로 및 토큰 가져오기
웹 페이지 접근
업로드
HTTP
트리거
HTTP
트리거
Blob
트리거
나는 리얼타임 Web에 낚여서 왔는데
그건 언제 이야기함?
Azure SignalR
Service
GA!
https://azure.com/signalr
11개 리전에서 현재 사용가능
• US: US East, US East 2, US Central, US West, US West 2
• Canada: Canada East
• Europe: West Europe, North Europe
• APAC: Southeast Asia, Australia East, Japan East
SignalR은 리얼타임 HTTP를 가능하게 하는
추상화를 제공하는 오픈소스 라이브러리
(매직이라고도 불림)
* 현재 최대 100,000 connection 지원
채팅서버 구축해 보신 분?
http://woowabros.github.io/woowabros/2017/09/12/realtime-service.html
네. 채팅서버 구축 어렵지 않습니다
오픈소스 많아요. Socket.IO 등등
근데, 사용자 늘어나면 Scale Out은?
세션, 채널, 메시징 관리는?
https://www.slideshare.net/JohnKim0331/ss-52091187
SignalR이란?
리얼타임 웹 기능을 추가해주는 오픈소스
양방향 서버-클라이언트 통신
WebSocket SSE long polling
연결 관리
Azure SignalR 서비스의 차별점
• 성능(Performance)
• 확장성(Scalability)
• 다양한 백플레인(예: SQL Server, Redis Cache)까지 자동 확장
• 필요한 만큼 Unit만 추가하면 된다
• 현재 Standard 기준 100,000 Connection 지원
• 가용성(Availability)
• 99.9% Service-Level Agreement
• 그 밖에
• 웹 애플리케이션 개발은 필수조건이 아니다
• 서버리스 컴퓨팅 활용 가능
• WebSocket 연결의 부하 분산도 알아서 척척
Flight Map: Realtime Monitoring Dashboard
https://github.com/aspnet/AzureSignalR-samples/tree/master/samples/FlightMap
http://flightmap-demo1.azurewebsites.net/#
비행 지도 : 실시간 모니터링 대시보드
Azure SignalR Service
여러분의 앱과 리얼타임 통신을 수행할 수 있게 지원하는 관리되는 서비스
Client
Client
Client
Client
App
Server
Azure SignalR
Service
SignalR
SignalR
SignalR
SignalR
SignalR
SignalR
SignalR
SignalR
SignalR
SignalR
예 #1
Long
polling
SSE
WebSocket
데모 시나리오
Send message
Store messages
Real-time messages
Send messages
데모 시나리오
Serverless
Web Pages
Serverless
Backend
Serverless
Realtime
Messaging
Database for
Serverless
Almost
연결 및 메시지 시퀀스
데모
https://github.com/aspnet/AzureSignalR-samples
Real-time 기술은 어디에나 필요합니다
쿨한 애플리케이션에는 리얼타임 기술이 필수!
예 #2
Azure SignalR Service SDK
<PackageReference Include="Microsoft.Azure.SignalR"
Version="1.0.0" />
ASP.NET Core 2.x based
.NET and JS
(Preview) Java client
그 밖에 다른 플랫폼도 추가될 예정
마무리
• Azure는 훌륭한 Serverless 포트폴리오를 제공한다
• 이제 동접 약 10만 정도의 Realtime Web은 이다
• 서버리스 아키텍처는 혼자서 고민하기에는 쉽지 않다

서버리스 대규모 리얼타임 웹 구축하기

  • 1.
    서버리스 대규모 리얼타임웹 시스템 구축하기 taeyo
  • 2.
  • 3.
    Amazon Serverless computing allowsyou to build and run applications and services without thinking about servers. Serverless applications don't require you to provision, scale, and manage any servers. You can build them for nearly any type of application or backend service, and everything required to run and scale your application with high availability is handled for you. Microsoft With serverless computing, developers rely on cloud- based servers, infrastructure, and operating systems. The fact is, even though it’s called serverless, servers are still involved. But, as a fully managed service, the setup, capacity planning, and server management are invisible to you because they’re handled by the cloud provider. In a traditional environment, developers must provision and configure servers, install operating systems, and continually manage the infrastructure. With a serverless architecture, you’re free to create, manage, and deploy apps that scale on demand—without worrying about infrastructure. Google Serverless lets you write and deploy code without the hassle of managing the underlying infrastructure. It enhances developer productivity by helping focus on what matters the most — building great applications and abstracting away the rest. Zero server management, no upfront provisioning, auto-scaling to meet traffic demands, and paying only for the resources used are just some of the benefits of serverless computing. Wikipedia Serverless computing is a cloud-computing execution model in which the cloud provider acts as the server, dynamically managing the allocation of machine resources. Pricing is based on the actual amount of resources consumed by an application, rather than on pre-purchased units of capacity. It is a form of utility computing. Serverless 컴퓨팅 정의
  • 4.
    Serverless의 의미 • Serverless컴퓨팅의 개념 • 애플리케이션을 단일 기능(Function)의 클러스터로 분리하여 • 자동으로 관리되는 컴퓨팅 리소스 상에서 On-Demand로 실행하는 것 • Microservices의 확장 • Serverless는 사실 서버가 없지 않다 ☺ • 실제로는 워크로드를 처리하기 위해 서버가 필요 • 사용자가 서버를 관리, 유지보수, 프로비저닝 할 필요가 없다는 의미 • 클라우드 공급자가 모든 인프라를 관리해준다 • Serverless는 새로운 것이 아니다 • Public 하이퍼스케일 클라우드가 등장하면서 인기를 급 끌어 올렸다
  • 5.
  • 6.
  • 8.
    딱! 쓴 만큼만과금서버의 추상화 공통적인 특성 $
  • 9.
    © Microsoft Corporation If풍선 == App 내가 니앱이다
  • 10.
  • 11.
  • 12.
    필요하면 즉시 확장서버의추상화 공통적인 특성 $
  • 13.
  • 14.
  • 15.
    CPU 사용 시간메모리 사용량 Serverless
  • 16.
    서버리스 시나리오 ...? 이벤트가 발생할경우 어떤 로직을 수행할 필요가 있는 모든 곳에 활용
  • 17.
    What is AzureFunctions? 통합된 프로그래밍 모델 더욱 개선된 개발 경험 유연한 호스팅 옵션 기존 개발 경험에 영향을 주지 않으면서 비즈니스 요구에 더 적합한 개발 모델을 선택
  • 18.
  • 19.
    Azure Function을 활용한효율적인 개발 방식
  • 20.
  • 21.
    GetUploadUrl thumbnail ResizeImages GetImages image $web Upload URL +Auth token Serverless Web Pages Serverless Backend A.I for Serverless Serverless 데모 아키텍처 및 사용 리소스 Database for Serverless 기존 업로드 파일 목록 가져오기 파일 업로드를 위한 경로 및 토큰 가져오기 웹 페이지 접근 업로드 HTTP 트리거 HTTP 트리거 Blob 트리거
  • 22.
    나는 리얼타임 Web에낚여서 왔는데 그건 언제 이야기함?
  • 23.
    Azure SignalR Service GA! https://azure.com/signalr 11개 리전에서현재 사용가능 • US: US East, US East 2, US Central, US West, US West 2 • Canada: Canada East • Europe: West Europe, North Europe • APAC: Southeast Asia, Australia East, Japan East
  • 24.
    SignalR은 리얼타임 HTTP를가능하게 하는 추상화를 제공하는 오픈소스 라이브러리 (매직이라고도 불림) * 현재 최대 100,000 connection 지원
  • 25.
    채팅서버 구축해 보신분? http://woowabros.github.io/woowabros/2017/09/12/realtime-service.html
  • 26.
    네. 채팅서버 구축어렵지 않습니다 오픈소스 많아요. Socket.IO 등등 근데, 사용자 늘어나면 Scale Out은? 세션, 채널, 메시징 관리는? https://www.slideshare.net/JohnKim0331/ss-52091187
  • 27.
    SignalR이란? 리얼타임 웹 기능을추가해주는 오픈소스 양방향 서버-클라이언트 통신 WebSocket SSE long polling 연결 관리
  • 28.
    Azure SignalR 서비스의차별점 • 성능(Performance) • 확장성(Scalability) • 다양한 백플레인(예: SQL Server, Redis Cache)까지 자동 확장 • 필요한 만큼 Unit만 추가하면 된다 • 현재 Standard 기준 100,000 Connection 지원 • 가용성(Availability) • 99.9% Service-Level Agreement • 그 밖에 • 웹 애플리케이션 개발은 필수조건이 아니다 • 서버리스 컴퓨팅 활용 가능 • WebSocket 연결의 부하 분산도 알아서 척척
  • 29.
    Flight Map: RealtimeMonitoring Dashboard https://github.com/aspnet/AzureSignalR-samples/tree/master/samples/FlightMap http://flightmap-demo1.azurewebsites.net/# 비행 지도 : 실시간 모니터링 대시보드
  • 30.
    Azure SignalR Service 여러분의앱과 리얼타임 통신을 수행할 수 있게 지원하는 관리되는 서비스 Client Client Client Client App Server Azure SignalR Service SignalR SignalR SignalR SignalR SignalR SignalR SignalR SignalR SignalR SignalR
  • 31.
  • 32.
  • 33.
    Send message Store messages Real-timemessages Send messages 데모 시나리오 Serverless Web Pages Serverless Backend Serverless Realtime Messaging Database for Serverless Almost
  • 34.
  • 35.
  • 36.
    Real-time 기술은 어디에나필요합니다 쿨한 애플리케이션에는 리얼타임 기술이 필수!
  • 37.
  • 38.
    Azure SignalR ServiceSDK <PackageReference Include="Microsoft.Azure.SignalR" Version="1.0.0" /> ASP.NET Core 2.x based .NET and JS (Preview) Java client 그 밖에 다른 플랫폼도 추가될 예정
  • 39.
    마무리 • Azure는 훌륭한Serverless 포트폴리오를 제공한다 • 이제 동접 약 10만 정도의 Realtime Web은 이다 • 서버리스 아키텍처는 혼자서 고민하기에는 쉽지 않다