Understanding How Good Features Work with mysql

Asked 1 years ago, Updated 1 years ago, 86 views

We are currently making SNS and are trying to implement the functions of the Good Button.
If you want to use mysal to implement good functionality in the database
It seems that a large amount of insert and delete (such as 10 million lines) will occur, so isn't it difficult to implement with mysql?
I'm wondering if there's any other way.

Press the Good button → Notify the user in the message box and count up the good of the post (Good will show 10 posts if 10 posts are listed).
If you cancel Good, delete the notification and reduce the count.
Count and aggregate data for each article on redis with key: article id.

When I thought about these things, I thought it would be better to use Redis to store all the data related to these good functions, but there is a memory limit, so I'm worried.
I thought about Elasticsearch, but is it safe to handle data compared to mysql?There are many things I don't understand (because I haven't used it for a long time and haven't used it).

Inserts, deliveries, count-ups, aggregations, etc. frequently occur
In general, what kind of configuration do you use?
I would appreciate it if you could teach me.
Thank you for your cooperation.

mysql elasticsearch redis

2022-09-30 18:55

1 Answers

It's not difficult to manage 10 million records of data with MySQL, and if it's a good feature, it's easy to index, so there shouldn't be any problems.I also run more than 10 million records of data, but if I have enough memory, the memory cache works, so the processing is surprisingly fast.

Also, 50 Byte is sufficient for the Good feature record size, so the required capacity is 500MB.It's easy to put everything in memory, even considering the amount of space required for the indexer.

Counting "good" for each article, such as "good" if there are 10 articles listed, is very complicated, so you can reduce the aggregation significantly by calculating when you press or cancel the "good" button and saving it to the database.

With a system of this size, I think we can deal with it by improving the processing bottlenecks.


2022-09-30 18:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.