How should I deal with a vocabulary with many terms? I'm trying to use Drupal 8, but if Drupal 7 is better for that, I'm ready to go back to Drupal 7.

I have a vocabulary that must contain at least 10,000 terms, but they can also become more than 100,000.  For the sake of simplicity, I chose to make only one vocabulary, without hierarchy. 

I quickly reached the limits of my server, and I regularly get WSODs,  especially when I try to edit the vocabulary. 

I tried to increase the limits of memory (I am under MAMP), but I still have errors. Here is the error:


  Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /core/lib/Drupal/Core/Entity/Sql/Sq


How can I avoid these problems?
Is it preferable to split the vocabulary?
Since i can't answer it in comment. i'll try to answer here. I've solve similar problem, my solution is using redis caching and entity cache module

Since then, my site going well with 256MB RAM configuration in php.ini.