renovate-bot / GoogleCloudPlatform-_-serverless-production-readiness-java-gcp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serverless Production Readiness and Optimization for Java in Google Cloud

🧪 Status: living repo - All code samples are deployable in Cloud Run at all times and will constantly be updated with new versions, features and use additional Google Cloud Services.

Description This material provides guidelines, best practices and samples focused on production-ready, optimized, modern Java applications deployed in Cloud Run in GCP

Features

There are multiple aspects to writing effective services for serverless production environments and they all revolve around the combination of service design, implementation, testing, configuration with environment configuration and optimization best practices.

The focus of these materials revolves around:

You generally think that a production-ready cloud service must be stable, reliable, scalable, performant, Fault Tolerant (without any single point of failure), properly monitored, documented, well-understood and properly secured

Optimizing any app for Cloud Run requires a balance of different aspects to be considered, therefore it is important to always have a clear picture of what it is that you are optimizing for: start-up time, execution latency, resource consumption (memory & CPU), concurrency, image size, easy maintainability and lower costs

Runtime technologies

The samples within this repository leverage different runtime technologies in the Java space

The Sample App

A set of services is provided to illustrate the various concepts, following the architecture below.

All services are documented and can be built from a single script as per README.md in the services folder.

Each service can be built/tested/deployed individually or as part of the entire architecture

  • Quotes Service - manage quotes from famous books, persisted in CloudSQL (Postgres)
  • Audit Service - audit updates (persisted in Firestore)
  • Reference Service - invoked by BFF service at start-up, to read reference data
  • Faulty Service - illustrate a faulty service for resiliency purposes
  • BFF Service - Backend-for-frontend service for downstream services

App

Getting Started

Clone this Git repository:

git clone https://github.com/ddobrin/serverless-production-readiness-java-gcp.git

or open the repo directly in Cloudshell:

Open in Cloud Shell

Prerequisites

  • Machine:
    • The code is constantly being tested on MacBooks and Linux environments
    • Test in your Windows machine, if preferred
  • The IDE of your choice
  • Java 21 - previous LTS
    • Install via SDKMan or your favorite package manager
  • GraalVM for building Native Java Images
    • Install via SDKMan - sdk install java 21-graal
    • Install directly from GraalVM Download site
  • API Testing

Contributing

Contributions to this library are always welcome and highly encouraged.

See CONTRIBUTING for more information how to get started.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See Code of Conduct for more information.

License

Apache 2.0 - See LICENSE for more information.

About

License:Apache License 2.0


Languages

Language:Java 88.6%Language:Shell 7.9%Language:HCL 2.7%Language:Smalltalk 0.5%Language:Dockerfile 0.3%