- 전체
- HTML
- Web Design (웹디자인)
- XE 응용 개발
- wordpress plugin dev
- Javascript & JavaScript Application
- MEAN Stack : full stack javascript
- angular js & ionic framework
- bootstrap
- WebGL, Three.js and Babylon.js
- restful api design
- mobile web
- node.js 응용
- Cloud Service 응용
- 웹 어셈블리 개발 [WASM, WebAssembly]
- 마이크로서비스, MSA (microservice architecture)
- WebGL / WebGPU
- next.js 개발
- micro frontend (마이크로프론트앤드)
- 전자상거래/쇼핑몰
- 서버 클라우드 (aws, azure, google)
웹 어셈블리 개발 [WASM, WebAssembly] [웹 어셈블리 WSAM, webassembly] WebAssembly on the server-side : 서버측 웹어셈블리
2023.08.27 16:11
[웹 어셈블리 WSAM, webassembly] WebAssembly on the server-side : 서버측 웹어셈블리
WebAssembly (Wasm), originally developed by Mozilla, Google, Microsoft, Apple, and others at W3C, is a secure, cross-platform, and high-performance application runtime. It serves as the execution engine for compiled C/C++ applications in modern browsers.
As Wasm gains popularity in the browser, developers found that the same attributes that made Wasm successful on the client side are also important to server-side applications. Modern server-side applications in the multi-tenancy cloud need a secure, cross-platform, and high-performance runtime to support modern compiled languages such as Rust, C/C++, and Go. Furthermore, by supporting C/C++, Wasm runtimes can support high-level languages such as JavaScript, Ruby, Python, Kotlin, and PHP.
Before Wasm, Linux containers are commonly used to run these compiled applications in the cloud — eg a Rust or C++ app is compiled to x86_64 machine code and runs inside a Linux container. Wasm provides a more secure, much lighter, faster, and more portable alternative to Linux containers for this type of performance-minded server-side application.

Value propositions
Wasm’s move from client-side to server-side follows well-traveled paths of previous generations of technologies such as Java and JavaScript. Compared with existing solutions, Wasm offers some compelling value propositions on the server side.
Compared with the JVM and JavaScript engines, Wasm supports 20+ programming languages via the LLVM toolchain. In particular, it supports emerging memory-safe programming languages, such as Rust. At the same time, Wasm provides near-native performance without sacrificing safety.
Compared with the traditional Linux containers, Wasm runtimes are safer since they have much-reduced attack surfaces (no OS libraries) and much simpler software supply chains. Wasm applications are portable across OSes and CPUs. They can be AOT compiled to native machine code at deployment time achieving near-native performance. Furthermore, Wasm consumes much less memory and resources than Linux containers.
Wasm as containers
Last year, Docker announced its support for Wasm in partnership with WasmEdge (an open-source project under the CNCF).
The demo-microservices example is a fully featured microservice written in Rust. It provides a built-in HTTP server and a MySQL database client. It is compiled into Wasm and then deployed by Docker Compose in a WasmEdge container. In Docker Desktop, we see the size of the demo-microservices Wasm container image is only 3.05 MB, which is a fraction of traditional Linux images.

Wasm, and WasmEdge in particular, are supported by many mainstream container tools.
- crun and youki are OCI runtimes that support Wasm containers.
- containerd and CRI-O are CRI runtimes that support Wasm containers.
- Docker and Podman are user-facing management tools that support Wasm containers.
- Kubernetes, including kind, k3s, microk8s, OpenShift, and others, support orchestrating Wasm containers side by side with Linux containers.
Use cases for server-side WebAssembly
Cloud-native platforms need to support untrusted and high-performance applications. Wasm containers are great choices for these use cases.
Microservices
As microservices grow popular, the infrastructure costs associated with their management are exploding. That is especially problematic for a new generation of microservice applications that are computationally intensive (i.e., AI) and performance critical (i.e., edge cloud applications).
Serverless functions are publicly accessible microservices. They are the fastest-growing product sector in public clouds.
Wasm is a secure sandbox for compiled applications. It is lightweight and portable, runs applications at near-native performance, and works seamlessly with container ecosystem tools like K8s and Docker. Developers can use the same workflow to build, deploy, and manage Wasm Apps. Wasm is a great choice for the next-generation edge cloud-based microservices. See how to create database backed microservices in Rust and WasmEdge.
SaaS/UDF
As SaaS proliferates, the demands to automate, customize, or integrate SaaS products are also increasing. Traditional webhook-based SaaS APIs are slow, bloated, complex, and not secure enough for many automation use cases.
An emerging approach is for users to simply upload customization code onto the SaaS platform, which can be triggered by SaaS events. Examples include AWS Lambda, which allows you to customize AWS workflows through functions, and GitHub Actions, which allows users to automatically respond to events in GitHub using apps running on GitHub infra.
Wasm runtimes can be easily integrated into SaaS or database platforms. They are secure, portable, and lightweight. Once integrated, Wasm runtimes can run functions (or guest apps) written in a variety of different programming languages, supporting SaaS SDKs in all popular languages.
Streaming data
Modern data-intensive applications often need to filter, map, and transform data in streaming or messaging pipelines. That requires user-defined functions to be embedded into the data streaming platform.
For the same reason why Wasm is a great runtime for SaaS UDFs, it is a great choice for data streaming functions too. Furthermore, Wasm runtimes such as WasmEdge, provide high-performance APIs for AI/ML processing, which makes them ideal for running compute-intensive AI/ML workloads in many streaming analytics use cases.
Blockchain
Large public blockchain networks, such as Ethereum, EOS, Polkadot, NEAR, FileCoin, Cosmos, Ripple, have all committed to Wasm as their smart contract execution engines. In our view, smart contracts on public blockchain networks are decentralized serverless functions. Blockchains are ideal use cases for Wasm.
Show me the code
WasmEdge is a WebAssembly runtime that is specifically optimized for server-side and cloud-native applications. It is an open-source project managed by the Linux Foundation / CNCF. Its key features include the following.
- Seamlessly integrates into the existing cloud-native infra (e.g., Docker and K8s). Check out the Kubernetes guide.
- Fully supports the WASI specification for accessing operating system resources.
- Features a high-performance Ahead-of-Time (AOT) compiler, which drastically improves server-side application performance. It is the fastest WebAssembly on the market today.
- Supports non-block networking sockets and web services.
- Supports clients for databases, caches, and DOs.
- Supports AI inference frameworks and runtimes, such as Tensorflow, OpenVino, PyTorch, etc.
- Supports running high-level language apps written JavaScript, PHP, Python, Ruby and others.
- Comprehensive support for the Node.js API in JavaScript apps running in WasmEdge.
To see some code examples, check out the following tutorials. You could also refer to WasmEdge book.
The road ahead
The road ahead for server-side Wasm is very promising. WasmEdge has brought the cloud-native toolchain to WebAssembly, enabling developers to use their familiar workflow in Wasm application development. Companies such as Second State, Fermyon, Cosmonic, Suborbital, VMWare, Cloudflare, Fastly, SingleStore, Shopify, InfinyOn and Microsoft, have also launched/pre-launched their own WebAssembly-based public cloud services.
The Wasm community will continue to innovate in areas such as developer tooling and component model support. We expect more exciting news, tools, use cases, and partnerships to emerge in server-side Wasm.
Join our discord server or follow us on Twitter to stay updated! See you in the community and happy coding!
[웹 어셈블리 WSAM, webassembly] WebAssembly on the server-side : 서버측 웹어셈블리
원래 Mozilla, Google, Microsoft, Apple 및 기타 W3C에서 개발한 WebAssembly(Wasm) 는 안전한 크로스 플랫폼 고성능 애플리케이션 런타임입니다. 이는 최신 브라우저에서 컴파일된 C/C++ 애플리케이션의 실행 엔진 역할을 합니다.
Wasm이 브라우저에서 인기를 얻으면서 개발자들은 클라이언트 측에서 Wasm을 성공으로 이끈 동일한 속성이 서버 측 애플리케이션에도 중요하다는 사실을 발견했습니다. 멀티 테넌시 클라우드의 최신 서버 측 애플리케이션에는 Rust , C/C++ 및 Go 와 같은 최신 컴파일 언어를 지원하기 위한 안전한 크로스 플랫폼 고성능 런타임이 필요합니다 . 또한 C/C++를 지원함으로써 Wasm 런타임은 JavaScript , Ruby , Python , Kotlin 및 PHP 와 같은 고급 언어를 지원할 수 있습니다 .
Wasm 이전에는 Linux 컨테이너가 클라우드에서 이러한 컴파일된 애플리케이션을 실행하는 데 일반적으로 사용되었습니다. 예를 들어 Rust 또는 C++ 앱은 x86_64 기계어 코드로 컴파일되어 Linux 컨테이너 내에서 실행됩니다. Wasm은 성능을 중시하는 이러한 유형의 서버 측 애플리케이션을 위해 Linux 컨테이너보다 더 안전하고, 훨씬 가볍고, 빠르고, 이식성이 뛰어난 대안을 제공합니다.

