Persistence with Mapper/Record and H2/Postgresql

106 views
Skip to first unread message

Jones

unread,
Oct 12, 2012, 7:07:04 AM10/12/12
to lif...@googlegroups.com
Hello, 

I am reading documentation about Mapper/Record for a few days now, and it is quite difficult to know what information is obsolete or not. Then, I am just asking some TRUE/FALSE questions here. Feel free to give more details if you have time:

Is it TRUE or FALSE that:

- Record is less stable and complete than Mapper and is not meant to replace Mapper in a close future. Therefore, Mapper should be use when an ORM is needed/adapted.

- H2 database is nice for development, but Postgresql should be preferred for production.

Cheers, 
Jones

David Pollak

unread,
Oct 12, 2012, 9:22:29 AM10/12/12
to lif...@googlegroups.com
On Fri, Oct 12, 2012 at 4:07 AM, Jones <mistic....@gmail.com> wrote:
Hello, 

I am reading documentation about Mapper/Record for a few days now, and it is quite difficult to know what information is obsolete or not. Then, I am just asking some TRUE/FALSE questions here. Feel free to give more details if you have time:

Is it TRUE or FALSE that:

- Record is less stable and complete than Mapper and is not meant to replace Mapper in a close future. Therefore, Mapper should be use when an ORM is needed/adapted.

There are a lot of statements here. Mapper & Schemifier work very well. Record with Squeryl work very well. Use whichever one you like better.
 

- H2 database is nice for development, but Postgresql should be preferred for production.


true.
 
Cheers, 
Jones

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
 
 



--
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net


Diego Medina

unread,
Oct 12, 2012, 9:42:09 AM10/12/12
to lif...@googlegroups.com
On Fri, Oct 12, 2012 at 7:07 AM, Jones <mistic....@gmail.com> wrote:
> Hello,
>
> I am reading documentation about Mapper/Record for a few days now, and it is
> quite difficult to know what information is obsolete or not. Then, I am just
> asking some TRUE/FALSE questions here. Feel free to give more details if you
> have time:
>
> Is it TRUE or FALSE that:
>
> - Record is less stable and complete than Mapper and is not meant to replace
> Mapper in a close future.


I remember reading that Record was suposed to replace Mapper (back
about 3 years ago when I started with Lift), then I found out that
this isn;t the case, do you remember where you read that? SO we can
try to update that page/document/etc ?

Thanks

Diego


Therefore, Mapper should be use when an ORM is
> needed/adapted.
>
> - H2 database is nice for development, but Postgresql should be preferred
> for production.
>
> Cheers,
> Jones
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>
>



--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://www.fmpwizard.com

Jones

unread,
Oct 12, 2012, 11:54:29 AM10/12/12
to lif...@googlegroups.com
In a post on a forum I don't remember, but it was from 2010 or even older. That is why I asked here, because I also found a post from David saying it was wrong but that Record was less stable. And all of this was more than 2 years ago =). 

Moreover, it is not that clear on the assembla wiki. I never now if it is up to date or not, and there is nothing about Mapper vs Record, which makes it more difficult to know what to do as a new lift user. Maybe when I will be more comfortable I will contribute to the wiki.

Thanks for the answers, 
Jones

David Pollak

unread,
Oct 12, 2012, 11:58:49 AM10/12/12
to lif...@googlegroups.com
Put it this way, I use Mapper, so it will work for some use cases (at least mine).

DaveW uses Record/Squeryl, so it will work for some use cases (at least his).

You've got 2 long term committers using code successfully. There's no wrong choice and the right choice is up to you.
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net

Tobias Pfeiffer

unread,
Oct 12, 2012, 1:14:33 PM10/12/12
to lif...@googlegroups.com
Hi,

Am Freitag, 12. Oktober 2012, 15:22 schrieb David Pollak:
> > - H2 database is nice for development, but Postgresql should be
> > preferred for production.
>
> true.

In fact, I would recommend also using PostgreSQL during development.
I used H2 in development as well and then got weird
NullPointerExceptions in production (without meaningful stack traces or
anything) because apparently PostgreSQL knows about NULL while H2
doesn't, cf.
https://groups.google.com/forum/?fromgroups=#!topic/liftweb/AwBbMyaD0rE

