🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: perl.kiokudb
Article #1

Re: only reading objects

#1
From: Yuval Kogman
Date: Sat, 26 Jan 2013 19:34
57 lines
4806 bytes
--bcaec553ff389ac5fe04d436242e
Content-Type: text/plain; charset=UTF-8

KiokuDB can work for your application. The plain file system storage
backend should work for what you'd like.

We've used this approach before and it has some advantages and
disadvantages, namely it's pretty easy to create a configuration object
system with lots of complexity to help remove the extra work from the core
of the app, and even write a few scripts to update it in an orderly way.
It's also OK-ish to edit the database by hand if it's JSON but it gets to
be a pain to navigate all the separate files. There's KiokuX app whose name
I forget that lets you connect to a DB and edit it with a web interface.
Also keep in mind this is a big chunk of code/functionality for someone new
to learn, so it might not be a time saver in the long run if you need to go
back to something more traditional or if you need to explain what's going
on to someone. If you're using KiokuDB in your app for other reasons I
guess that gets mitigated, but it sounds like it might be a bit overkill
for what you want.

I wouldn't reccomend MooseX::Storage exactly for the reason you cite, also
it's a little bit of an all-or-nothing type thing, if you need to do
something out of its capabilities it can be tough.

At any rate, for KiokuDB to write to disk you have to tell it to do so
explicitly by using ->store or ->update on the fetched objects. The system
will then scan through the working memory copy, and write the new data to
disk.






On 26 January 2013 19:22, Erik Colson <eco@ecocode.net> wrote:

> Hi,
>
> I have a Moose app where I need to load objects from a file @ startup,
> work on the objects _without_ modifying the file on disk. Preferably the
> file should be JSON formatted.
>
> I've been reading the docs of KiokuDB and as far as my objects concern,
> everything should load fine. However I think KiokuDB is made to get a
> transparent persistence of data and therefor changing objects in memory
> can also modify stuff on the disk..
>
> Hence my question: Is KiokuDB a correct choice for my app or should I
> use MooseX::Storage which has the pitfall of recreating lots of objects
> instead of tracing the references...
>
> thanks
> --
> erik
>

--bcaec553ff389ac5fe04d436242e--
Technical Details
Message-ID: <CAAQdECAq53Wo8k1MCsoXXpXcUskrgFCR6FVmcVZnBdrHeHbp2g@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-perl.kiokudb.mbox.gz!border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!nntp.develooper.com!nntp.perl.org
References: <m28v7foo4a.fsf@ecocode.net>

Show Full Headers
Complete Article Headers
Message-ID: <CAAQdECAq53Wo8k1MCsoXXpXcUskrgFCR6FVmcVZnBdrHeHbp2g@mail.gmail.com>
Subject: Re: only reading objects
Date: Sat, 26 Jan 2013 21:34:54 +0200
From: nothingmuch@woobling.org (Yuval Kogman)
References: <m28v7foo4a.fsf@ecocode.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-perl.kiokudb.mbox.gz!border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!nntp.develooper.com!nntp.perl.org
Newsgroups: perl.kiokudb
Return-Path: <nothingmuch@woobling.org>
Mailing-List: contact kiokudb-help@perl.org; run by ezmlm
Delivered-To: mailing list kiokudb@perl.org
Received: (qmail 7913 invoked from network); 26 Jan 2013 19:35:23 -0000
Received: from x1.develooper.com (207.171.7.70)
Received: (qmail 12998 invoked by uid 225); 26 Jan 2013 19:35:23 -0000
Delivered-To: kiokudb@perl.org
Received: (qmail 12993 invoked by alias); 26 Jan 2013 19:35:23 -0000
X-Spam-Status: No, hits=-2.7 required=8.0
 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HTML_MESSAGE,
 RCVD_IN_DNSWL_LOW
X-Spam-Check-By: la.mx.develooper.com
Received: from mail-lb0-f170.google.com (HELO mail-lb0-f170.google.com)
 (209.85.217.170) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP;
Received: by mail-lb0-f170.google.com with SMTP id ge1so2324121lbb.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=woobling.org; s=google;
 h=x-received:mime-version:in-reply-to:references:from:date:message-id
 :subject:to:cc:content-type;
 bh=Fp+7h//FH4FeSG7iibhxl5SV1//UG3mM/aRT/RGK4As=;
 b=UvAmYa1rCs76AZn5MIitBDYU6MoVK4W8hpfu50GqEAhLudSWtx6rkegSWOW7o7Mhk0
 UXlLwkn+Z5AT+ckgY2MTkYRBaUbJqugUP/gRozpYAJp8KldL5/n1E3XFxuUR4wxDOafq
 UlpgvfqTywfkXicKtXrcWZA3o3dwgN/ErkN8c=
X-Received: by 10.112.26.41 with SMTP id i9mr3684755lbg.77.1359228914287; Sat,
MIME-Version: 1.0
Received: by 10.112.89.201 with HTTP; Sat, 26 Jan 2013 11:34:54 -0800 (PST)
In-Reply-To: <m28v7foo4a.fsf@ecocode.net>
To: Erik Colson <eco@ecocode.net>
Cc: kiokudb@perl.org
Content-Type: multipart/alternative; boundary=bcaec553ff389ac5fe04d436242e
X-Gm-Message-State: ALoCoQky9t2jASF09m2p6m9jmpr7oBQyz1yuQZG7r6ks/9yLRPJo7azdKuYQ2WEXLdApRi7Nqct8
X-Virus-Checked: Checked
Approved: news@nntp.perl.org
Lines: 56
X-Original-Bytes: 5486