I am developing small application in PHP that will need to store small number of data but with frequent updates. Basically it will indefinetly collect information about our virtualization infrastructure and sometimes it will create an overview. And I am not sure which storage model/technology to use.
The collector thread will check cca 20 hosts with 100 virtual machines and need to store it somewhere as frequent as needed (maybe even every 5 secs). This will be an PHP-cli application. Sometimes there will be request on a webpage that need to aggregate all these information and produce list of host, VMs, etc…
I have considered these options:
- PHP Sessions
+ very simple to use (I just point session to one shared file)
+ Atomic operation
– Session locking (PHP will manage session looking but if the script needs to write into session it will block all others)
- Own implementation of “sessions” – store data in files
+ I can handle the locking problem myself, probably split data into more files
– Lot of work/testing with maybe only a little benefits
- Mysql/SQLite/PostgreSQL
+ Robust solution
– I may run into locking problem or I will need to do row locking etc…
– Not sure if the database will not take a lot of disk space due to frequent updates
You can try using MySQL memory storage engine for those tables. .
Pros:
Cons: