| title | The Krystal Project |
|---|
- Software Bill-Of-Materials artefact with all krystal artefacts inclusing extensions
- Excludes lattice related artefacts
- Use if you want Vajram, krystex and/or krystal models:
- Software Bill-Of-Materials artefact with all krystal & Lattice artefacts, including extensions
- Use if you want lattice application framework along with vajram, krystex and krystal models:
The monorepo is organized into publishable library modules (sample projects under *-samples are
omitted). Each entry below lists what the module contains, when to use it, its Maven coordinates,
project location, and BOM membership. Green coordinate badges denote Krystal BOM
artefacts; blue badges denote Lattice BOM artefacts; uncoloured badges are published
separately and not yet managed by a BOM.
- What it has
- Common annotations and classes used across all Krystal modules
- Basic interfaces and spec for the Krystal modelling framework
- When to use
- To model in-memory data with the Krystal modelling framework
- Automatically pulled in as an API dependency when using any other Krystal module
- Coordinates:
- Location: ./krystal-common
- BOM: Krystal BOM
- What it has
- Shared utilities for Krystal annotation processors and code generators
- When to use
- As a transitive dependency when using
vajram-codegenor other Krystal codegen modules - Rarely added directly by application developers
- As a transitive dependency when using
- Coordinates:
- Location: ./krystal-codegen-common
- BOM: Krystal BOM
- What it has
- Tools to generate visual representations of Krystal graphs (for example, static HTML call graphs)
- When to use
- To inspect or document the dependency structure of a vajram graph at build or dev time
- Coordinates:
- Location: ./krystal-visualization
- BOM: Krystal BOM
- What it has
- The
com.flipkart.krystalGradle plugin and Krystal-scoped build tasks - Wires
krystalModelsGenintocompileJavaso models and vajram implementations are generated on every compile
- The
- When to use
- In every Gradle project that uses Vajram codegen — apply
id 'com.flipkart.krystal'inbuild.gradle
- In every Gradle project that uses Vajram codegen — apply
- Coordinates:
- Location: ./krystal-gradle-plugin
- BOM: Krystal BOM
- What it has
- The runtime execution engine for synchronous workflow DAGs (kryons, executors, decorators)
- Built-in vajram integration —
VajramGraph,KrystexGraph, andKrystexVajramExecutorcompile vajram definitions into kryons and execute them
- When to use
- To execute vajram-based business logic at runtime (the standard path for Krystal applications)
- When building a custom executor integration on top of Krystex kryon primitives
- Coordinates:
- Location: ./krystex
- README: krystex/README.md
- What it has
- The Vajram programming model — annotations, base types, and APIs for defining synchronous scatter-gather business logic
- When to use
- Whenever you write vajrams (the primary artefact for application business logic)
- Coordinates:
- Location: ./vajram/vajram-java-sdk
- BOM: Krystal BOM
- README: vajram-java-sdk/README.md
- What it has
- An experimental standalone language embodying Krystal design philosophy (not the primary Java SDK)
- When to use
- For experimentation with the keka programming model; production workflows should use
vajram-java-sdk
- For experimentation with the keka programming model; production workflows should use
- Coordinates:
- Location: ./keka
- What it has
- Shared codegen utilities specific to the Vajram annotation model
- When to use
- As a transitive dependency of
vajram-codegenand Vajram extension codegen modules
- As a transitive dependency of
- Coordinates:
- Location: ./vajram/vajram-codegen-common
- BOM: Krystal BOM
- What it has
- Vajram annotation processors and validators that generate vajram models and implementation stubs at compile time
- When to use
- If you are writing vajrams, add this as a
krystalModelsGenProcessordependency in every project that defines vajrams; pair with thecom.flipkart.krystalGradle plugin
- If you are writing vajrams, add this as a
- Coordinates:
- Location: ./vajram/vajram-codegen
- BOM: Krystal BOM
- What it has
- A kryon decorator that resolves
@Injectfacet values from a Guice injector
- A kryon decorator that resolves
- When to use
- When wiring vajram
@Injectfacets from a Guice-managed application context (seevajram-samples)
- When wiring vajram
- Coordinates:
- Location: ./vajram/extensions/guice/vajram-guice
- BOM: Krystal BOM
- What it has
- Jakarta CDI integration for injecting facet values into vajrams
- When to use
- When your runtime uses CDI (for example, Quarkus or other Jakarta EE containers) instead of Guice
- Coordinates:
- Location: ./vajram/extensions/cdi/vajram-cdi
- What it has
- JSON (Jackson) as a
SerdeProtocolfor Krystal models, plus the annotation processor that generates_ImmutJsonwrappers
- JSON (Jackson) as a
- When to use
- For human-readable wire formats, REST/JSON APIs, or debugging serialized model payloads
- Coordinates:
·
- Location: ./vajram/extensions/json/vajram-json · ./vajram/extensions/json/vajram-json-codegen
- BOM: Krystal BOM
vajram-fory / vajram-fory-codegen
- What it has
- Apache Fory binary serialization as a
SerdeProtocol, plus codegen for_ImmutForywrappers
- Apache Fory binary serialization as a
- When to use
- For high-throughput, same-language pipelines that need fast binary serialization without
.protoschemas
- For high-throughput, same-language pipelines that need fast binary serialization without
- Coordinates:
·
- Location: ./vajram/extensions/fory/vajram-fory · ./vajram/extensions/fory/vajram-fory-codegen
- BOM: Krystal BOM
- README: vajram-fory/README.md · vajram-fory-codegen/README.md
vajram-protobuf-util / vajram-protobuf-codegen-util
- What it has
- Protocol-agnostic runtime and codegen helpers shared by all Krystal Protobuf
SerdeProtocolimplementations
- Protocol-agnostic runtime and codegen helpers shared by all Krystal Protobuf
- When to use
- Pulled transitively by protobuf3 or protobuf 2024 edition modules; rarely declared directly
- Coordinates:
·
- Location: ./vajram/extensions/protobuf/vajram-protobuf-util · ./vajram/extensions/protobuf/vajram-protobuf-codegen-util
- BOM: Krystal BOM
vajram-protobuf3 / vajram-protobuf3-codegen
- What it has
- Proto3
SerdeProtocolsupport and codegen that generates.protoschemas and protobuf-backed model wrappers
- Proto3
- When to use
- For schema-evolvable binary contracts, gRPC services, or cross-language interoperability with proto3
- Coordinates:
·
- Location: ./vajram/extensions/protobuf/vajram-protobuf3 · ./vajram/extensions/protobuf/vajram-protobuf3-codegen
- BOM: Krystal BOM
vajram-protobuf2024e / vajram-protobuf2024e-codegen
- What it has
- Protobuf edition 2024
SerdeProtocolsupport and matching codegen
- Protobuf edition 2024
- When to use
- When targeting protobuf edition 2024 features and syntax instead of classic proto3
- Coordinates:
·
- Location: ./vajram/extensions/protobuf/vajram-protobuf2024e · ./vajram/extensions/protobuf/vajram-protobuf2024e-codegen
- BOM: Krystal BOM
- README: vajram-protobuf2024e/README.md
vajram-graphql / vajram-graphql-codegen
- What it has
- Capabilities to execute vajrams by invoking GraphQL queries, plus schema-to-vajram codegen
- When to use
- When exposing or consuming vajram logic through a GraphQL interface
- Coordinates:
·
- Location: ./vajram/extensions/graphql/vajram-graphql · ./vajram/extensions/graphql/vajram-graphql-codegen
- BOM: Krystal BOM
vajram-sql / vajram-sql-codegen
- What it has
- Declarative SQL table and query modelling in Krystal graphs, plus annotation processors for SQL compute vajrams
- When to use
- To model and execute SQL operations as first-class vajrams inside a Krystal graph
- Coordinates:
·
- Location: ./vajram/extensions/sql/vajram-sql · ./vajram/extensions/sql/vajram-sql-codegen
- BOM: Krystal BOM
- README: vajram-sql/README.md · vajram-sql-codegen/README.md
vajram-sql-vertx / vajram-sql-vertx-codegen
- What it has
- Vert.x-based SQL execution backend for
vajram-sql, plus codegen for Vert.x result wrappers
- Vert.x-based SQL execution backend for
- When to use
- When running SQL vajrams against databases via the Vert.x SQL client
- Coordinates:
·
- Location: ./vajram/extensions/sql/vertx/vajram-sql-vertx · ./vajram/extensions/sql/vertx/vajram-sql-vertx-codegen
- BOM: Krystal BOM
- README: vajram-sql-vertx-codegen/README.md
vajram-resilience4j
- What it has
- Resilience4j decorators for circuit breakers and bulkheads around vajram invocations
- When to use
- To add fault-tolerance policies to vajram execution without embedding resilience logic in business code
- Coordinates:
- Location: ./vajram/extensions/resilience4j/vajram-resilience4j
Lattice is the application framework for packaging vajrams (or other logic) into deployable services.
See lattice/README.md for concepts like LatticeApplication, dopants, and
service exposure.
lattice-core
- What it has
- Core Lattice runtime —
LatticeApplication, dopant model, and application container APIs
- Core Lattice runtime —
- When to use
- As the foundation for any Lattice-based service or executable application
- Coordinates:
- Location: ./lattice/lattice-core
- BOM: Lattice BOM
lattice-codegen
- What it has
- Shared codegen infrastructure for all Lattice annotation processors and extensions
- When to use
- As a transitive dependency of Lattice extension codegen modules
- Coordinates:
- Location: ./lattice/lattice-codegen
- BOM: Lattice BOM
lattice-cdi / lattice-cdi-codegen
- What it has
- Jakarta CDI as the Lattice dependency-injection framework, plus CDI-specific codegen
- When to use
- When building Lattice apps on CDI (for example,
@LatticeApp(dependencyInjectionFramework = CdiFramework.class))
- When building Lattice apps on CDI (for example,
- Coordinates:
·
- Location: ./lattice/extensions/cdi/lattice-cdi · ./lattice/extensions/cdi/lattice-cdi-codegen
- BOM: Lattice BOM
lattice-guice / lattice-guice-codegen / lattice-guice-servlet
- What it has
- Guice (and Guice Servlet) as Lattice DI frameworks, plus Guice-specific codegen
- When to use
- When building Lattice apps on Guice instead of CDI, including servlet-hosted deployments
- Coordinates:
·
·
- Location: ./lattice/extensions/guice/lattice-guice · ./lattice/extensions/guice/lattice-guice-codegen · ./lattice/extensions/guice/lattice-guice-servlet
- BOM: Lattice BOM
lattice-grpc / lattice-grpc-codegen
- What it has
- gRPC service hosting for Lattice apps, plus codegen for gRPC stubs and service bindings
- When to use
- To expose vajrams as gRPC services (pair with a matching
SerdeProtocolsuch as protobuf3 or protobuf 2024e)
- To expose vajrams as gRPC services (pair with a matching
- Coordinates:
·
- Location: ./lattice/extensions/grpc/lattice-grpc · ./lattice/extensions/grpc/lattice-grpc-codegen
- BOM: Lattice BOM
lattice-rest-api / lattice-rest / lattice-rest-codegen
- What it has
- REST API contracts, REST service dopant, and codegen that wires vajrams to HTTP endpoints
- When to use
- To turn
@InvocableOutsideProcessvajrams into REST APIs inside a Lattice application
- To turn
- Coordinates:
·
·
- Location: ./lattice/extensions/rest/lattice-rest-api · ./lattice/extensions/rest/lattice-rest · ./lattice/extensions/rest/lattice-rest-codegen
- BOM: Lattice BOM
lattice-rest-quarkus / lattice-rest-quarkus-codegen
- What it has
- Quarkus-specific REST stack integration for Lattice REST services
- When to use
- When hosting Lattice REST APIs on Quarkus (see
rest-json-quarkus-lattice-sample)
- When hosting Lattice REST APIs on Quarkus (see
- Coordinates:
·
- Location: ./lattice/extensions/rest/quarkus/lattice-rest-quarkus · ./lattice/extensions/rest/quarkus/lattice-rest-quarkus-codegen
- BOM: Lattice BOM
lattice-rest-dropwizard / lattice-rest-dropwizard-codegen
- What it has
- Dropwizard-specific REST stack integration for Lattice REST services
- When to use
- When hosting Lattice REST APIs on Dropwizard (see
rest-json-dropwizard-lattice-sample)
- When hosting Lattice REST APIs on Dropwizard (see
- Coordinates:
·
- Location: ./lattice/extensions/rest/dropwizard/lattice-rest-dropwizard · ./lattice/extensions/rest/dropwizard/lattice-rest-dropwizard-codegen
- BOM: Lattice BOM
lattice-graphql-rest / lattice-graphql-codegen
- What it has
- GraphQL-over-REST support for Lattice apps, plus GraphQL service codegen
- When to use
- To expose vajrams through GraphQL inside a Lattice application (see
graphql-rest-json-lattice-sample)
- To expose vajrams through GraphQL inside a Lattice application (see
- Coordinates:
·
- Location: ./lattice/extensions/graphql/rest/lattice-graphql-rest · ./lattice/extensions/graphql/lattice-graphql-codegen
- BOM: Lattice BOM
lattice-quarkus / lattice-quarkus-codegen
- What it has
- Quarkus runtime integration for Lattice applications, plus Quarkus-specific codegen
- When to use
- As the base Lattice + Quarkus stack for Quarkus-hosted services (REST, MCP, A2A samples)
- Coordinates:
·
- Location: ./lattice/extensions/quarkus/lattice-quarkus · ./lattice/extensions/quarkus/lattice-quarkus-codegen
- BOM: Lattice BOM
lattice-mcp / lattice-mcp-quarkus-codegen
- What it has
- Model Context Protocol (MCP) server support for Lattice apps, plus Quarkus MCP codegen
- When to use
- To expose Lattice vajrams as MCP tools (see
mcp-quarkus-lattice-sample)
- To expose Lattice vajrams as MCP tools (see
- Coordinates:
·
- Location: ./lattice/extensions/mcp/lattice-mcp · ./lattice/extensions/mcp/quarkus/lattice-mcp-quarkus-codegen
- BOM: Lattice BOM
lattice-a2a / lattice-a2a-codegen
- What it has
- Agent-to-Agent (A2A) server support for Lattice apps, plus A2A codegen
- When to use
- To build A2A-compatible agent servers on Lattice (see
a2a-quarkus-lattice-sample)
- To build A2A-compatible agent servers on Lattice (see
- Coordinates:
·
- Location: ./lattice/extensions/a2a/lattice-a2a · ./lattice/extensions/a2a/lattice-a2a-codegen
- BOM: Lattice BOM
- README: lattice/extensions/a2a/README.md
This README gives a high level view of the krysal project. To understand the basics of krystal. It's important to go through two more documents:
Super-charging the development of synchronous and asynchronous business workflows.
The Krystal Project facilitates a developer-friendly way to write high-performant, complex, business logic which is easily maintainable and observabe. The project encompasses the following major components.
- Vajram: A programming model which allows developers to design and write code for synchronous scatter gather business logic in a 'bottom-up' (choreographed) manner.
- Krystex: The runtime environment that executes vajram-based business logic. It understands static dependencies between vajrams, compiles them into a logical Directed-Acyclic-Graph of kryons, and executes the DAG with maximal concurrency.
- Honeycomb: An asynchronous workflow orchestrator which orchestrates the asynchronous parts of worflows written in the vajram programming model.
Components of the Krystal Project adhere to the following design goals:
- Separation of functional contracts and non-functional implementation details of dependencies:
Developers coding a
piece of functional business logic which depends on some other piece of business logic should be
completely shielded
from non-functional implementation details of the dependency as well as the runtime details of
the environment in
which the business logic is executing. Here non-functional requirements include:
- Session-level Caching
- Concurrency mode (multithreaded thread-per-task model, vs. reactive vs. hybrid model)
- Batching and batch size of dependency inputs
- Minimize lateral and upward impact of code changes: If all the business logic executing to fulfill a request is seen as a Directed acyclic graph, a code change being made in a kryon in the graph should not impact the implementation of any other kryon in the graph which is a direct descendant of it.
- Zero glue code: If there is business logic A and business logic B, all the relevant business logic should be contained within the artefact which represents each piece of business logic.
- Out-of the box Non-intrusive batching of service-call inputs
- Optimal end-to-end execution: This programming model is designed to be adopted for executing
complex business logic
in systems that power features and user experiences which directly are accessed by end users of
websites with heavy traffic, thus
strongly needing a low-latency, high-throughput execution runtime.
- Minimize use of native OS threads
- Avoid the possibility of developers erroneously blocking on thread-blocking-code pre-maturely.
- Streaming-over-network-connection capable
- Avoid unnecessary bottlenecks and latency long poles: ...
- Developer friendliness:
- Minimal bootstrapping overhead
- Dependency discovery
- Code generation
- Single point of coding - One-to-one atomic mapping of coding units and functional requirements.
- Minimize mental-overhead and avoid antipatterns inherent to reactive coding
- Programming-language-native developer experience: For example, type safety.
- Observability - application owners get this Out of the Box:
- Circuit Breaking
- Live Service Call Dashboards
- Degradation levers
- Metrics
- Logging
- DAG visualization of a request
- Testability
- Backward-incompatibility detection
- Mocking-out-of-the box
- Declarative unit test definition
- Auto-generated unit test code/templates
- Programming language agnostic spec definitions: Although the project currently supports the java programming language, keeping the programming-model spec language-agnostic allows the programming model to have implementations in different languages and allows application owners/feature-developers to choose a language of their choice.
All java code should be formatted using the google-java-formatter. Building the code autoformats the code. To formatting code in the IDE, use:
Follow the below-mentioned steps for the Krystal version bump -
- Build and publish vajram-codegen with new version to local maven repo. Ensure the vajram-codegen dependencies version should not be updated.
- Update the new version in Krystal project build.gradle file and revert the vajram-codegen version to previous version. Do a complete build and publish to local maven repo.
- Update the vajram-codegen to the new version.
Example : Need to update version from 1.6 to 1.7
- vajram-codegen (build.gradle) update
- update version from 1.6 to 1.7
- Build and
gradle publishToMavenLocalin krystal root directory
- krystal (build.gradle) update
- update version from 1.6 to 1.7
- set
classpath 'com.flipkart.krystal:vajram:'+ project.krystal_versionin vajram-codegen's buildscript block toclasspath 'com.flipkart.krystal:vajram:1.6' - Build and
gradle publishToMavenLocalin krystal root directory
- Final update
- revert
classpath 'com.flipkart.krystal:vajram:1.6'+ project.krystal_versionin vajram-codegen's buildscript block toclasspath 'com.flipkart.krystal:vajram:'+ project.krystal_version - Build and
publishToMavenLocalandpublishin krystal root directory
- revert