cassandra与戏剧框架 [英] cassandra with play framework

查看:252
本文介绍了cassandra与戏剧框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图开发一个由两部分组成的应用程序:一个web服务和一个android应用程序。我计划用java play框架和cassandra noSQL数据库实现我的web服务。

I am trying to develop an application composed of 2 parts: a web service and an android app. I am planning to implement my web service with the java play framework and cassandra noSQL database.

我一直在寻找它2天,我还是不知道我可以做到。我需要集成一个java客户端(hector)作为应用程序层(Play2.0)和数据库层之间的桥梁,但如何做到这一点不清楚我。

I have been searching for it for 2 days, I still don't know how I can do it. I need to integrate a java client (hector) as a bridge between the app layer (Play2.0) and the database layer, but how to do it is not clear to me.

现在,我不能连接cassandra从play;我不能让我的应用程序需要我的查询,我不知道我可以使用play2.x像以前的版本(没有scala语言,只是java和groovy模板)。

Right now, I can not connect cassandra from play; I can not make my queries which my app needs and I dont know whether I can use play2.x like previous versions (without scala language, just java and groovy template).

allright,我试图develeop一个web服务,可以水平easable。因为会有很多请求,可能大多数同时在手机上。这就是为什么我选择玩cassenra cassandra(我得到足够的知识,在上个学期拼贴关系数据库的拼贴)。我的web服务将根据客户端的位置信息返回一些数据到客户端。这就是为什么从DB的搜索时间必须尽可能短。实际上我已经设计了我的数据库模型cassandra,因为我已经定义了什么样的查询我的应用程序需要,我有足够的信息关于cassandra数据模型。我认为我为我的应用程序选择的工具是正确的,可以维护它。很简单,我不能使用cassandra和play一样使用MySQL:

allright, I am trying to develeop a web service which can be scalable horizontal easly. Because there will be many request, possible most of them at same time, from mobile phones. That is why I choose play frmwork with cassandra (I got enough knowledge about play with relational DB in collage last semester). my web service will return some data to client according to location info of client. That is why search time from DB must be as short as possible.Actually I have already designed my DB model for cassandra, because I already defined what kind of queries my app needs and I got enough information about cassandra data model. I think the tools i choosed for my app is correct and can maintain it. shortly, I can not use cassandra with play like I used MySQL with play :(

推荐答案

没有什么能阻止你使用Cassandra玩,就像你可以使用它与Jetty或Tomcat或任何其他前端。播放有一些工具可用来抽象使用流行的关系数据库,但这些工具不是Play的核心,因此你不必使用它们你需要创建你的DAL,使用你选择的库(Hector,Astyanax等)与Cassandra对话,然后使用DAL,就像在任何其他应用程序,也许你正在尝试做不同的事情?

There's nothing stopping you from using Cassandra with Play, just as you could use it with Jetty or Tomcat or any other front-end. Play has some tools available to abstract the usage of popular relational DBs, but these tools are not central to Play, and therefore you don't have to use them. You will need to create your DAL to talk to Cassandra using the library of your choice (Hector, Astyanax, etc.), then use that DAL as you would in any other app. Perhaps you are trying to do something different? If so, please be very specific as to what you need to know.

此外,Play2与第一个版本有很大的不同,所以你在老版本中所做的一切播放将需要重新访问,它仍然支持Java,所以这不会是一个问题。

Also, Play2 is quite different from the first version, so anything you've done in the older Play will need to be revisited. It does still support Java, so that won't be an issue.

这篇关于cassandra与戏剧框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