Code Monkey home page Code Monkey logo

swir's Introduction

Build Status License GitHub release Awesome Badges

SWIR or Sidecar Written in Rust

For alternative meaning of SWIR

Rationale

SWIR is a platform allowing you to build applications for the cloud and on-prem environments quickly by providing an abstraction layer between your business logic and the infrastructure.

How it works

SWIR exposes a set of high level APIs that your business logic component uses to tap into underlying resources such as PubSub, State, Service Invocation. SWIR API specification in OpenApi 3.0 format can be found here

Usecases

Examples of SWIR in action for Docker, Kubernetes and AWS ECS are descibed here

Top Level Architecture

Diagram

Rust

Rust is a safe language, and side by side benchmarks show that the applications which are written in Rust achieve performance comparable with applications written in C or C++. In choosing an implementation language for a sidecar, these two factors are probably the most important. Rust language secure design guarantees that an attacker can't compromise the sidecar due to problems with memory safety. At the same time, since sidecar is responsible for most of the application's system-level functionality, it is crucial to minimise sidecar's impact on the performance. As Rust has no runtime nor garbage collector, it can run very fast and with small latency.

About Swir

This project is just a starting point to a conversation about sidecars, particularly for solutions consisting of many event-driven components. Even then it has some interesting features mainly because of the quality of crates created and maintained by Rust community: SWIR:

  • has moved to asynchronous programming
  • uses Hyper to expose REST interfaces over HTTP or HTTPS
  • uses Tonic to handle gRPC calls
  • uses rdkafka to talk to Kafka brokers
  • uses Nats to talk to NATS brokers
  • uses rusoto AWS SDK for Rust
  • uses redis-rs Redis SDK for Rust
  • is using modified config-rs so various aspects can be configured via a yaml file and environment variables can be easily injected based on an environment
  • adapted and improved mDNS(https://github.com/swir-rs/rust-mdns) to advertise/resolve services
  • SWIR uses conditional compilation which allows creating sidecars with just Kafka or Kafka and NATS
  • HTTP and gRPC Java and Python clients and other components allowing testing it end to end

Requirements

  • Docker, Docker Compose to build the project, run the infrastructure and the examples.
  • Minikube to run examples for Kubernetes
  • AWS account to run AWS based examples
  • Rust 1.44.1 or above

Similar Frameworks

SWIR has been influenced by Microsoft's Distributed Application Runtime - Dapr. It is hard to compete with Microsoft's unlimited resources, but someday perhaps SWIR might achieve a parity :)

swir's People

Contributors

dawid-nowak avatar dependabot[bot] avatar madamanu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

swir's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.