Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata Caching #35

Open
daniel-centore opened this issue Mar 28, 2017 · 4 comments
Open

Metadata Caching #35

daniel-centore opened this issue Mar 28, 2017 · 4 comments

Comments

@daniel-centore
Copy link
Member

daniel-centore commented Mar 28, 2017

Cache metadata on the server so we don't bump up again spotify's rate limiting with many users.

The metadata should be removed from cache when it gets stale to keep memory usage low and so we get metatdata updates if it ever changes (which should be infrequent but can happen).

@ConnorFoody
Copy link
Collaborator

ConnorFoody commented Mar 28, 2017

Do we want to make a separate service for this to avoid duplicates?

Maybe have @mluquette look into this?

@daniel-centore
Copy link
Member Author

Do we want to make a separate service for this to avoid duplicates?

What do you mean by "separate service"? Like an entirely separate program?

What do you mean by "avoid duplicates"? What duplicates are we avoiding?

I personally pictured this as being part of the same program, but otherwise completely separate endpoints and no code sharing (other than server setup and endpoint routing).

Maybe have @mluquette look into this?

Go for it. The way I picture it working is with endpoints for {track, artist, album} which accept a list of Spotify IDs and return the metadata for those URIs, either from our personal cache or by asking Spotify for them.

Do we want to think about setting up a database for this?

Quickstart: https://developer.spotify.com/web-api/endpoint-reference/

@ConnorFoody
Copy link
Collaborator

I thikn we are generally on the same page with design here, the only difference is combining the cache with the menext platform or not.

I would go with a separate service because I don't like platforms. I have found that platforms are harder to develop and less flexible to deploy. It creates a single point of failure and forces you to scale them at the same time. Additionally this is a natural fit for a separate service since there is no shared code.

A good DB for this might be Memcached or Redis. If you're serious about scaling this you should move to a real cloud provider like AWS. The clould platform should provide some managed caching services.

@daniel-centore
Copy link
Member Author

I would go with a separate service

Additionally this is a natural fit for a separate service since there is no shared code.

Alright, you make good points.

If you're serious about scaling this you should move to a real cloud provider like AWS.

Yeah, I might need to bite the bullet on that one. I have no time to set that up right now, though. For now we can abstract that away and do in memory with a key-value store in a separate class. It would be easy to switch out the backend later, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants