Pocketchangeapp backed by MongoDB

18 views
Skip to first unread message

Alexander Azarov

unread,
Feb 17, 2010, 1:38:45 PM2/17/10
to mongo-scala-driver
I decided to migrate Pocketchangeapp demo application from "Lift book"
to MongoDB -- I think it makes much more sense to compare persistance
techniques using the same app.

I saw two alternatives:
- Use pure scala objects (POSOs) for domain objects. Thus it would be
necessary to provide some equivivalents to the Mapper's methods like
toForm, etc. and the whole ProtoUser stuff
- Create a Mapper replacement on top of mongo-scala-driver

No doubts the second way gives much more in terms of a reusable
library and in the best case this would make it possible to easily
migrate existing Mapper models to MongoDB backend. But my personal
goals were much closer to the first alternative, so it was done this
way.

What we have:
- The Pocketchangeapp port is backed by MongoDB.
- Domain objects are more or less clean from persistance stuff, they
look like ordinary Scala classes
- All the functionality has been retained
- I did my best to make the port straightforward and keeping code
similar -- it will be easier to compare both branches
- File upload is done using GridFS, MongoDB's API for storing large
binary objects
- BigDecimal support is done using custom data type to mongo-scala-
driver (it's not supported by MongoDB out of the box)

Links:
* http://www.theliftbook.com/ Pocketchangeapp -- Lift book demo app
* http://github.com/alaz/pocketchangeapp Pocketchangeapp backed by
mongo-scala-driver and MongoDB

Alexander Azarov

unread,
Feb 19, 2010, 2:43:14 AM2/19/10
to mongo-scala-driver
Few latest changes:

- BigDecimal field now has a parameter "scale" to match the original
MappedDecimal
- receipt image is returned using streaming response from GridFS: no
need to buffer the image and allows to stream large files (probably
not a case for receipts)

> *http://www.theliftbook.com/ Pocketchangeapp -- Lift book demo app
> *http://github.com/alaz/pocketchangeappPocketchangeapp backed by
> mongo-scala-driver and MongoDB

Reply all
Reply to author
Forward
0 new messages