NoSQL Database Examples
Github Source: https://github.com/gogf/examples/tree/main/nosql
📄️ Redis
Demonstrates comprehensive Redis integration with GoFrame for caching, session storage, and data persistence. This example showcases Redis connection setup and configuration with GoFrame's redis component, basic operations including GET/SET/DEL, data structure operations (strings, hashes, lists, sets, sorted sets), TTL and expiration management, pipeline and transaction support, pub/sub messaging patterns, and connection pooling configuration. Features include simple and cluster mode support, automatic connection management, error handling and retry logic, integration with GoFrame's cache component, serialization and deserialization helpers, and production-ready patterns. Ideal for implementing application caching, session management, rate limiting, distributed locks, real-time messaging, and high-performance data storage in microservices architectures.
📄️ MongoDB
Demonstrates comprehensive MongoDB integration with GoFrame for document-based data storage and retrieval. This example showcases MongoDB connection setup and configuration with official Go driver, CRUD operations (Create, Read, Update, Delete) for documents, advanced querying with filters and projections, aggregation pipeline usage for data analysis, index creation and management for performance, transaction support for data consistency, and connection pooling configuration. Features include automatic connection management, error handling patterns, integration with GoFrame's ORM concepts where applicable, document marshaling/unmarshaling, pagination support, and production-ready database operations. Ideal for building applications requiring flexible schema design, document-oriented data models, complex aggregations, horizontal scalability, and NoSQL database integration in microservices architectures.