가치 제안
클라이언트 측에서 서버 측으로의 Wasm의 이동은 Java 및 JavaScript와 같은 이전 세대 기술의 잘 알려진 경로를 따릅니다. 기존 솔루션과 비교하여 Wasm은 서버 측에서 몇 가지 강력한 가치 제안을 제공합니다.
JVM 및 JavaScript 엔진과 비교하여 Wasm은 LLVM 툴체인을 통해 20개 이상의 프로그래밍 언어를 지원합니다. 특히 Rust 와 같은 새로운 메모리 안전 프로그래밍 언어를 지원합니다 . 동시에 Wasm은 안전을 희생하지 않고도 기본에 가까운 성능을 제공합니다 .
기존 Linux 컨테이너와 비교할 때 Wasm 런타임은 공격 표면이 훨씬 줄어들고(OS 라이브러리 없음) 훨씬 단순한 소프트웨어 공급망을 갖기 때문에 더 안전 합니다. Wasm 애플리케이션은 OS와 CPU 간에 이식 가능합니다 . 배포 시 네이티브 기계 코드로 AOT 컴파일되어 네이티브에 가까운 성능을 얻을 수 있습니다 . 또한 Wasm은 Linux 컨테이너보다 훨씬 적은 메모리와 리소스를 소비합니다.
컨테이너로서의 Wasm
작년에 Docker는 WasmEdge (CNCF 산하 오픈 소스 프로젝트) 와의 파트너십을 통해 Wasm에 대한 지원을 발표했습니다.
데모 마이크로서비스 예제는 Rust로 작성된 모든 기능을 갖춘 마이크로서비스입니다. 내장된 HTTP 서버와 MySQL 데이터베이스 클라이언트를 제공합니다. 이는 Wasm으로 컴파일된 다음 Docker Compose에 의해 WasmEdge 컨테이너에 배포됩니다. Docker Desktop에서 데모 마이크로서비스 Wasm 컨테이너 이미지 의 크기는 3.05MB에 불과하며 이는 기존 Linux 이미지의 일부에 불과합니다.

