ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Tupitsyn <ptupit...@apache.org>
Subject Re: Anaemic Domain Model
Date Wed, 30 Aug 2017 09:01:30 GMT
ScanQuery is limited to a single cache, does not use indexes (always full
scan), and requires full object deserialization.
So SQL is usually faster.

Instead of having a separate object model for Ignite, I would recommend
implementing IBinarizable or IBinarySerializer
for your complex and nested objects, and writing them out as a flat
structure, so that SQL works and the model is reused.

I can give detailed advice if you send an example of your model and a query
that you want to run.

On Wed, Aug 30, 2017 at 11:46 AM, Narayana Rengaswamy <
narayana.rengaswamy@optym.com> wrote:

> Oh ok. So Scan query’s only limitations are JOIN with another cache
> entity, and aggregation? I believe we have not tried scan query because of
> this, and have used SQL queries exclusively.
>
>
>
> Thanks,
>
> Narayana.
>
>
>
> *From:* Pavel Tupitsyn [mailto:ptupitsyn@apache.org]
> *Sent:* Wednesday, August 30, 2017 2:07 PM
>
> *To:* user@ignite.apache.org
> *Subject:* Re: Anaemic Domain Model
>
>
>
> With Scan Query there are no restrictions, you can filter on any level of
> nesting, with computed properties, etc etc.
>
> It is just a piece of your code operating on your object, so you can do
> anything.
>
>
>
> SQL is more limited, but it also allows nested fields in some cases.
>
>
>
> Let me know if you need help with some particular query.
>
>
>
> Pavel
>
>
>
> On Wed, Aug 30, 2017 at 10:45 AM, Narayana Rengaswamy <
> narayana.rengaswamy@optym.com> wrote:
>
> Hi Pavel,
>
>
>
> Our main issue is filtering data by applying a predicate. As I understand,
> I cannot filter on a nested class using either SQL Query, or Scan Query.
>
>
>
> Thanks,
>
> Narayana.
>
>
>
> *Narayana Rengaswamy*
>
> Optym – Live Efficiently
>
> M: +91-875-450-9770
>
>
>
> *From:* Pavel Tupitsyn [mailto:ptupitsyn@apache.org]
> *Sent:* Tuesday, August 29, 2017 8:08 PM
> *To:* user@ignite.apache.org
> *Subject:* Re: Anaemic Domain Model
>
>
>
> Hi Narayana,
>
>
>
> Can you describe the difficulties that you have with storing rich model
> classes in Ignite?
>
>
>
> Anaemic domain model is controversial, opinions range from "good practice"
> to "anti-pattern".
>
> Ignite does not force you into any specific approach, IBinarizable and
> IBinarySerializer interfaces
>
> provide flexibility when reflective serializer does no cope well.
>
>
>
> Pavel
>
>
>
> On Tue, Aug 29, 2017 at 5:16 PM, Narayana Rengaswamy <
> narayana.rengaswamy@optym.com> wrote:
>
> Hi all,
>
>
>
> I am using Apache Ignite (.NET) in a web application. My domain model
> classes are directly stored in Ignite cache, and I have persistence in SQL
> Server. I have DTOs to SQL Server, but none to Ignite. I can see that I am
> following an anaemic domain model due to several restrictions. I find it
> difficult to model classes that can be stored in Ignite cache, and at the
> same time, be rich domain classes (with complex data structures,
> aggregations etc). Should I be creating a DTO class for Ignite also, and do
> a transformation to / from the domain model? Is that how it is done
> typically with Ignite?
>
>
>
> Thanks,
>
> Narayana.
>
>
>
>
>

Mime
View raw message