Caching database results in Golang (revel)

Started by
1 comment, last by ZAky 9 years ago

I am currently coding a web application in Go with the help of the revel web framework. I've come to the point where I want to serve results from a database, however there's quite an amount of rows to serve (~5000-10000). The information only changes every 3 minutes, so perhaps it's a good idea to implement some form of caching.

The Revel framework offers a caching solution, however I have no idea how such a thing would work and if it's the best solution to my problem. Another solution could be to make a global array with the results and grab a slice once in a while (Would this work better if there are a lot of users? ).

Could you guys help me out? I'd really appreciate it.

Advertisement

Some opensource Golang projects related to caching:

https://github.com/golang/groupcache

https://github.com/hashicorp/golang-lru

Any in memory cache will worth almost nothing in cluster deployment.

Just use Redis. Do not reinvent the wheel.

This topic is closed to new replies.

Advertisement