[英]Resource sharing in a distributed java environment
We have a collection of resources to be distributed to users. 我们有一系列资源可以分发给用户。 Every resource will start in a state
<resource_id, READY, timestamp_when_this_resource_expires>
每个资源将以状态
<resource_id, READY, timestamp_when_this_resource_expires>
Upon receiving a http request from the user, each web server thread should 收到用户的http请求后,每个Web服务器线程应
<resource_id, IN_USE, timestamp_when_this_resource_expires>
<resource_id, IN_USE, timestamp_when_this_resource_expires>
I am new to MySQL, I need some help. 我是MySQL的新手,我需要一些帮助。 Two questions
两个问题
Our platform: 我们的平台:
A connection pool won't work out of the box if you have multiple machines serving up resources. 如果您有多台计算机在提供资源,则连接池将无法立即使用。 You could use a clustered cache such as Redis with Sentinel.
您可以使用群集缓存,例如Redis和Sentinel。 This allows you to have keys with a TTL (Time to Live) and also allows for mutual exclusion.
这使您可以使用带有TTL(生存时间)的键,还可以互斥。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.