Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A few questions on web services/backends

 
James Gibbs
Greenhorn
Posts: 29
Android Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
Android Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic