AI prompts
base on Redis re-implemented with SQL <img alt="Redka" src="logo.svg" height="80" align="center">
Redka aims to reimplement the core parts of Redis with SQL, while remaining compatible with Redis API.
Highlights:
- Data doesn't have to fit in RAM.
- Supports ACID transactions.
- SQL views for easier analysis and reporting.
- Uses SQLite or PostgreSQL as a backend.
- Runs in-process (Go API) or as a standalone server.
- Implements Redis commands and wire protocol (RESP).
Redka is [functionally ready](docs/roadmap.md) for 1.0. Feel free to try it in non-critical production scenarios and provide feedback in the issues.
## Use cases
Here are some situations where Redka might be helpful:
_Embedded cache for Go applications_. If your Go app already uses SQLite or just needs a built-in key-value store, Redka is a natural fit. It gives you Redis-like features without the hassle of running a separate server. You're not limited to just get/set with expiration, of course — more advanced structures like lists, maps, and sets are also available.
_Lightweight testing environment_. Your app uses Redis in production, but setting up a Redis server for local development or integration tests can be a hassle. Redka with an in-memory database offers a fast alternative to test containers, providing full isolation for each test run.
_Postgres-first data structures_. If you prefer to use PostgreSQL for everything but need Redis-like data structures, Redka can use your existing database as the backend. This way, you can manage both relational data and specialized data structures with the same tools and transactional guarantees.
## Commands
Redka supports five core Redis data types:
- [Strings](docs/commands/strings.md) are the most basic Redis type, representing a sequence of bytes.
- [Lists](docs/commands/lists.md) are sequences of strings sorted by insertion order.
- [Sets](docs/commands/sets.md) are unordered collections of unique strings.
- [Hashes](docs/commands/hashes.md) are field-value (hash)maps.
- [Sorted sets](docs/commands/sorted-sets.md) (zsets) are collections of unique strings ordered by each string's associated score.
Redka also provides commands for [key management](docs/commands/keys.md), [server/connection management](docs/commands/server.md), and [transactions](docs/commands/transactions.md).
## Installation and usage
Redka comes in two flavors:
- Standalone Redis-compatible server: [installation](docs/install-standalone.md), [usage](docs/usage-standalone.md).
- Go module for in-process use: [installation](docs/install-module.md), [usage](docs/usage-module.md).
You can also run an [in-process Redka server](example/server/main.go) as a lightweight alternative to Redis test containers, or as a small-scale production instance.
## Storage
Redka can use either SQLite or PostgreSQL as its backend. It stores data in a [relational database](docs/persistence.md) with a simple schema and provides views for better introspection.
## Performance
Redka is not about raw performance. You can't beat a specialized data store like Redis with a general-purpose relational backend like SQLite. However, Redka can still handle tens of thousands of operations per second, which should be more than enough for many apps.
See the [benchmarks](docs/performance.md) for more details.
## Contributing
Contributions are welcome. For anything other than bugfixes, please first open an issue to discuss what you want to change.
Make sure to add or update tests as needed.
## Acknowledgements
Redka would not be possible without these great projects and their creators:
- [Redis](https://redis.io/) ([Salvatore Sanfilippo](https://github.com/antirez)). It's such an amazing idea to go beyond the get-set paradigm and provide a convenient API for more complex data structures.
- [SQLite](https://sqlite.org/) ([D. Richard Hipp](https://www.sqlite.org/crew.html)). The in-process database powering the world.
- [Redcon](https://github.com/tidwall/redcon) ([Josh Baker](https://github.com/tidwall)). A very clean and convenient implementation of a RESP server.
Logo font by [Ek Type](https://ektype.in/).
## Support
Redka is mostly a [one-man](https://antonz.org/) project, not backed by a VC fund or anything.
If you find Redka useful, please star it on GitHub and spread the word among your peers. It really helps to move the project forward.
If you use Redka for commercial purposes, consider [purchasing support](https://antonz.gumroad.com/l/redka-plus).
★ [Subscribe](https://antonz.org/subscribe/) to stay on top of new features.
", Assign "at most 3 tags" to the expected json: {"id":"9341","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"