Persistence with Mapper/Record and H2/Postgresql

Showing 1-11 of 11 messages
Persistence with Mapper/Record and H2/Postgresql Freelancer 10/12/12 4:07 AM
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
Re: [Lift] Persistence with Mapper/Record and H2/Postgresql David Pollak 10/12/12 6:22 AM


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


Re: [Lift] Persistence with Mapper/Record and H2/Postgresql fmpwizard 10/12/12 6:42 AM
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
Re: [Lift] Persistence with Mapper/Record and H2/Postgresql Freelancer 10/12/12 8:54 AM
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
Re: [Lift] Persistence with Mapper/Record and H2/Postgresql David Pollak 10/12/12 8:58 AM
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


Re: [Lift] Persistence with Mapper/Record and H2/Postgresql Tobias Pfeiffer 10/12/12 10:14 AM
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
Re: [Lift] Persistence with Mapper/Record and H2/Postgresql theGhost 10/12/12 5:17 PM

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
Re: [Lift] Persistence with Mapper/Record and H2/Postgresql fmpwizard 10/16/12 7:26 PM
Thanks for the link, I'll try to contact the author and see if he can
update that one section

  Diego
Re: Persistence with Mapper/Record and H2/Postgresql Christoph Knabe 10/18/12 12:14 AM


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.
Re: [Lift] Persistence with Mapper/Record and H2/Postgresql fmpwizard 10/18/12 11:32 AM
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
Re: [Lift] Persistence with Mapper/Record and H2/Postgresql theGhost 10/19/12 5:38 PM
great work Thanks!