我们将 Cassandra 用于 OLTP DB、存储 DB 事务并评估报告解决方案的要求。
我们正在评估使用 Cassandra 来报告具有扁平架构的数据库。
使用 Cassandra 作为报告数据库的优势/缺陷是什么?
我们非常频繁地调用身份联合服务来获取用户令牌,并且几乎在身份服务上运行负载测试。
一个潜在的解决方案是在现有应用程序中缓存用户令牌,但是使用本机 spring-cache,我们可以使单个缓存条目过期吗?
通过下面的示例,我能够清除缓存,删除所有条目,但是我试图使单个条目过期。
@Service
@CacheConfig(cacheNames = {"userTokens"})
public class UserTokenManager {
static HashMap<String, String> userTokens = new HashMap<>();
@Cacheable
public String getUserToken(String userName){
String userToken = userTokens.get(userName);
if(userToken == null){
// call Identity service to acquire tokens
System.out.println("Adding UserName:" + userName + " Token:" + userToken);
userTokens.put(userName, userToken);
}
return userToken;
}
@CacheEvict(allEntries = true, cacheNames = { "userTokens"})
@Scheduled(fixedDelay = 3600000)
public void removeUserTokens() {
System.out.println("##############CACHE CLEANING##############, " +
"Next Cleanup scheduled at : " + new Date(System.currentTimeMillis()+ …Run Code Online (Sandbox Code Playgroud) 我们要求从表中加载最近30天的更新数据.
下面的潜在解决方案之一不允许这样做.
select * from XYZ_TABLE where WRITETIME(lastupdated_timestamp) > (TOUNIXTIMESTAMP(now())-42,300,000);
select * from XYZ_TABLE where lastupdated_timestamp > (TOUNIXTIMESTAMP(now())-42,300,000);
Run Code Online (Sandbox Code Playgroud)
该表有列
lastupdated_timestamp (with an index on this field)
lastupdated_userid (with an index on this field)
Run Code Online (Sandbox Code Playgroud)
任何指针......
正在寻找使用 AWS Lambda 连接到 Amazon Keyspaces(AWS Managed Cassandra)的示例程序,但找不到任何相同的示例程序。
database amazon-web-services cassandra aws-lambda amazon-keyspaces
对于电子商务 Web 应用程序的购物车(和结帐流程)用例,使用关系数据库(RDBMS) 或NoSQL DB作为 MongoDB/Cassandra/others哪个更好?
从目录的角度来看,NoSQL使用灵活的架构、数据/节点的水平扩展成为理想的用例。
购物车用例的每种方法的优缺点是什么?
cassandra ×4
nosql ×3
aws-lambda ×1
caching ×1
database ×1
mongodb ×1
oracle ×1
rdbms ×1
spring-boot ×1
spring-cache ×1