Message from discussion
Javascript EventStore using LocalStorage?
Received: by 10.52.16.113 with SMTP id f17mr355664vdd.3.1352890615093;
Wed, 14 Nov 2012 02:56:55 -0800 (PST)
X-BeenThere: dddcqrs@googlegroups.com
Received: by 10.52.26.41 with SMTP id i9ls291416vdg.2.gmail; Wed, 14 Nov 2012
02:56:51 -0800 (PST)
Received: by 10.58.210.198 with SMTP id mw6mr8745771vec.22.1352890611296;
Wed, 14 Nov 2012 02:56:51 -0800 (PST)
Received: by 10.58.210.198 with SMTP id mw6mr8745770vec.22.1352890611277;
Wed, 14 Nov 2012 02:56:51 -0800 (PST)
Return-Path: <gregoryyou...@gmail.com>
Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49])
by gmr-mx.google.com with ESMTPS id bn19si3969744vdb.0.2012.11.14.02.56.51
(version=TLSv1/SSLv3 cipher=OTHER);
Wed, 14 Nov 2012 02:56:51 -0800 (PST)
Received-SPF: pass (google.com: domain of gregoryyou...@gmail.com designates 209.85.212.49 as permitted sender) client-ip=209.85.212.49;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of gregoryyou...@gmail.com designates 209.85.212.49 as permitted sender) smtp.mail=gregoryyou...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-vb0-f49.google.com with SMTP id fo1so332293vbb.8
for <dddcqrs@googlegroups.com>; Wed, 14 Nov 2012 02:56:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type;
bh=dNwDdaZAIvmeLkdCPBaoo2DOgn3X0w7oULHbPW38gsc=;
b=NcWKifMGLWcdG5NZyA37C8/MBkrpdRTGTKV0yz2t2EEwNdXVMqj3BA3tNeCXKdhO/f
Eif2dtbEdhSKhvvxbzOK9oFaGw9a9tUWcMVfd9sLz/9tOq5RBJhNs7kagkeRrqt15QRm
fBTz7Uw9Iz/5gfcikZdfkxwQKkvp2SuRVPPbBGibOeyqznyNknntk4hSfNFQ2y86tSKG
ztHITFkgq3OE9hmZ0aiAfveSRIlzz31WTz36c+151jbhOo/Q3MKWymSYIX9EK/apL3qr
q4FqNnpqSUrQ3UoWrw4ShUn5zyJOBv2T0ZNh6I4spIGL3BlGMWJ5zB49ax5oHwEVXaQ9
tujg==
MIME-Version: 1.0
Received: by 10.220.40.16 with SMTP id i16mr10551344vce.31.1352890611127; Wed,
14 Nov 2012 02:56:51 -0800 (PST)
Received: by 10.58.151.242 with HTTP; Wed, 14 Nov 2012 02:56:51 -0800 (PST)
Received: by 10.58.151.242 with HTTP; Wed, 14 Nov 2012 02:56:51 -0800 (PST)
In-Reply-To: <CA+SNLN3inFfZbrUNbRY7X_iSg8tK5BkzV0wYOz54TW+XdDC...@mail.gmail.com>
References: <90d07ca8-4bb5-49be-8989-367edb50aa5a@googlegroups.com>
<CAC9RQtgfgNdi=eM6PHPbKJyNsx8hJqrcEDZEc+vKs0AhGr6...@mail.gmail.com>
<005201cdc1e5$9cf95570$d6ec00...@chambills.com>
<CA+SNLN3inFfZbrUNbRY7X_iSg8tK5BkzV0wYOz54TW+XdDC...@mail.gmail.com>
Date: Wed, 14 Nov 2012 12:56:51 +0200
Message-ID: <CAC9RQthxr2kuZy9kd527rba4xK4FVfuzhzN8gWTOWfU4SyG...@mail.gmail.com>
Subject: Re: [DDD/CQRS] Javascript EventStore using LocalStorage?
From: Greg Young <gregoryyou...@gmail.com>
To: dddcqrs@googlegroups.com
Content-Type: multipart/alternative; boundary=bcaec54a37fa4bd5e804ce726451
--bcaec54a37fa4bd5e804ce726451
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Thanks for sharing that! The main point of an indexdb store imho is in
occasionally connected scenarios eg: wAiting to sync.
On Nov 14, 2012 11:59 AM, "Jonathan George" <j...@jonathangeorge.co.uk>
wrote:
> I'm doing exactly the same thing at the moment and am storing my events i=
n
> the HTML5 IndexedDB (obviously this restricts the browsers that can be
> used, but I'm ok with that at the moment.) My starting point was a
> Javascript port of Greg's "simplest possible thing" sample - I understand
> that this is not exactly a full blown event store, but I have a fairly
> tight deadline for my first phase which is primarily a proof of concept -
> assuming all goes well I will be revisiting the infrastructure bits in a
> month or so.
>
> My first pass at porting Greg's C# to JS can be found here -
> https://bitbucket.org/jon_george1/javascriptmvc-cqrs. It's a bit heavier
> than it might have been because I'm using the JavascriptMVC framework (
> http://javascriptmvc.com/) and it comes with a number of health warnings
> - the biggest being that because interactions with IndexedDB are async yo=
u
> can run into some major concurrency issues with the code as-is. In the
> codebase for the app I'm working on, I ended up using a plugin (
> http://www.bennadel.com/blog/2326-jQuery-whenSync-Plugin-For-Chaining-Asy=
nchronous-Callbacks-Using-Deferred-Objects.htm)
> to force things into a more synchronous model. There may well be a better
> way of doing this.
>
> Obviously I can't share my client's codebase with you, but I can pull out
> bits of the code to share if it would be useful for you and I'm more than
> happy to get into more detail on this - it would be good to have someone
> else attempting the same thing as me to bounce ideas off :-)
>
> Cheers
> Jon
>
> On 13 November 2012 21:26, Adam Mills <a...@chambills.com> wrote:
>
>> Thanks I'll have a look.
>> Not sure what you mean by "store in JSON"? I want persisted storage acro=
ss
>> browser restarts client side, so had planned to store the events in the
>> browser LocalStorage, as JSON
>>
>> -----Original Message-----
>> From: dddcqrs@googlegroups.com [mailto:dddcqrs@googlegroups.com] On
>> Behalf
>> Of Greg Young
>> Sent: 13 November 2012 17:24
>> To: dddcqrs@googlegroups.com
>> Subject: Re: [DDD/CQRS] Javascript EventStore using LocalStorage?
>>
>> You can grab some of the code from the Event Store sample chat app
>> (github/com/eventstore/eventstore). As a backend it already has js
>> libraries
>> to handle subscriptions to browser (over atompub and you can host
>> projections in the browser if you want).
>>
>> As for the localstorage I would just store in json. I can help you with
>> this
>> if you want as it is something that would be nice to drop into our clien=
t
>> API as well.
>>
>> On Tue, Nov 13, 2012 at 11:20 PM, Adam Mills <a...@chambills.com> wrote:
>> > I am looking at doing an occasionally connected app that is entirely
>> > hosted in browser, backed by an EventStore that uses LocalStorage
>> > (events are also published to a central server, merged and
>> > distributed) Has anyone done anything like this?
>> > Any code that is shareable? Especially a LocalStorage backed EventStor=
e?
>> >
>> > Thanks
>> > Adam
>>
>>
>>
>> --
>> Le doute n'est pas une condition agr=E9able, mais la certitude est absur=
de.
>>
>>
>
--bcaec54a37fa4bd5e804ce726451
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<p>Thanks for sharing that! The main point of an indexdb store imho is in o=
ccasionally connected scenarios eg: wAiting to sync.</p>
<div class=3D"gmail_quote">On Nov 14, 2012 11:59 AM, "Jonathan George&=
quot; <<a href=3D"mailto:j...@jonathangeorge.co.uk">j...@jonathangeorge.co=
.uk</a>> wrote:<br type=3D"attribution"><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm doing exactly the same thing at the moment and am storing my events=
in the HTML5 IndexedDB (obviously this restricts the browsers that can be =
used, but I'm ok with that at the moment.) My starting point was a Java=
script port of Greg's "simplest possible thing" sample - I un=
derstand that this is not exactly a full blown event store, but I have a fa=
irly tight deadline for my first phase which is primarily a proof of concep=
t - assuming all goes well I will be revisiting the infrastructure bits in =
a month or so.<div>
<br></div><div>My first pass at porting Greg's C# to JS can be found he=
re -=A0<a href=3D"https://bitbucket.org/jon_george1/javascriptmvc-cqrs" tar=
get=3D"_blank">https://bitbucket.org/jon_george1/javascriptmvc-cqrs</a>. It=
's a bit heavier than it might have been because I'm using the Java=
scriptMVC framework (<a href=3D"http://javascriptmvc.com/" target=3D"_blank=
">http://javascriptmvc.com/</a>) and it comes with a number of health warni=
ngs - the biggest being that because interactions with IndexedDB are async =
you can run into some major concurrency issues with the code as-is. In the =
codebase for the app I'm working on, I ended up using a plugin (<a href=
=3D"http://www.bennadel.com/blog/2326-jQuery-whenSync-Plugin-For-Chaining-A=
synchronous-Callbacks-Using-Deferred-Objects.htm" target=3D"_blank">http://=
www.bennadel.com/blog/2326-jQuery-whenSync-Plugin-For-Chaining-Asynchronous=
-Callbacks-Using-Deferred-Objects.htm</a>) to force things into a more sync=
hronous model. There may well be a better way of doing this.</div>
<div><br></div><div>Obviously I can't share my client's codebase wi=
th you, but I can pull out bits of the code to share if it would be useful =
for you and I'm more than happy to get into more detail on this - it wo=
uld be good to have someone else attempting the same thing as me to bounce =
ideas off :-)<br>
<br>Cheers</div><div>Jon<br><br><div class=3D"gmail_quote">On 13 November 2=
012 21:26, Adam Mills <span dir=3D"ltr"><<a href=3D"mailto:adam@chambill=
s.com" target=3D"_blank">a...@chambills.com</a>></span> wrote:<br><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
solid;padding-left:1ex">
Thanks I'll have a look.<br>
Not sure what you mean by "store in JSON"? I want persisted stora=
ge across<br>
browser restarts client side, so had planned to store the events in the<br>
browser LocalStorage, as JSON<br>
<div><div><br>
-----Original Message-----<br>
From: <a href=3D"mailto:dddcqrs@googlegroups.com" target=3D"_blank">dddcqrs=
@googlegroups.com</a> [mailto:<a href=3D"mailto:dddcqrs@googlegroups.com" t=
arget=3D"_blank">dddcqrs@googlegroups.com</a>] On Behalf<br>
Of Greg Young<br>
Sent: 13 November 2012 17:24<br>
To: <a href=3D"mailto:dddcqrs@googlegroups.com" target=3D"_blank">dddcqrs@g=
ooglegroups.com</a><br>
Subject: Re: [DDD/CQRS] Javascript EventStore using LocalStorage?<br>
<br>
You can grab some of the code from the Event Store sample chat app<br>
(github/com/eventstore/eventstore). As a backend it already has js librarie=
s<br>
to handle subscriptions to browser (over atompub and you can host<br>
projections in the browser if you want).<br>
<br>
As for the localstorage I would just store in json. I can help you with thi=
s<br>
if you want as it is something that would be nice to drop into our client<b=
r>
API as well.<br>
<br>
On Tue, Nov 13, 2012 at 11:20 PM, Adam Mills <<a href=3D"mailto:adam@cha=
mbills.com" target=3D"_blank">a...@chambills.com</a>> wrote:<br>
> I am looking at doing an occasionally connected app that is entirely<b=
r>
> hosted in browser, backed by an EventStore that uses LocalStorage<br>
> (events are also published to a central server, merged and<br>
> distributed) Has anyone done anything like this?<br>
> Any code that is shareable? Especially a LocalStorage backed EventStor=
e?<br>
><br>
> Thanks<br>
> Adam<br>
<br>
<br>
<br>
--<br>
Le doute n'est pas une condition agr=E9able, mais la certitude est absu=
rde.<br>
<br>
</div></div></blockquote></div><br></div>
</blockquote></div>
--bcaec54a37fa4bd5e804ce726451--