July 7, 2022

Building a unified GraphQL API with Apollo Router

Table of Contents Overview Configuration Supergraph schema Router configuration Customization. Implementation of a plugin Launch Testing Possible alternatives Conclusion Useful links Overview In this article, you will see a practical example of building a unified GraphQL API (supergraph) composed of multiple GraphQL APIs (subgraphs). This is achieved with Apollo Router whose first version was recently released. The Apollo Router is written in Rust, which provides better performance over Node.js-based @apollo/gateway library (usage of the latter was covered in my previous article). Read more

November 10, 2021

Monitoring Rust web application with Prometheus and Grafana

Table of Contents Overview Exposing Prometheus metrics in a Rust application Metrics definition Counter Gauge Histogram System metrics Endpoint for metrics exposition Prometheus setup for metrics gathering Expression browser and graphing interface Grafana setup for metrics visualization Monitoring metrics of application container using cAdvisor Setup of alert notifications using rules and AlertManager Monitoring third-party systems using Prometheus exporters Launch Conclusion Useful links Overview In this article, I’ll show you how to set up monitoring of a Rust web application. Read more

June 21, 2021

Getting started with MongoDB and Redis in Rust

Table of Contents Overview Launch MongoDB and Redis Data initialization Implementation of the application Dependencies Project structure main function Working with MongoDB Working with Redis Web application Launch and testing CI/CD Conclusion Useful links Overview This guide will show you how to create a Rust web backend that uses MongoDB, a document-based database, to store data and Redis for caching, rate limiting, and notifications. For visibility purposes, created demo application will also be a web application that exposes REST API. Read more

April 26, 2021

Introduction to gRPC in Rust

Table of Contents Overview Implementation Service definition and code generation gRPC server gRPC client Launch and testing CI/CD Conclusion Useful links Overview In this article, you will see how to create gRPC server and client in Rust. For visibility purposes, the client will also be a Telegram bot. Finally, the following architecture will be obtained: This article is not a complete tutorial on gRPC in Rust, but rather a practical guide demonstrating the basics and how to create a gRPC-based application. Read more

December 21, 2020

GraphQL in Rust

Table of Contents Introduction Overview Stack of technologies Prerequisites Implementation Dependencies Core functions Query and type definition N+1 problem Interface definition Custom scalar definition Mutation definition Subscription definition Integration tests GraphQL API client API security Enum definition Work with dates Apollo Federation support Apollo Server Interaction with a database Project launch and API testing Subscription test CI/CD Conclusion Useful links This article is also available in Russian and Chinese. Read more

© Roman Kudryashov 2019-2022

Powered by Hugo & Kiss.