Menu

1 / 2

[Lime #2] How To Search Music

DEV Community·MinBapE·6 months ago
#oT4FWsHz
#dotnet#software#search#provider#results
Reading 0:00
15s threshold

What I worked on

I designed and implemented the music search pipeline for Lime.

Music search sounds simple. Take a query, return results.

But there was more to think about than expected.

Users should be able to search for music that isn't in Lime's internal DB yet

Calling external APIs on every search request is slow and costly

If an external API fails, search shouldn't break entirely

Saving every external result directly to the DB would pollute it with data nobody cares about

To satisfy these constraints, I split search into two separate flows.

The search API returns internal DB results and cached candidates first.

External provider searches are handled asynchronously through background Jobs.

What I built

Internal DB search for Artists, Albums, and Tracks

SearchCandidate model and candidate caching

SearchJob enqueueing and ExternalSearchWorker (background processing)

External provider interface with MusicBrainz and Spotify implementations

Per-provider Rate Limiter

Merging internal DB…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.