hero image

HexStack - Fast and Elegant backend applications

Hello World!,

In this blog we will be talking about -

  1. What is HexStack?
  2. How is it different from it's competitors?
  3. How I came up with the idea?
  4. Where is it now and where will it go?

1. What is HexStack?

HexStack is collection of 3 (might be more in future) rust based tools to create backend web application that has best in class developer experience.

  1. Ripress -> It's like express for 10-11x faster (crates.io).
  2. Wynd -> It's like ws but for rust, with a nice event driven API (crates.io).
  3. Lume -> It's like drizzle for rust, with focus on being minimal and typesafe (coming soon).

HexStack's DX is actually unmatched in rust community.

use ripress::{app::App, types::RouterFns};
use wynd::wynd::{Wynd, WithRipress};

#[tokio::main]
async fn main() {
    let mut wynd: Wynd<WithRipress> = Wynd::new();
    let mut app = App::new();

    wynd.on_connection(|conn| async move {
        conn.on_text(|event, handle| async move {
            handle.send_text(&format!("Echo: {}", event.data)).await.unwrap();
        });
    });

    app.get("/", |_, res| async move { res.ok().text("Hello World!") });
    app.use_wynd("/ws", wynd.handler());

    app.listen(3000, || {
        println!("Server running on http://localhost:3000");
        println!("WebSocket available at ws://localhost:3000/ws");
    })
    .await;
}

This is all it takes to create a simple web server and a websocket server using two components of HexStack, and this is just a small part of what HexStack can do.

You can check out the HexStack repo for more details.

Benchmarks

Ripress Benchmarks

Ripress Benchmarks

  1. Ripress consistently delivers over 160k–180k requests per second, putting it in the same league as Actix-web, one of the fastest Rust frameworks.
  2. Compared to Express, Ripress is 10–11x faster across all tested routes (Hello World, JSON, and User Route).
  3. Average latency is just 1.05 ms, essentially matching Actix, but with a much simpler and more ergonomic API.
Wynd Benchmarks

Wynd Benchmarks

  1. Wynd achieves the lowest latency (8.63 ms), outperforming both Tokio-Tungstenite (9.60 ms) and Actix (11.2 ms).
  2. Throughput is highly competitive, right in the same league as Tokio-Tungstenite, while still maintaining its clean, event-driven API.
  3. This means with Wynd you get both snappier response times and a simpler developer experience — a rare combo in the Rust WebSocket space.

I know these types of benchmark they don't mean much, but I have yet to come up with a better way to measure performance.

More benchmarks coming soon.

Quick start
cargo install hexstack
hexstack new --template full

2. How is it different from it's competitors?

The biggest difference between the components of HexStack is that the components are fast but still have BEST in class developer experience. I have never seen any other library that has this kind of developer experience.

The components are fast because they are written in Rust and are built on top of some amazing technology, and the best part is that performance is not even my focus yet. It will be on my radar in future but for now, I am focusing solely on developer experience and tight integrations between the 3 components.

I want these components to be usable separately, but I also want them to work together.

use ripress::{app::App, types::RouterFns};

#[tokio::main]
async fn main() {
    let mut app = App::new();

    app.use_cors(None).use_rate_limiter(None).use_middleware("/upload", file_upload(None));

    app.get("/", |_, res| async move { res.ok().text("Hello World!") });

    app.listen(3000, || {
        println!("Server running on http://localhost:3000");
        println!("WebSocket available at ws://localhost:3000/ws");
    })
    .await;
}

This is how you would create a simple hello world server using Ripress (every method on app is chainable).

use wynd::wynd::{Wynd, Standalone};

#[tokio::main]
async fn main() {
    let mut wynd: Wynd<Standalone> = Wynd::new();

    wynd.on_connection(|conn| async move {
        conn.on_text(|msg, handle| async move {
            handle.send_text(&format!("Echo: {}", msg.data)).await.unwrap();
        });
    });

    wynd.listen(8080, || {
        println!("Server listening on ws://localhost:8080");
    })
    .await
    .unwrap();
}

This is how you would create a echo websocket server using Wynd.

And this is how you would integrate both of them together.

use ripress::{app::App, types::RouterFns};
use wynd::wynd::{Wynd, WithRipress};

#[tokio::main]
async fn main() {
    let mut wynd: Wynd<WithRipress> = Wynd::new();
    let mut app = App::new();

    wynd.on_connection(|conn| async move {
        conn.on_text(|event, handle| async move {
            let _ = handle.send_text(&format!("Echo: {}", event.data)).await;
        });
    });

    app.get("/", |_, res| async move { res.ok().text("Hello World!") });
    app.use_wynd("/ws", wynd.handler());

    app.listen(3000, || {
        println!("Server running on http://localhost:3000");
        println!("WebSocket available at ws://localhost:3000/ws");
    })
    .await;
}

In most projects, this level of integration is a "nice to have" feature, but it is a must-have for every component of HexStack.

3. How I came up with the idea?

I was creating a cloud based coding env where for my backend I decided to use Rust, but the http server was way too complex for my Typescipty brain.

So I decided to give it some time and try to make a small personal project like express but for rust, and i thought i would use it as a learning experience to learn rust and http at the same time.

I would have an http server framework that i never thought of publishing but it turned out pretty good so i did, so this is my first rust project and i am very happy with it.

4. Where is it now and where will it go?

HexStack currently has 2 components released, Ripress and Wynd, and both of them already have users, both combined have more than 30k downloads on crates.io.

They are already usable and have tight integration with each other.

Wynd is still in early stage of development, but Ripress is already at 1.8.0 and has a lot of features that u might need.

Lume is planned to be developed in the future, and it will be a minimal and type safe schema builder / orm much like drizzle.

Try it Today!!

You can run the cli command to install HexStack cli to scaffold your project.

cargo install hexstack

hexstack new --template full # For Ripress and wynd both together.
hexstack new --template rirpess # For just Ripress.
hexstack new --template wynd # For just Wynd.

Then follow with it.

You can try out Ripress and Wynd on crates.io and crates.io respectively.

Conclusion

Thank you for taking the time to read this.

Stay tuned for further updates. Some nice things are happening!!
Till then See Yaa!