Is there a good alternative to Play that I can use

2019-05-10 08:50发布

问题:

I am designing an image store application for end users which will have lots of CRUD type functionality. I want to host the application on Amazon Web Services (AWS) and was going to use the play! framework, S3 and a NoSQL database. I couldn't find a DynamoDB adapter for Play! and read that MongoDB and EC2 don't get along that well together.

Is there a good alternative to Play that I can use with DynamoDB?

Are there alternative frameworks I should consider (Play! looks very attractive to me, clean, lean and simple).

回答1:

Play is database agnostic but it does have some support for other less recent data stores. Dynamo is just too new to have much support directly in a web framework. Play is a fine framework and I personally really like it. While I use Play 2.0, I don't recommend it for someone completely unfamiliar with scala or FP. They say you don't need to know either but that is wishful thinking until the product is more mature.

The bottom line is you choose your web framework and data store separately. The right one of each should have the flexibility to support many options of the other.



回答2:

Came across this : https://github.com/wfaler/scala-dynamo Looks like a first attempt at a scala driver for dynamo.



回答3:

Check jcabi-dynamo. It is an object layer on top of DynamoDB SDK, for example:

Credentials credentials = new Credentials.Simple("AWS key", "AWS secret");
Region region = new Region.Simple(credentials);
Table table = region.table("foo");
Collection<Item> items = table.frame().where("id", Conditions.equalTo(123));
for (Item item : items) {
  System.out.println(item.get("name").getS());
}