Sign inSign up

alsusar/hit-counter

By alsusar

Updated over 1 year ago

Simple API service that increments a counter persisted in Redis Cluster.

Image
Networking
Integration & delivery
Monitoring & observability
0

151

alsusar/hit-counter repository overview

Hit Counter

This repository contains a simple API service that increments a counter persisted in Redis Cluster. The Hit Counter API is a lightweight web service designed to track and increment hit counts for specified keys, typically used for monitoring page views or event occurrences. It exposes simple HTTP endpoints to increment and retrieve hit counts, persisting the data in a Redis Cluster for high availability and scalability. This makes it suitable for use cases where fast, distributed, and reliable counting is required.

Overview

This project implements a REST API with two endpoints:

  • /read — Returns the current counter value from Redis Cluster.
  • /write — Increments the counter in Redis Cluster and returns the new value.

The service is written in Go, containerized with Docker, and deployable to Kubernetes with provided manifests.


Architecture

The following diagram briefly shows the architecture

┌──────────────┐      ┌──────────────┐      ┌───────────────┐ 
│ Client       │ <--> │ hit-couter   │ <--> │ Redis Cluster │
│              │      │ API          │      │               │ 
└──────────────┘      └──────────────┘      └───────────────┘
  • hit-counter API: Handles /read and /write requests.
  • Redis Cluster: Stores the counter value.
  • Client: Who is running the request

More information: https://github.com/alsusar/hit-counter

Tag summary

Content type

Image

Digest

sha256:9e26c0b0d

Size

8.6 MB

Last updated

over 1 year ago

docker pull alsusar/hit-counter:1.0.0