caching/

directory
v0.0.0-...-361c87b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2017 License: Apache-2.0

README

Caching

As already discussed, the day-to-day activities of a data scientists usually involve a lot of gathering, loading, and organizing data. In performing these duties, you will likely encounter pieces of data that you need frequently, are difficult to obtain quickly, or are otherwise nice to have close to your application. There are a variety of great caching and embedded database options when working with Go. We will explore a couple here, go-cache and boltdb.

Notes

  • A cache isn’t meant to be used as a persistent datastore.
  • A cache created with go-cache can be safely used by multiple goroutines.

go-cache Docs
Intro to BoltDB

Code Review

Cache data in memory
Save data in an embedded key/value store

Exercises

Exercise 1

Cache the Citibike status codes in memory. Then, GET the current Citibike station statuses, and output all stations that are "Not in Service."

Template | Answer


All material is licensed under the Apache License Version 2.0, January 2004.

Directories

Path Synopsis
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 go build ./example1 Sample program to show how to cache data from an API.
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 go build ./example1 Sample program to show how to cache data from an API.
Sample program to save data from an API in an embedded k/v store.
Sample program to save data from an API in an embedded k/v store.
exercises
exercise1
Sample program to show how to cache data from an API, and then use that data in analyzing a dataset.
Sample program to show how to cache data from an API, and then use that data in analyzing a dataset.
template1
Sample program to show how to cache data from an API, and then use that data in analyzing a dataset.
Sample program to show how to cache data from an API, and then use that data in analyzing a dataset.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL