Storing logs of payments, sql, nosql or files?

0 like 0 dislike
13 views
There is some software that performs payments and here are the signs:

payments (payment_id int primary key auto_increment) - more than know about it nothing
payment_log (payment_id int, text text, date_add datetime default now());

Payments in day a few thousand (10-15 differently - at the moment about 35mln entries), each payment has a different number of logs. from a few records to a few dozen. They are written not for the work cycle, and the log can be added after some time. For example weighs in payment process due to problems on the gateway and every status polling we logichem every n minutes. Why not work to make something like {'payment_id': 123, 'logs': [...., ...., ....]}, to write and forget. Need a quick addition to the list( or some other structure) by key.

with the table of payments problems are not present, works quickly with proper indexes, and so on. Logs of payments are also working fine, but I don't want to store them in the main database because they are only used for display in the web interface and that at the time of any proceedings.

option 1. Leave as is, minus the fact that don't like aesthetically, uvelichivaetsya time backup etc. everything is obvious.
option 2. To move logs in nosql (any Mongo or radish), especially had Affairs like that, so I don't know
option 3. To transfer files saveasascii on ID: for the id of 12345678 file will lie somewhere in /mnt/payment_logs/1/2/3/4/5/1234578.txt - also do not like aesthetically

Fashin
In General asking for help on where to store data like {'payment_id': 123, 'logs': [{'date_add': '...', 'text': 'log #1'}, {'date_add': '...', 'text': 'log #2'}] and Istrum dobavlenie in the collection of logs for payment_id.
by | 13 views

3 Answers

0 like 0 dislike
by
0 like 0 dislike
Text files are usual.
If you're going that there to really look for regularly - some sort of ElasticSearch (if you sharpened mnogoseriynoe - cluster) or Sphinx (if you sharpened on speed)
by
0 like 0 dislike
It is a pity that you do not have postgresql, and since you have rarely and rarely to access that data, it would be possible to make protezirovanie of the plate and move the vault table on another drive (slow and cheap).
by

Related questions

0 like 0 dislike
7 answers
asked Mar 28, 2019 by ZhukV
0 like 0 dislike
6 answers
asked Mar 25, 2019 by darkslesh
0 like 0 dislike
3 answers
0 like 0 dislike
4 answers
0 like 0 dislike
7 answers
asked Mar 24, 2019 by piratarusso
110,608 questions
257,186 answers
0 comments
28,644 users