daydreamdev / seconds-kill Goto Github PK
View Code? Open in Web Editor NEW基于 Springboot + Redis + Kafka 的秒杀系统,乐观锁 + 缓存 + 限流 + 异步,TPS 从 500 优化到 3000
Home Page: https://gongfukangee.github.io/2019/06/09/SecondsKill
License: MIT License
基于 Springboot + Redis + Kafka 的秒杀系统,乐观锁 + 缓存 + 限流 + 异步,TPS 从 500 优化到 3000
Home Page: https://gongfukangee.github.io/2019/06/09/SecondsKill
License: MIT License
大小写的问题
com.daydreamdev.secondskill.common.Limit
com.daydreamdev.secondskill.common.StockWithRedis
请教一下,您写的(限流 + Redis 缓存库存 + KafkaTest 异步下单)这个接口在kafka发送消息到topic时,高并发的情况下会在redis中重复读到同一个版本号,到了消费者那里拿到版本号对应着数据库的进行更新会抛乐观锁的并发异常导致内容无法被消费,请问怎么解决
A线程更新完数据库,然后时间片给线程B了,这时B线程刚开始请求(拿到的是最新的版本号),更新完数据库和缓存,这时A再去更新缓存。这时不会发生不一致吗。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.