Kind regards
Tobias
signature.asc

Diego Medina

unread,
Oct 16, 2012, 10:26:47 PM10/16/12
to lif...@googlegroups.com
Thanks for the link, I'll try to contact the author and see if he can
update that one section

Diego

On Fri, Oct 12, 2012 at 8:17 PM, theGhost <thegh...@gmail.com> wrote:
> Hi
>
> If I Google Lift mapper vs record the third returned gives me this...
>
> Subsection 8.1.8 - Exploring Lift
>
> exploring.liftweb.net/master/index-8.html
> Mapper is the original Lift persistence framework, and it is closely tied to
> JDBC for its storage. Record is a new refactorization of Mapper that is
> backing-store ...
>
> From the responses in this thread (and the response David gave when I asked
> exactly the same question at his Octoly presentation) it seems clear that
> the choice between the two is largely a matter of well ... personal choice.
> If you didn't dig any deeper than the above Google search, however, you
> would definitely form the impression that Record was the new Mapper and
> probably extrapolate that Mapper was going to be deprecated some time in the
> future. So I guess Diego that might be one of the out of date references you
> are looking for.
>
> Perhaps if someone (other than a newbie like myself) was to add a definitive
> Mapper or Record wiki page to the Lift wiki it might help clear up what I
> assume is a recurring question. Even if the page just outlined the
> differences between the two and reassured the reader that "There's no wrong
> choice and the right choice is up to you".
>
> Thanks
> John

Christoph Knabe

unread,
Oct 18, 2012, 3:14:21 AM10/18/12
to lif...@googlegroups.com


Am Freitag, 12. Oktober 2012 13:07:13 UTC+2 schrieb Freelancer:
- H2 database is nice for development, but Postgresql should be preferred for production.

I have migrated my application "teacher news" with about 1000 subscribers and 100 transactions per day from PostgreSQL to Apache Derby (Java DB), as there is much less administration to be done with Derby.
Derby has the advantages:
  • Configurable as in-memory database for tests
  • Configurable as filesystem database for production
  • Pure Java: You can start the DBMS in a test driver and run it in the Derby Servlet in the web server serving your application.
So Derby under Lift/Scala/Mapper/ works well for our live department application since 2 years, but I can't say anything about high volume performance.

Mapper works OK. The only deficit I find is difficult mapping of polymorphic associations.

Diego Medina

unread,
Oct 18, 2012, 2:32:18 PM10/18/12
to lif...@googlegroups.com
On Fri, Oct 12, 2012 at 8:17 PM, theGhost <thegh...@gmail.com> wrote:
> Hi
>
> If I Google Lift mapper vs record the third returned gives me this...
>
> Subsection 8.1.8 - Exploring Lift
>
> exploring.liftweb.net/master/index-8.html


I contacted the authors and the page is now updated, so it does not
say that Record is supposed to replace mapper (Thanks to Tyler and
Derek! )

Diego


> Mapper is the original Lift persistence framework, and it is closely tied to
> JDBC for its storage. Record is a new refactorization of Mapper that is
> backing-store ...
>
> From the responses in this thread (and the response David gave when I asked
> exactly the same question at his Octoly presentation) it seems clear that
> the choice between the two is largely a matter of well ... personal choice.
> If you didn't dig any deeper than the above Google search, however, you
> would definitely form the impression that Record was the new Mapper and
> probably extrapolate that Mapper was going to be deprecated some time in the
> future. So I guess Diego that might be one of the out of date references you
> are looking for.
>
> Perhaps if someone (other than a newbie like myself) was to add a definitive
> Mapper or Record wiki page to the Lift wiki it might help clear up what I
> assume is a recurring question. Even if the page just outlined the
> differences between the two and reassured the reader that "There's no wrong
> choice and the right choice is up to you".
>
> Thanks
> John
>
>
> On Saturday, October 13, 2012 12:42:14 AM UTC+11, fmpwizard wrote:
>>

theGhost

unread,
Oct 19, 2012, 8:38:38 PM10/19/12
to lif...@googlegroups.com
great work Thanks!
Reply all
Reply to author
Forward
0 new messages