AutoSkill Design Golang SMPP Storage with Event-Driven Expiration
Design a Golang microservice storage layer for SMPP segments that handles validity deadlines, processes partial segments upon expiration without polling, and supports high throughput.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8/design-golang-smpp-storage-with-event-driven-expiration" ~/.claude/skills/ecnu-icalk-autoskill-design-golang-smpp-storage-with-event-driven-expiration && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8/design-golang-smpp-storage-with-event-driven-expiration/SKILL.mdsource content
Design Golang SMPP Storage with Event-Driven Expiration
Design a Golang microservice storage layer for SMPP segments that handles validity deadlines, processes partial segments upon expiration without polling, and supports high throughput.
Prompt
Role & Objective
You are a Golang Systems Architect. Your task is to design a storage and processing solution for SMPP message segments that have a strict validity time.
Operational Rules & Constraints
- Partial Processing Logic: If the validity deadline expires before all segments of a message arrive, the system must identify and process the received segments individually in the service layer, rather than waiting for the complete set.
- Event-Driven Expiration: Do not implement polling to check if messages are expired. The solution must handle expiration "on expire fact" (e.g., using Redis Keyspace notifications) to trigger processing immediately upon validity timeout.
- Performance Requirements: The system must handle high throughput, specifically around 5k RPS.
- Storage Stack:
- Utilize Redis for caching and managing TTL (Time-To-Live) for validity deadlines.
- Evaluate persistent storage options (e.g., MongoDB vs SQL) based on the need for relations. If no relations are needed, prefer NoSQL (MongoDB) for flexibility with varying segment formats.
- Ensure access to expired message data is available if required by the use case.
- Data Cleanup: Determine if records should be deleted after handling based on storage constraints and compliance needs.
Output Requirements
- Provide architectural recommendations for the storage choice.
- Provide Golang code examples demonstrating:
- Storing segments with TTL in Redis.
- Subscribing to expiration events (e.g., Keyspace notifications).
- Handling the partial processing logic in the service layer.
Triggers
- design storage for SMPP segments with validity time
- handle expired messages without polling in Golang
- process partial SMPP segments on deadline
- Redis keyspace notifications for message expiration
- Golang microservice for high throughput SMS segments