Skip to content
flipkart-incubatorPublic

About

No description, website, or topics provided.

Resources

Contributing

Stars

16 stars

Watchers

8 watching

Forks

Latest commit

 

History

2,158 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

title The Krystal Project

The Krystal Project

Latest Releases

Krystal BOM

Maven Central

  • 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:

Lattice BOM

Maven Central

  • 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:

Sub Modules

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.

Core

krystal-common

  • What it has
  • 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: Maven Central
  • Location: ./krystal-common
  • BOM: Krystal BOM

krystal-codegen-common

  • What it has
    • Shared utilities for Krystal annotation processors and code generators
  • When to use
    • As a transitive dependency when using vajram-codegen or other Krystal codegen modules
    • Rarely added directly by application developers
  • Coordinates: Maven Central
  • Location: ./krystal-codegen-common
  • BOM: Krystal BOM

krystal-visualization

  • 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: Maven Central
  • Location: ./krystal-visualization
  • BOM: Krystal BOM

krystal-gradle-plugin

  • What it has
    • The com.flipkart.krystal Gradle plugin and Krystal-scoped build tasks
    • Wires krystalModelsGen into compileJava so models and vajram implementations are generated on every compile
  • When to use
    • In every Gradle project that uses Vajram codegen — apply id 'com.flipkart.krystal' in build.gradle
  • Coordinates: Maven Central
  • Location: ./krystal-gradle-plugin
  • BOM: Krystal BOM

Krystex

krystex (Krystal Executor)

  • What it has
    • The runtime execution engine for synchronous workflow DAGs (kryons, executors, decorators)
    • Built-in vajram integration — VajramGraph, KrystexGraph, and KrystexVajramExecutor compile 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: Maven Central
  • Location: ./krystex
  • README: krystex/README.md

Vajram

vajram-java-sdk

  • 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: Maven Central
  • Location: ./vajram/vajram-java-sdk
  • BOM: Krystal BOM
  • README: vajram-java-sdk/README.md

keka

  • 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
  • Coordinates: Maven Central
  • Location: ./keka

vajram-codegen-common

  • What it has
    • Shared codegen utilities specific to the Vajram annotation model
  • When to use
    • As a transitive dependency of vajram-codegen and Vajram extension codegen modules
  • Coordinates: Maven Central
  • Location: ./vajram/vajram-codegen-common
  • BOM: Krystal BOM

vajram-codegen

  • 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 krystalModelsGenProcessor dependency in every project that defines vajrams; pair with the com.flipkart.krystal Gradle plugin
  • Coordinates: Maven Central
  • Location: ./vajram/vajram-codegen
  • BOM: Krystal BOM

Vajram extensions

vajram-guice

  • What it has
    • A kryon decorator that resolves @Inject facet values from a Guice injector
  • When to use
    • When wiring vajram @Inject facets from a Guice-managed application context (see vajram-samples)
  • Coordinates: Maven Central
  • Location: ./vajram/extensions/guice/vajram-guice
  • BOM: Krystal BOM

vajram-cdi

  • 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: Maven Central
  • Location: ./vajram/extensions/cdi/vajram-cdi

vajram-json / vajram-json-codegen

vajram-fory / vajram-fory-codegen

vajram-protobuf-util / vajram-protobuf-codegen-util

vajram-protobuf3 / vajram-protobuf3-codegen

vajram-protobuf2024e / vajram-protobuf2024e-codegen

GraphQL

vajram-graphql / vajram-graphql-codegen

SQL

vajram-sql / vajram-sql-codegen

vajram-sql-vertx / vajram-sql-vertx-codegen

Resilience

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: Maven Central
  • Location: ./vajram/extensions/resilience4j/vajram-resilience4j

Lattice

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.

Core

lattice-core

  • What it has
    • Core Lattice runtime — LatticeApplication, dopant model, and application container APIs
  • When to use
    • As the foundation for any Lattice-based service or executable application
  • Coordinates: Maven Central
  • 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: Maven Central
  • Location: ./lattice/lattice-codegen
  • BOM: Lattice BOM
Lattice extensions
Dependency injection

lattice-cdi / lattice-cdi-codegen

lattice-guice / lattice-guice-codegen / lattice-guice-servlet

gRPC

lattice-grpc / lattice-grpc-codegen

REST

lattice-rest-api / lattice-rest / lattice-rest-codegen

lattice-rest-quarkus / lattice-rest-quarkus-codegen

lattice-rest-dropwizard / lattice-rest-dropwizard-codegen

GraphQL

lattice-graphql-rest / lattice-graphql-codegen

Quarkus runtime

lattice-quarkus / lattice-quarkus-codegen

MCP and A2A

lattice-mcp / lattice-mcp-quarkus-codegen

lattice-a2a / lattice-a2a-codegen

Preface

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:

Introduction

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.

Design Goals

Components of the Krystal Project adhere to the following design goals:

  1. 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
  2. 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.
  3. 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.
  4. Out-of the box Non-intrusive batching of service-call inputs
  5. 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
  6. Avoid unnecessary bottlenecks and latency long poles: ...
  7. 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.
  8. Observability - application owners get this Out of the Box:
    • Circuit Breaking
    • Live Service Call Dashboards
    • Degradation levers
    • Metrics
    • Logging
    • DAG visualization of a request
  9. Testability
    • Backward-incompatibility detection
    • Mocking-out-of-the box
    • Declarative unit test definition
    • Auto-generated unit test code/templates
  10. 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.

Krystal developer FAQs

Contribution

Code formatting

All java code should be formatted using the google-java-formatter. Building the code autoformats the code. To formatting code in the IDE, use:

How to bump up to Krystal framework version?

Follow the below-mentioned steps for the Krystal version bump -

  1. Build and publish vajram-codegen with new version to local maven repo. Ensure the vajram-codegen dependencies version should not be updated.
  2. 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.
  3. Update the vajram-codegen to the new version.

Example : Need to update version from 1.6 to 1.7

  1. vajram-codegen (build.gradle) update
    • update version from 1.6 to 1.7
    • Build and gradle publishToMavenLocal in krystal root directory
  2. krystal (build.gradle) update
    • update version from 1.6 to 1.7
    • set classpath 'com.flipkart.krystal:vajram:'+ project.krystal_version in vajram-codegen's buildscript block to classpath 'com.flipkart.krystal:vajram:1.6'
    • Build and gradle publishToMavenLocal in krystal root directory
  3. Final update
    • revert classpath 'com.flipkart.krystal:vajram:1.6'+ project.krystal_version in vajram-codegen's buildscript block to classpath 'com.flipkart.krystal:vajram:'+ project.krystal_version
    • Build and publishToMavenLocal and publish in krystal root directory

About

No description, website, or topics provided.

Resources

Contributing

Stars

16 stars

Watchers

8 watching

Forks

Releases

Packages

Contributors

Languages