架构:数据持久化、搜索和推荐系统
Architecture : Data Persistency , Search and Recommendation System
我正在计划一个涉及数据持久性、搜索功能和推荐功能(协同过滤)的项目。
如图所示,我在想:
1) 有一组微服务来处理将持久保存在 NoSQL 存储中的实体(可能 MongoDb)
2) 对于搜索功能,我将使用 Slor,来自微服务的消息将用于更新 Slor 索引。
3) 对于建议,我正在考虑使用 Apache Mahout 并使用消息队列更新 Mahout 中使用的 Slor 索引
我的问题是:
1) 这是处理此类问题的正确架构吗?
2) 是否需要 3 个数据存储:MongoDB 用于数据持久化,Slor(Lucene 索引)用于搜索,mahout 使用 Solr(Lucene 索引)用于推荐?
3) 由于 Slor 也是一种 NoSQL 解决方案,那么在不使用 MongoDB 的情况下使用 Solr 来实现持久性和搜索功能的缺点是什么?
4) 如果我想使用 Hadoop 或 Apache Sparks 进行分析,这涉及引入另一个数据存储?
这个架构看起来很合理。您可以使用相同的 Solr 集群进行常规搜索和 Recommender 搜索。如果您想将自己的数据输入写入 Spark,您可以实现一种方法来从 MongoDB 实例化 Mahout IndexedDataset。已经有一个伴随对象,用于将 (String, String) 的 PairRDD 作为单个事件的输入并创建 IndexedDataset。这将消除对 HDFS 的需求。
Spark 保存临时文件但不需要 HDFS 进行存储。如果您使用的是 AWS,则可以将 Spark 再训练工作放到 EMR 上,以启动进行训练,然后再拆除。
所以答案是:
是的,看起来很有道理。您应该始终将事件流保存在某个安全的存储空间中。
不需要,只需要MongoDB和Solr,只要能从MongoDB读取到Spark即可。这将在 Recommender 训练代码中使用 Mahout 的 SimilarityAnalysis.cooccurrence
的 Spark 代码完成
没有已知的缺点,不确定性能或 devops 权衡。
您必须使用 Mahout 的 SimilarityAnalysis.cooccurrence Spark,因为它实现了新的 "Correlated Cross-occurrence" (CCO) 算法,这将大大提高您使用不同形式的用户数据的能力反过来会提高推荐的质量。如果您使用 MongoDB 或 Solr.
输入事件,Spark 不需要 HDFS 存储
顺便说一句:ActionML helps with the Data Science part of this, we can help you determine which user information is most predictive. We created the first open source implementation of CCO. We have seen very large increases in quality of recommendation by including the right CCO data (much greater than the Netflix prize 10%). We also support the PredictionIO implementation of the above architecture. We wrote the Universal Recommender based on Mahout (I'm a Mahout committer), but it is much more turnkey than building the system from scratch, however our analysis help is independent of the implementation and might help you on the Data Science part of the project. ActionML.com, Universal Recommender here。全部免费OSS。
我正在计划一个涉及数据持久性、搜索功能和推荐功能(协同过滤)的项目。
如图所示,我在想:
1) 有一组微服务来处理将持久保存在 NoSQL 存储中的实体(可能 MongoDb)
2) 对于搜索功能,我将使用 Slor,来自微服务的消息将用于更新 Slor 索引。
3) 对于建议,我正在考虑使用 Apache Mahout 并使用消息队列更新 Mahout 中使用的 Slor 索引
我的问题是:
1) 这是处理此类问题的正确架构吗?
2) 是否需要 3 个数据存储:MongoDB 用于数据持久化,Slor(Lucene 索引)用于搜索,mahout 使用 Solr(Lucene 索引)用于推荐?
3) 由于 Slor 也是一种 NoSQL 解决方案,那么在不使用 MongoDB 的情况下使用 Solr 来实现持久性和搜索功能的缺点是什么?
4) 如果我想使用 Hadoop 或 Apache Sparks 进行分析,这涉及引入另一个数据存储?
这个架构看起来很合理。您可以使用相同的 Solr 集群进行常规搜索和 Recommender 搜索。如果您想将自己的数据输入写入 Spark,您可以实现一种方法来从 MongoDB 实例化 Mahout IndexedDataset。已经有一个伴随对象,用于将 (String, String) 的 PairRDD 作为单个事件的输入并创建 IndexedDataset。这将消除对 HDFS 的需求。
Spark 保存临时文件但不需要 HDFS 进行存储。如果您使用的是 AWS,则可以将 Spark 再训练工作放到 EMR 上,以启动进行训练,然后再拆除。
所以答案是:
是的,看起来很有道理。您应该始终将事件流保存在某个安全的存储空间中。
不需要,只需要MongoDB和Solr,只要能从MongoDB读取到Spark即可。这将在 Recommender 训练代码中使用 Mahout 的 SimilarityAnalysis.cooccurrence
的 Spark 代码完成
没有已知的缺点,不确定性能或 devops 权衡。
您必须使用 Mahout 的 SimilarityAnalysis.cooccurrence Spark,因为它实现了新的 "Correlated Cross-occurrence" (CCO) 算法,这将大大提高您使用不同形式的用户数据的能力反过来会提高推荐的质量。如果您使用 MongoDB 或 Solr.
输入事件,Spark 不需要 HDFS 存储
顺便说一句:ActionML helps with the Data Science part of this, we can help you determine which user information is most predictive. We created the first open source implementation of CCO. We have seen very large increases in quality of recommendation by including the right CCO data (much greater than the Netflix prize 10%). We also support the PredictionIO implementation of the above architecture. We wrote the Universal Recommender based on Mahout (I'm a Mahout committer), but it is much more turnkey than building the system from scratch, however our analysis help is independent of the implementation and might help you on the Data Science part of the project. ActionML.com, Universal Recommender here。全部免费OSS。