특히 Wasm과 WasmEdge는 많은 주류 컨테이너 도구에서 지원됩니다.
- crun과 youki는 Wasm 컨테이너를 지원하는 OCI 런타임 입니다.
- Containerd 및 CRI-O는 Wasm 컨테이너를 지원하는 CRI 런타임 입니다.
- Docker 및 Podman은 Wasm 컨테이너를 지원하는 사용자 대상 관리 도구입니다.
- kind, k3s, microk8s, OpenShift 등을 포함한 Kubernetes는 Linux 컨테이너와 함께 Wasm 컨테이너 오케스트레이션을 지원합니다 .
서버 측 WebAssembly 사용 사례
클라우드 네이티브 플랫폼은 신뢰할 수 없는 고성능 애플리케이션을 지원해야 합니다. Wasm 컨테이너는 이러한 사용 사례에 적합한 선택입니다.
마이크로서비스
마이크로서비스의 인기가 높아짐에 따라 관리와 관련된 인프라 비용이 폭발적으로 증가하고 있습니다. 이는 계산 집약적(예: AI)이고 성능이 중요한(예: 엣지 클라우드 애플리케이션) 차세대 마이크로서비스 애플리케이션의 경우 특히 문제가 됩니다.
서버리스 기능은 공개적으로 액세스 가능한 마이크로서비스입니다. 이는 퍼블릭 클라우드에서 가장 빠르게 성장하는 제품 부문입니다.
Wasm은 컴파일된 애플리케이션을 위한 안전한 샌드박스입니다. 가볍고 휴대성이 뛰어나며 거의 기본 성능으로 애플리케이션을 실행하고 K8s 및 Docker와 같은 컨테이너 에코시스템 도구와 원활하게 작동합니다. 개발자는 동일한 워크플로를 사용하여 Wasm Apps를 구축, 배포 및 관리할 수 있습니다. Wasm은 차세대 엣지 클라우드 기반 마이크로서비스를 위한 탁월한 선택입니다. Rust 및 WasmEdge에서 데이터베이스 지원 마이크로서비스를 생성하는 방법을 알아보세요 .
SaaS/UDF
SaaS가 확산됨에 따라 SaaS 제품을 자동화, 사용자 정의 또는 통합하려는 요구도 증가하고 있습니다. 기존의 웹훅 기반 SaaS API는 느리고, 비대하고, 복잡하며, 많은 자동화 사용 사례에 충분히 안전하지 않습니다.
새로운 접근 방식은 사용자가 SaaS 이벤트에 의해 트리거될 수 있는 SaaS 플랫폼에 사용자 정의 코드를 업로드하기만 하면 되는 것입니다. 그 예로는 함수를 통해 AWS 워크플로를 사용자 정의할 수 있는 AWS Lambda, 사용자가 GitHub 인프라에서 실행되는 앱을 사용하여 GitHub의 이벤트에 자동으로 응답할 수 있는 GitHub Actions가 있습니다.
Wasm 런타임은 SaaS 또는 데이터베이스 플랫폼에 쉽게 통합될 수 있습니다. 안전하고 휴대 가능하며 가볍습니다. 통합되면 Wasm 런타임은 다양한 프로그래밍 언어로 작성된 기능(또는 게스트 앱)을 실행하여 널리 사용되는 모든 언어로 SaaS SDK를 지원할 수 있습니다.
Nebular Graph의 데이터베이스 UDF 예제를 참조하세요 .
스트리밍 데이터
최신 데이터 집약적 애플리케이션은 스트리밍 또는 메시징 파이프라인에서 데이터를 필터링, 매핑 및 변환해야 하는 경우가 많습니다. 이를 위해서는 사용자 정의 기능을 데이터 스트리밍 플랫폼에 내장해야 합니다.
Wasm이 SaaS UDF를 위한 훌륭한 런타임인 것과 같은 이유로 데이터 스트리밍 기능에도 훌륭한 선택입니다. 또한 WasmEdge 와 같은 Wasm 런타임은 AI/ML 처리를 위한 고성능 API를 제공하므로 많은 스트리밍 분석 사용 사례에서 컴퓨팅 집약적인 AI/ML 워크로드를 실행하는 데 이상적입니다.
블록체인
Ethereum, EOS, Polkadot, NEAR, FileCoin, Cosmos, Ripple과 같은 대규모 공용 블록체인 네트워크는 모두 Wasm을 스마트 계약 실행 엔진으로 사용하고 있습니다. 우리의 견해로는 퍼블릭 블록체인 네트워크의 스마트 계약은 분산형 서버리스 기능입니다. 블록체인은 Wasm의 이상적인 사용 사례입니다.
코드를 보여주세요
WasmEdge 는 서버 측 및 클라우드 네이티브 애플리케이션에 특별히 최적화된 WebAssembly 런타임입니다. Linux Foundation/CNCF에서 관리하는 오픈 소스 프로젝트입니다. 주요 기능은 다음과 같습니다.
- 기존 클라우드 기반 인프라(예: Docker 및 K8s)에 원활하게 통합됩니다. Kubernetes 가이드를 확인하세요 .
- 운영 체제 리소스에 액세스하기 위한 WASI 사양을 완벽하게 지원합니다 .
- 서버 측 애플리케이션 성능을 대폭 향상시키는 고성능 AOT(Ahead-of-Time) 컴파일러가 특징입니다. 현재 시장에서 가장 빠른 WebAssembly 입니다 .
- 비블록 네트워킹 소켓 및 웹 서비스를 지원합니다 .
- 데이터베이스, 캐시 및 DO 에 대한 클라이언트를 지원합니다 .
- Tensorflow, OpenVino, PyTorch 등과 같은 AI 추론 프레임워크 및 런타임을 지원합니다 .
- JavaScript , PHP , Python, Ruby 등 으로 작성된 고급 언어 앱 실행을 지원합니다 .
- WasmEdge에서 실행되는 JavaScript 앱의 Node.js API에 대한 포괄적인 지원입니다 .
몇 가지 코드 예제를 보려면 다음 자습서를 확인하세요. WasmEdge 책을 참조할 수도 있습니다 .
앞으로 나아갈 길
서버측 Wasm의 앞길은 매우 밝습니다. WasmEdge는 클라우드 기반 도구 체인을 WebAssembly에 도입하여 개발자가 Wasm 애플리케이션 개발에서 익숙한 워크플로우를 사용할 수 있도록 했습니다. Second State , Fermyon , Cosmonic , Suborbital , VMWare , Cloudflare , Fastly , SingleStore , Shopify , InfinyOn 및 Microsoft 와 같은 회사들 도 자체 WebAssembly 기반 공용 클라우드 서비스를 출시/사전 출시했습니다.
Wasm 커뮤니티는 개발자 도구 및 구성 요소 모델 지원과 같은 영역에서 계속 혁신할 것입니다. 우리는 서버 측 Wasm에서 더 흥미로운 뉴스, 도구, 사용 사례 및 파트너십이 나타날 것으로 기대합니다.
Discord 서버에 가입하거나 Twitter 에서 팔로우하여 최신 소식을 받아보세요! 커뮤니티에서 만나 즐거운 코딩하세요!
[출처] https://medium.com/wasm/webassembly-on-the-server-side-c584f874b4a3
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 4 |
[HTML/CSS] 4. 카드형 리스트
| 졸리운_곰 | 2018.08.22 | 1121 |
| 3 | HTML DIV tag : 영역 밖과 안쪽에 여백주기 - 마진과 패딩 Margin / Padding | 졸리운_곰 | 2018.07.12 | 538 |
| 2 |
HTML DIV tag: 테두리 너비 지정하는 방법 - WIDTH : 픽셀(px) 또는 퍼센트(%)
| 가을의곰 | 2017.06.10 | 827 |
| 1 |
SVG by HTML5
| 졸리운_곰 | 2015.11.12 | 463 |

