0

Mongo with Play-Framework is new for me. I have Spring-Framework background, In which we create Controller, Business and DAO layer structure applications. Now, i want to taste the flavor of Play-Framework with ReactiveMongo. For create our sample Application, my first target is to follow Controller, Business and DAO layer structure. Play-Framework already provide the basic structure of application, which is really good. If we use Mongodb with Play-Framework, I found three types of MongoDB Drivers. These are as below:

  1. Mongo Module (https://www.playframework.com/modules/mongo-1.1/home)
  2. MongoHelper (https://gist.github.com/harmeetsingh0013/fdc9c20b056a62f303f5)
  3. ReactiveMongo(http://reactivemongo.org/)

ReactiveMongo, which is really awesome for implementing non-blocking I/O. In reactive mongo there are some problem with sync the data from multiple queries. I have some queries for creating sample application as below:

  1. My first target is to implement MVC using ReactiveMongo, which i think ReactiveMongo-Extension provide me Dao layer. But i still want to confirm, ReactiveMongo-Extension is a good approach ? or I need to go for MongoHelper? What is the benefit of Mongo-Module over reactive mongo?
  2. For dependency Injection we need to go for Spring-Dependency Injection or Guice or other Scala Dependency Injection Framework ?
  3. If i am go for ReactiveMongo, we need to go for JSONCollection because BSONCollection is MongoDB Dependency. What is the support for JSONCollection available?
Harmeet Singh Taara
  • 6,483
  • 20
  • 73
  • 126
  • BSONCollection is from ReactiveMongo BSON lib. Even if you chose by design to go with JSON data exchange, BSONCollection will be there (in the core of RM). – cchantep Mar 31 '15 at 08:35
  • 1
    Note that ReactiveMongo 0.11 is about to be release, with new ReactiveStreams support (with implementations provided for both Iteratee and AkkaStreams), client side SSL, and other features. – cchantep Apr 01 '15 at 08:45
  • If you are interested in, here is a personal sample using Akka Stream prototype: https://github.com/cchantep/RM-AkkaStreams/blob/master/src/test/scala/CursorSpec.scala – cchantep Apr 01 '15 at 11:16
  • @cchantep the last commit to ReactiveMongo is 15 days ago. Why is the development so slow? I am about to abandon ReactiveMongo-Extensions. – fcs Apr 01 '15 at 18:35
  • @fcs Last commit on PR is just few days old (end of last week). I would know call it slow. I think it can be discussed on the Google Group. – cchantep Apr 01 '15 at 19:07

1 Answers1

1

Current modules repository on playframework.com is just for Play 1.x. So Mongo Module is not an option for you.

I am the author of ReactiveMongo-Extensions and it is highly inspired from MongoHelper. You can use which one you want. If you choose ReactiveMongo-Extensions JsonDao is your friend. There is also an example application which you can check out: https://github.com/mertkavi/play-reactivemongo-extensions-sample

BTW I am currently developing a newer driver from scratch. You may also give it a try: https://github.com/fehmicansaglam/tepkin

fcs
  • 926
  • 1
  • 8
  • 14
  • Thanks @fcs, It means for DAO layer `ReactiveMongo-Extensions` is good option. But the thing is that, `ReactiveMongo-Extensions` is a part of `ReactiveMongo` driver? You are working on new drivers, what is the difference between, `ReactiveMongo` and `Tepkin` ? – Harmeet Singh Taara Apr 01 '15 at 07:45
  • ReactiveMongo and Tepkin share many ideas. But the main difference is while ReactiveMongo uses Iteratees, Tepkin is built on Akka Streams. Akka Streams will be default in the upcoming Play versions. – fcs Apr 01 '15 at 07:52
  • That's good. Thanks for your great support. The main challenge is, what actulay support for `ReactiveMongo-Extensions` or `Tepkin` have. How i actualy conges my seniors to move this technology ? – Harmeet Singh Taara Apr 01 '15 at 07:58
  • hey @fcs if you like, please join our chat room, for discussion, if you allow. http://chat.stackoverflow.com/rooms/73074/scala-play-framework-and-reactive-mongo – Harmeet Singh Taara Apr 01 '15 at 08:02
  • @HarmeetSinghTaara Unfortunately I don't have time to join that room. But I actively participate in Tepkin gitter chat. And there are also other helpful devs there. https://gitter.im/fehmicansaglam/tepkin?utm_source=share-link&utm_medium=link&utm_campaign=share-link – fcs Apr 01 '15 at 08:08
  • Thanks @fcs for you gitter chat room. – Harmeet Singh Taara Apr 01 '15 at 08:25