[hibernate-dev] "rebranding" the Hibernate Search "ram" directory

Yoann Rodiere yoann at hibernate.org
Fri May 19 05:10:55 EDT 2017


Sanne, the confusions you pointed out were:

   - Thinking it's more efficient than other providers (it's not)
   - Thinking it's integrated to replicated in-memory datastores such as
   Infinispan (it's not)

So you'd want a name that says "it's not persistent" and probably "it's
easy to set up" while not hinting in any way at efficiency or Infinispan
integration.

Some attempts (none of which is perfect, but what is? :) ):

   - naive
   - mock
   - basic
   - jvm-heap
   - java-map (RAMDirectory does use a map to store its "RAMFiles")

The last one may be close to what we're looking for: it clearly says it's
in local RAM, and doesn't hint at Infinispan integration. Some could still
think it's a high-performance implementation, but at some point it's just
interpretation: one could just as well think "if it's so simple that it
just uses a java.util.Map, it must not be very advanced, and thus not very
efficient".


Yoann Rodière
Hibernate NoORM Team
yoann at hibernate.org

On 19 May 2017 at 09:34, Gustavo Fernandes <gustavo at infinispan.org> wrote:

> -1 to demote it to "testing"
>
> Let me show the other side of the coin :)
>
> RAMDirectory has its uses, as long as one understands its limitations. It
> is convenient for small non-persistent indexes, and last time I measured,
> it was faster to load than the FS directory.
>
> So it could be used in production (and I believe some people do), and
> renaming it to "testing" would feel a bit awkward. One example of
> production use of the RAMDirectory is the ES Percolator [1]
>
> We can always throw config errors or log WARN if someone is using "ram"
> with clustered caches on Infinispan, but if rebranding is really needed,
> I'd vote for something like "local-ram" or "local-heap".
>
> Thanks,
> Gustavo
>
> [1]
> https://github.com/elastic/elasticsearch/blob/master/
> modules/percolator/src/main/java/org/elasticsearch/percolator/
> PercolateQueryBuilder.java
>
>
>
> On Thu, May 18, 2017 at 9:32 PM, Sanne Grinovero <sanne at hibernate.org>
> wrote:
>
> > -1 for "ephemeral" and "volatile", they are pretty much synonyms of
> > "ram" with all the same possible confusions, even to the point of
> > looking like being the recommended choice for "ephemeral class"
> > machines on openstack.
> >
> > "unreliable": it's not unrelaiable as it's actually very reliable and
> > to be recommended for testing, e.g. if you have an issue with our
> > other directories I'd love to know if you can reproduce it with this
> > one.
> >
> > I'll go with "testing". I want to be able to recommend it for testing,
> > and make it clear it's only meant for that.
> >
> >
> > On 18 May 2017 at 20:22, Gunnar Morling <gunnar.morling at googlemail.com>
> > wrote:
> > > I'd argue you can keep the name, if it's in the test JAR. If people
> > > still use it in their production code, well...
> > >
> > > Otherwise, how about "ephemeral"?
> > >
> > > 2017-05-18 19:05 GMT+02:00 Sanne Grinovero <sanne at hibernate.org>:
> > >> On 18 May 2017 at 17:31, Gunnar Morling <
> gunnar.morling at googlemail.com>
> > wrote:
> > >>> Can't you just move it to the test JAR if it's for testing only?
> > >>
> > >> Interesting idea, we can try that as well.
> > >>
> > >> I'd still want to set the name straight though. Let's agree on a name
> > first.
> > >>
> > >>>
> > >>> Am 18.05.2017 6:29 nachm. schrieb "Sanne Grinovero" <
> > sanne at hibernate.org>:
> > >>>
> > >>> Right technically it's not a unit test. But I'd like to focus on the
> > >>> testing aspect, as "local-ram" might still convey concepts as "fast",
> > >>> maybe even expect it to engage Infinispan's off-heap capabilities, or
> > >>> just being an option to consider for other reasons.
> > >>>
> > >>> "testing" ?
> > >>>
> > >>> On 18 May 2017 at 17:20, Adrian Nistor <anistor at redhat.com> wrote:
> > >>>> I agree, but probably "unit-testing" is not such a good name either.
> > >>>> Technically, that's a functional test.
> > >>>> I think I like "local-ram" better, implying that it is not
> > >>>> shared/distributed and it is also volatile.
> > >>>>
> > >>>>
> > >>>> On 05/18/2017 06:07 PM, Sanne Grinovero wrote:
> > >>>>>
> > >>>>> As anyone who's bothered to read the manual knows, the "ram"
> > directory
> > >>>>> should really only be used for unit tests. The other
> implementations,
> > >>>>> while typically disk based, are also faster (memory mapped files)
> and
> > >>>>> more efficient (better locking design) so there's really no reason
> to
> > >>>>> use it, not even performance except for trivial, small, non
> important
> > >>>>> data sets.
> > >>>>>
> > >>>>> For example the Elasticsearch team is making sure of this by having
> > >>>>> totally removed the option of using the RAMDirectory - something I
> > >>>>> actually don't appreciate as our unit tests could benefit from it,
> > >>>>> having slow storage on our test environments.
> > >>>>>
> > >>>>> Tristan is reporting that the "ram" terminology is confusing
> people,
> > >>>>> not least in the Infinispan community as "RAM" might be ambiguous
> > >>>>> since everything is in memory, and people get surprised it's not
> > >>>>> replicated in the "in memory cluster".
> > >>>>>
> > >>>>> I wouldn't want to go to the extremes of the Elasticsearch team as
> I
> > >>>>> believe having this option is very useful, especially for testing.
> > >>>>>
> > >>>>> Should we rename (rebrand) its short name "ram" into
> "unit-testing" ?
> > >>>>>
> > >>>>> I suspect that would make people think a bit more before pushing it
> > >>>>> into production...
> > >>>>>
> > >>>>>
> > >>>>> Thanks,
> > >>>>> Sanne
> > >>>>
> > >>>>
> > >>>>
> > >>> _______________________________________________
> > >>> hibernate-dev mailing list
> > >>> hibernate-dev at lists.jboss.org
> > >>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
> > >>>
> > >>>
> > _______________________________________________
> > hibernate-dev mailing list
> > hibernate-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
> >
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>


More information about the hibernate-dev mailing list