The single biggest question in the world right now is: How is Elon Musk so effective?
Marc Andreessen gives some nice personal anecdotes of what he's seen Elon do.
@crplanas@__alter123 @SumitM_X Wrote simple program. Yes ! FOR UPDATE allows reads.
But theory says different. Dug more, found…
InnoDB has default isolation level of REPEATABLE READ. So reads work.
Meaning: For update lock will work per isolation level of DB !!
Thanks for the mind exercise !!
@__alter123 @SumitM_X Yes sir. But not at the cost of making the row unavailable to the system. Imagine the system has a notification cron, needing to read the row. Or a reporting module… what then ?
As i said, ur solutions will work. But they don’t consider the tradeoffs viz. latency and throughput
@__alter123 @SumitM_X The SKIP LOCKED option instructs the database to ignore (or skip) any rows that are currently locked. This is useful where multiple processes work. If a row is already locked SKIP LOCKED allows the current transaction to move on to the next row instead of waiting for the lock.
@__alter123 @SumitM_X Tokens - My need it to take a product level lock. Why create a new entity (i.e. token) just for lock. I'd rather use the product identifier itself.
Btw ... good suggestions. And they will work. But do they provide low latency and high availability ?
@__alter123 @SumitM_X 2. Service layer lock - Microservice means Stateless. Pods with product affinity is antithesis of Microservices.
Even then, 1000 req/ sec ... imagine, if pod fails. It would take 30 seconds to come back ? Can we allow so many requests to wait ?
@SumitM_X 2 issues.
- Allow single access
- Expire the access in case no action
Solution
1. Take redis lock with ttl on seat
2. If Ttl is 30 seconds, lock expires if no user action
3. If lock taken, no other request passes
@__alter123 @SumitM_X - “for update..” will take pessimistic lock. Poor design for high throughputs
- Lock at service layer is bad. Pod can crash,lock will be lost. Redis is okay
- Tokens for groups solves a quota allocation. Not sure how it helps the original problem
@chamath@Hustle Link on indeed is deactivated. Too many applications, i'd guess. I'm alright with tech, and would be interested ... in case this opens up again. Cheers !
Hi @huisjames, i've made a ML-driven engine to scan/analyze/ generate top keywords for job profiles. Beta site for Java @ https://t.co/qu0sHSV5j8. Imagine integrating this tech into JobScan. Would supercharge job matches. Reached on LinkIn too. Would love to talk. #ML#JobSearch
Looking for Jobs + missing right keywords ?
#Resume#keywords#finder
https://t.co/qu0sHSV5j8
Upload your resume. Get best keywords for ur profile. ( Its free ... )
Like the tool ? like/ share.
Have feedback ? Want more functionality ? more tech domains ? ... plz comment.