problem description
recently, we need to build a high-speed coupon distribution system. Now the mysql, used in the database has a sub-database and sub-table, but it has a bottleneck on the sending rate, and it is more complex for batch operations (the sub-database sub-table is done according to the user"s ID model, which is more troublesome for batch users, that is, irregular userId). Want to use redis or mongodb to do db, and then worker Synchronize to mysql (mysql for final protection and data analysis, not used in business). I am not familiar with mogno, is there any good solution?
the environmental background of the problems and what methods you have tried
consider using redis, directly, using the List structure to store a list of coupons for each user, with key as XXX_ {userId}. There are some problems that are difficult to solve, such as updating when using coupons, and regularly deleting expired data for a period of time, and so on.
related codes
/ / Please paste the code text below (do not replace the code with pictures)
what result do you expect? What is the error message actually seen?
is there a mature design scheme that can handle a large number of high-speed coupon issuing (insertion) operations, and has high performance support for concurrent processing and response speed in scenarios such as viewing / using coupons?