Server-side WebAssembly

A presentation at Codemotion Online Tech Conference 2020 - Spanish Edition in November 2020 in by Horacio Gonzalez

Slide 1

Slide 1

Server-side WebAssembly Horacio Gonzalez - @LostInBrittany Noviembre 3-4-5, 2020

Slide 2

Slide 2

Who are we? Introducing myself and introducing OVH OVHcloud

Slide 3

Slide 3

Horacio Gonzalez @LostInBrittany Spaniard lost in Brittany, developer, dreamer and all-around geek Flutter

Slide 4

Slide 4

OVHcloud: A Global Leader 200k Private cloud VMs running 1 Dedicated IaaS Europe 30 Datacenters Own 20Tbps Hosting capacity : 1.3M Physical Servers 360k Servers already deployed Netwok with 35 PoPs

1.3M Customers in 138 Countries

Slide 5

Slide 5

OVHcloud: 4 Universes of Products WebCloud Domain / Email Domain names, DNS, SSL, Redirect Email, Open-Xchange, Exchange Baremetal Cloud VM General Purpose Baremetal SuperPlan T2 >20e Virtualization T3 >80e Storage PaaS for Web Mutu, CloudWeb Compute Standalone, Cluster Game Collaborative Tools, NextCloud Database T4 >300e Bigdata T5 >600e HCI Plesk, CPanel AI PaaS with Platform.sh VDI Cloud Game Public Cloud 12KVA /32KVA Hosted Private Cloud K8S, IA IaaS PaaS for DevOps Storage File, Block, Object, Archive Databases SQL, noSQL, Messaging, Dashboard Network Virtual servers VPS, Dedicated Server Network VPS aaS pCC DC SaaS CRM, Billing, Payment, Stats IP FO, NAT, LB, VPN, Router, DNS, DHCP, TCP/SSL Offload Virtuozzo Cloud Security Wordpress, Magento, Prestashop Wholesales Hosted Private Cloud IAM, MFA, Encrypt, KMS IT Integrators, Cloud Storage, VMware SDDC, vSAN 1AZ / 2AZ vCD, Tanzu, Horizon, DBaaS, DRaaS Nutanix HCI 1AZ / 2AZ, Databases, DRaaS, VDI OpenStack IAM, Compute (VM, K8S) Stortage, Network, Databases Storage Ontap Select, Nutanix File OpenIO, MinIO, CEPH Zerto, Veeam, Atempo AI ElementAI, HuggingFace, Deepopmatic, Systran, EarthCube Bigdata / Analitics / ML Cloudera over S3, Dataiku, Saagie, Tableau, MarketPlace CDN, Database, ISV, WebHosting Support, Managed High Intensive CPU/GPU, Support Basic Encrypt Support thought Partners KMS, HSM Managed services Encrypt (SGX, Network, Storage) IA, DL Hybrid Cloud Standard Tools for AI, AI Studio, vRack Connect, Edge-DC, Private DC IA IaaS, Hosting API AI Dell, HP, Cisco, OCP, MultiCloud Bigdata, ML, Analytics Datalake, ML, Dashboard Secured Cloud GOV, FinTech, Retail, HealtCare

Slide 6

Slide 6

Did I say WebAssembly? Wasm for friends…

Slide 7

Slide 7

WebAssembly, what’s that?

Slide 8

Slide 8

A low-level binary format Not a programming language A compilation target

Slide 9

Slide 9

That runs on a stack-based virtual machine A portable binary format that runs on all modern browsers… but also on NodeJS and elsewhere!!

Slide 10

Slide 10

With several key advantages

Slide 11

Slide 11

But above all… WebAssembly is not meant to replace JavaScript

Slide 12

Slide 12

Who is using WebAssembly today? And many more others…

Slide 13

Slide 13

A bit of history Remembering the past to better understand the present

Slide 14

Slide 14

Executing other languages in the browser A long story, with many failures…

Slide 15

Slide 15

2012 - From C to JS: enter emscripten Passing by LLVM pivot

Slide 16

Slide 16

2013 - Generated JS is slow… Let’s use only a strict subset of JS: asm.js Only features adapted to AOT optimization

Slide 17

Slide 17

WebAssembly project Joint effort

Slide 18

Slide 18

Server-side WebAssembly Too good to not to use it

Slide 19

Slide 19

Solomon on Web Assembly

Slide 20

Slide 20

Solomon on Web Assembly

Slide 21

Slide 21

A very interesting feature set

Slide 22

Slide 22

Features of Wasm Why is everybody looking at it?

Slide 23

Slide 23

Near native speed https://medium.com/wasmer/benchmarking-webassembly-runtimes-18497ce0d76e

Slide 24

Slide 24

Highly portable It can be run almost everywhere…

Slide 25

Slide 25

Readable and debuggable Each .wasm file with it .wat companion file

Slide 26

Slide 26

Memory safe & secure Running in a fully sandboxed environment

Slide 27

Slide 27

Accepting many source languages And more and more…

Slide 28

Slide 28

Still a young platform… But growing up fast!

Slide 29

Slide 29

Native WASM types are limited WASM currently has four available types: ● ● ● ● i32: 32-bit integer i64: 64-bit integer f32: 32-bit float f64: 64-bit float Types from languages compiled to WASM are mapped to these types

Slide 30

Slide 30

How can we share data? Using the same data in WASM and JS? Shared linear memory between them, and serializing the data to one Wasm types

Slide 31

Slide 31

Solution is coming: Interface types Beautiful description at: https://hacks.mozilla.org/2019/08/webassembly-interface-types

Slide 32

Slide 32

No outside access By design, communication is done using the shared linear memory only

Slide 33

Slide 33

Solution exists: WASI

Slide 34

Slide 34

Mono-thread and scalar operations only Not the most efficient way…

Slide 35

Slide 35

Solution exists: SIMD

Slide 36

Slide 36

Solutions are coming too: Wasm Threads Threads on Web Workers with shared linear memory

Slide 37

Slide 37

Incoming proposals: Garbage collector And exception handling

Slide 38

Slide 38

The Bytecode Alliance Taking WASM out of the browser

Slide 39

Slide 39

The Bytecode Alliance

Slide 40

Slide 40

Bytecode Alliance projects

Slide 41

Slide 41

Wasmtime

Slide 42

Slide 42

Cranelift

Slide 43

Slide 43

WebAssembly Micro Runtime

Slide 44

Slide 44

Lucet

Slide 45

Slide 45

Other runtimes Runtimes, runtimes everywhere

Slide 46

Slide 46

Wasmer Run any code* on any client… almost * Languages compiling to WASM

Slide 47

Slide 47

Wasmer

Slide 48

Slide 48

Wasmer ecosystem

Slide 49

Slide 49

Wasmer ecosystem

Slide 50

Slide 50

Wasm3

Slide 51

Slide 51

Wasm3

Slide 52

Slide 52

And even Wasm over GraalVM!

Slide 53

Slide 53

Or in Kubernetes…

Slide 54

Slide 54

Some examples IRL? Like companies using these things

Slide 55

Slide 55

Fastly works on the edge of the cloud

Slide 56

Slide 56

Clever Cloud FaaS infrastructure https://www.youtube.com/watch?v=wchehMIsu80

Slide 57

Slide 57

Clever Cloud FaaS Infrastructure Already used in internal projects Able to execute complex loads (neural networks models)

Slide 58

Slide 58

Clever Cloud FaaS Infrastructure Blazing fast

Slide 59

Slide 59

Clever Cloud FaaS Infrastructure Blazing fast

Slide 60

Slide 60

That’s all, folks! Thank you all!