wood burning stoves 2.0*
The moose likes Web Services and the fly likes A few questions on web services/backends Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "A few questions on web services/backends" Watch "A few questions on web services/backends" New topic
Author

A few questions on web services/backends

James Gibbs
Greenhorn

Joined: Feb 21, 2013
Posts: 29

I'm trying to build my first web app and currently struggling to find the right path to take.

I'm building a simple Android app which will read POJO's from my web app. There won't be any write access by the android app.

I'll need to build a web app which will have a admin front end for me to do simple CRUD operations on the objects, using a REST setup.

So far i've figured out I can use the Play framework (so I can stick with Java) and JSON (for reduced mobile bandwidth) as a transport method.

Now this is where im getting a little stuck. Firstly I decided I wanted to keep it simple and just serialise the JSON objects to text files. However realize this probably wont scale well, so will probably need to go down the DB route.

Because I'm using JSON would MongoDB be a good choice? Do I need to use a ORM to map between JSON/POJOs/MongoDB?

Update: I've edited this question, was considering using reactivemongo module for play to do away with POJO's/ORM but realised it uses Scala, haven't got the bandwidth to learn Scala aswell!
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Now this is where im getting a little stuck. Firstly I decided I wanted to keep it simple and just serialise the JSON objects to text files. However realize this probably wont scale well, so will probably need to go down the DB route.


Well thats not a record for jumping to conclusions but it is a pretty good effort.

Transmitting your JSON as text has the great advantage of being human readable for debugging.

Given all the things that can go wrong in a client - web server environment, starting with something simple that can be tested in parts is a really great way to avoid frustration.

What exactly is a "DB route" for transmitting data?

Bill
James Gibbs
Greenhorn

Joined: Feb 21, 2013
Posts: 29

Sorry I meant storing my JSON objects in a DB instead of to file.

Since my first post I've found an lightweight mobile specific implementation of CouchDB for Android called TouchDB which enables replication of a remote CouchDB. I'm guessing this should do away with mappings between JSON objects and my own POJOs?

TouchDB isn't ver 1.0 yet so could potentially blow up in the my face, but it sounds like a nice rapid solution with the possibility of scaling it up if I need to?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
I'm not familiar with any of the toolkits you mention so I'm not about to guess.

Let us know how it turns out.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A few questions on web services/backends