You might want to check out Sphinx . This is a full-text search engine that processes distributed indexes. You may have pieces of data distributed on many computers. And a request to one server can send a request to other servers and collect the results from each. It has pretty good speed, but you probably can't do 100 billion messages on one machine.
You probably won't be able to do something like this in MySQL or Postgresql. Although you can store all the data, MySQL and Postgres do not have the full speed of indexing and text search, which will bring you a real full text index.
MySQL has a way to compile support for the Sphinx storage engine, which, although the data will still be stored in Sphinx separately from MySQL, you can still query the Sphinx search engine using everything related to MySQL, and also execute joins other tables that are in your MySQL database. However, if you just want to do simple searches in documents and don't need to be attached to other data, you can simply use the PHP native interface.
Kibbee
source share