go-api-badger-cache-tutorial

command module
v0.0.0-...-17b2b45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 11 Imported by: 0

README

Go API Embedded Cache Example

This repo contains an API using Go that incorporates an embedded cache capable of scaling safely to any specified number of replicas.

The use of a embedded cache alongside change data capture (CDC) invalidation is a powerful technique offers a robust method to ensure our high-performance cache remains synchronized with its primary data source.

In this pattern, we'll use the following components:

  1. Postgres as the primary database.
  2. Debezium to capture changes in Postgres and push to Redis Streams.
  3. Redis Streams to effectively handle and transmit change events.
  4. Ristretto as an in-memory caching solution in Go.
  5. Go as the primary language for implementing the service.

Diagrams:

Arch

Read Sequence

Edit Sequence

Setup

Dependencies

Install Go Packages:

go mod tidy

Run Locally

This will setup the db and services:

make restart

This will run the go application:

go run main.go

Test It Out

Postman Collection

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL