http://wiki.neo4j.org/content/Ruby-script_extension


Am 02.12.2011 um 10:32 schrieb Dmytrii Nagirniak:

> 
>> That's why we've enable the
>> - ruby-extensions for the server.
> 
> Haven't seen anything about it. Could you please give some more info on that 
> (links maybe)?
> 
>> it is not about duplicating functionality but about moving persistence 
>> related code closer to the db.
> 
> It is a long topic on itself: Where the business logic belongs to - the 
> server or the client.
> 
> But the point is that far the most common use-case is to write the business 
> logic on the client, not on the server.
> 
> The business logic on the server has already failed multiple times in the 
> history (think of stored procedures on the RDBMS).
> 
> Server side logic works well when the DB is part of the app (e.g. embedded) 
> and server/client code is often indistinguishable.
> 

OTOH
it is about keeping the database primitives at the database level and exposing 
domain level data and operations.
(which makes your protocol smaller, faster, less diluted, better understandable 
and focused).

After all with NOSQL you have much more often that you move code to the data 
(think map-reduce -> no one complains there). 

> 
> 
> 
>> 
>> Am 02.12.2011 um 09:43 schrieb Dmytrii Nagirniak:
>> 
>>> Good point. Yes, that certainly is an alternative.
>>> 
>>> But unfortunately in practice I hardly can imagine .NET, Nodejs, MRI Ruby
>>> (non Java basically) guys to start duplicating the logic for the plugin.
>>> Not even taking into account additional complexity, including unit testing.
>>> 
>>> Similar thing ships with SQL Server. But it was used only by .NET people
>>> and extremely rarely.
>>> On Dec 2, 2011 6:57 PM, "Michael Hunger" <michael.hun...@neotechnology.com>
>>> wrote:
>>> 
>>>> No, the alternative there is to provide a server-side extension that
>>>> encapsulates your business logic as an endpoint running inside of a tx.
>>>> 
>>>> Cheers
>>>> 
>>>> Michael
>>>> 
>>>> Am 02.12.2011 um 08:30 schrieb Dmytrii Nagirniak:
>>>> 
>>>>> 
>>>>> On 02/12/2011, at 4:48 PM, Jim Webber wrote:
>>>>> 
>>>>>> 1. Neo4j works as a standalone (or clustered) server which is
>>>> accessible through the REST API.
>>>>> 
>>>>> That's the point. There is not standalone version with native bindings.
>>>>> You either run embedded and lock the whole database to the particular
>>>> app, or you go with REST that doesn't support transactions (batch !=
>>>> transaction)...
>>>>> 
>>>>>> 2. Neo4j is ACID transactional with each HTTP request to the server
>>>> being internally scoped in a single transaction.
>>>>> Unfortunately it is not always enough, even when using batch API.
>>>>> 
>>>>> Here is the use-case:
>>>>> 1. Query for a nodes/rels.
>>>>> 2. Run some custom logic on the client.
>>>>> 3. Update nodes/rels appropriately.
>>>>> 
>>>>> This is the most common way of using databases. And currently it is not
>>>> possible to wrap it in a transaction.
>>>>> 
>>>>> So the only alternative in this case is to use native binding, which may
>>>> not be available to all. And means we are back at point 1.
>>>>> 
>>>>> Do you see what I mean here?
>>>>> It's a trade-off: ACID vs DB with multiple clients.
>>>>> 
>>>>> 
>>>>> A way of doing transactions over REST would be nice. But it will be
>>>> extremely hard to implement due to the stateless nature of HTTP.
>>>>> I can see something like this in API:
>>>>> 
>>>>> POST /transaction?timeout=2
>>>>> # Returns the ID of the transaction for the future
>>>>> 
>>>>> # then use the normal API...
>>>>> 
>>>>> 
>>>>> PUT /transactions/1234/commit
>>>>> # or
>>>>> PUT /transactions/1234/rollback
>>>>> # or
>>>>> DESTROY /transactions/1234
>>>>> # or automatically rollback after 2 secs
>>>>> 
>>>>> 
>>>>> But I am not sure this can work reliably and performant enough with HTTP.
>>>>> 
>>>>> Cheers.
>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Neo4j mailing list
>>>>> User@lists.neo4j.org
>>>>> https://lists.neo4j.org/mailman/listinfo/user
>>>> 
>>>> _______________________________________________
>>>> Neo4j mailing list
>>>> User@lists.neo4j.org
>>>> https://lists.neo4j.org/mailman/listinfo/user
>>>> 
>>> _______________________________________________
>>> Neo4j mailing list
>>> User@lists.neo4j.org
>>> https://lists.neo4j.org/mailman/listinfo/user
>> 
>> _______________________________________________
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
> 
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to