Sometimes you need persistent storage or additional functionality provided by third-party libraries and services. This recipe will explore Redis as a form of non-relational data storage and showcase how a language such as Go can interact with these third-party services.
Since Redis supports key-value storage with a simple interface, it's an excellent candidate for session storage or temporary data that has a duration. The ability to specify a timeout on data stored in Redis is extremely valuable. This recipe will explore basic Redis usage from configuration, to querying, to using custom sorting.
Getting ready
Configure your environment according to these steps:
- Download and install Go 1.11.1 or above on youroperatingsystem fromhttps://golang.org/doc/install.
- Install Consul from https://www.consul.io/intro/getting-started/install.html.
- Open a Terminal or console application and create and navigate...