Danbooru (and forks like Moebooru) and Philomena use string arrays in the database for tags.
Edit: nevermind, Philomena has a table for the many-to-many relationship and uses Elasticsearch for the heavy lifting.
Edit: nevermind, Philomena has a table for the many-to-many relationship and uses Elasticsearch for the heavy lifting.
https://shon.github.io/2015/12/21/postgres_array_performance...
https://gist.github.com/joevandyk/031cf5812bd656887623
To search for a post with multiple tags, you need to do a join for each tag. You don't have that problem with arrays.