在内存中持有一张大地图,还是执行多个sql调用?

I am coming from a background of web development but now am building my first server application in Go and have some questions.

The application will get a lot of http requests containing a string that I need to lookup and validate, basically if the string exists in database it is valid.

Normally I do a new SQL query at every incoming http request, but are there better to just do one big SQL request at init and load all the 50.000 strings into a map in memory? And use that for fast lookup?

It depends on the string size and the amount of strings.

If they fit in memory just fine go for memory mapping them, else query the DB.

PS: This is not really a question, neither does it have a definitive answer.