Introduction to Enterprise Applications Link to heading

The term “enterprise” in the context of software development often elicits mixed reactions. However, for the purpose of this discussion, let’s define an enterprise application as a comprehensive, collaboratively developed solution that adheres to high standards of long-term maintenance. Such an application is characterized by its modular design, both internally and externally, ease of integration, and its ability to address complex business challenges efficiently and reliably.

If you have a suggestion for a more apt term that encapsulates these qualities, feel free to share, and we will consider adopting it.

Series Outline Link to heading

  1. Overview
  2. Framework analysis and selection: Delving into the specifics of framework selection and application.
    1. Core Components: Database management, modularization, internal RPC, AMQP.
    2. Web and API: Web Server, GraphQL API.
    3. Application Development: Web, CLI, desktop, and mobile app development.
    4. Miscellaneous Tools: Observability, logging, machine learning.
  3. Boilerplate project: A comprehensive guide including setup instructions for selected frameworks, architectural diagrams, and development environment configurations.

Context Link to heading

You are embarking on a project where Rust’s capabilities align well with your requirements. Your decision to use Rust encompasses several areas: embedded firmware, backend/APIs, web frontend, CLI tools, batch processing, and mobile library code. Flutter will complement Rust for the mobile applications themselves. Currently, you are evaluating Rust’s evolving ecosystem for your machine learning requirements.

Your team’s experience in developing enterprise-grade applications using integration patterns and modular designs in languages like Java and C# will guide your approach. Your familiarity with such tools and techniques is a key consideration in your selection process.

There will be a need for a primary backend (i.e., PostgreSQL), and also one or more secondary special-purpose backends, so an event-driven, CQRS approach is likely on the table.

This series will not delve into the reasons behind choosing Rust or your specific architectural preferences, as these topics are extensively covered by other resources on the web. The short answer is: you want the safety, static analysis, and performance.

Assumptions Link to heading

Design Principles Link to heading

  • Adherence to the 12-factor methodology.
  • When we modify data, announce a domain event.
  • Ensuring graceful shutdowns for smooth deployment transitions.
  • Resilient programming techniques shall be used whenever possible (retry, fallback, timeout, circuit breaker, etc)
  • Prefer async/await interfaces wherever feasible.

Technology Stack Link to heading

  • Rust
  • Primary datastore: PostgreSQL.
  • Secondary datastores: Redis, TBD analytics backend, more to come.
  • IAM: Keycloak
  • Message Bus: RabbitMQ or simliar (AMQP 0.9.1 or 1.0)
  • Deployment targets: web, mobile, cli

Framework Selection Considerations Link to heading

Framework Options Link to heading

The following options are based on cursory research.

  1. Database Frameworks: diesel, sqlx, ormX, seaorm.
  2. Internal Modularization/M2M: tower, bevy_ecs, ecs-rust, sai, actix, actix_service, norpc, lapin, amiquip, amqprs, rabbitmq-stream-rust-client
  3. External API: actix-net, tonic, volo, zino, motore, cqrs, datacake-rpc.
  4. Web Frameworks: actix-web, axum, rocket, hyper, poem, salvo, warp.
  5. GraphQL: juniper, async-graphql.
  6. Machine Learning and Statistics: polars, linfa, RustLearn.
  7. GUI Frameworks (Web/Desktop/Mobile): dioxus, tauri, yew, egui, rinf, flutter-rs, flutter_rust_bridge
  8. CLI Frameworks: clap-rs, cliparser, dioxus

Cross cutting concerns Link to heading

  1. Observability: log, tracing, opentelemetry, etc.

Evaluation Metrics Link to heading

Frameworks will be evaluated based on criteria such as GitHub stars, recent activity, open issues, dependents on crates.io, online buzz, availability of documentation or books, ease of use post-tutorial, and compatibility with other chosen frameworks.

Research Link to heading

A collection of articles, links, and tutorials that provide insights into the various topics will be compiled. This will aid in informed decision-making and understanding the state of the Rust ecosystem in each area.

General Link to heading

Database Link to heading

Modularity Link to heading

Machine Learning Link to heading

AMQP Link to heading

GUI Link to heading

Security Link to heading

Future consideration Link to heading

Future posts will explore topics such as distribution strategies for our code, and the potential segmentation of components into sub-services, akin to a microservices architecture.