Re: Storing data on web server with Clojure

2014-01-02 Thread Sean Johnson
Keep in mind that the Heroku file system is a little "funky". Writing 
things there is not like you're used to with your local system or with a 
VPS or dedicated server. It's ephemeral and those files will disappear 
during certain events. I agree with the other Sean, that if the data is 
small and simple and you can just hold onto it in memory as Clojure data 
structures and serialize it to disk, that can be a fine approach (seems 
like an unusual case), but with Heroku, it's all about getting persistent 
data off the dyno and into external permanent storage. That's usually a 
hosted DB solution like Postgres, Redis, Mongo, CouchDB, etc. but if you 
don't have the complexity to justify a full DB, even a simple one like 
Mongo or Couch, then you should probably look into serializing your data 
structures as EDN into/out of redis key/values or an S3 bucket.

Cheers,
A different Sean

On Wednesday, January 1, 2014 4:07:11 AM UTC-5, curiousGuy wrote:
>
> I recently got started with Heroku and Clojure. They provide an optional 
> SQL database for handling data, but it is not enabled by default. I'm 
> wondering how much sense it makes to use SQL on a Clojure environment, vs 
> just using sequence types within the language to store data and backing 
> them up as writes out to a file, then reading them back in when necessary? 
> I suppose for very large data stores, this is not ideal as you'd have a lot 
> of data in memory.
>
> I'm coming from a PHP/MySQL background and am quite new to Clojure so I 
> don't want to shoot myself in the foot by quickly adopting old habits 
> rather than embracing more idiomatic approaches. Any advice, or anyone 
> actively using data in the cloud with Clojure care to comment?
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Storing data on web server with Clojure

2014-01-01 Thread Sean Corfield
I'd say it's really about how you want to interact with the data. If
your pattern of interaction suits a database, use one. If you just
want to store / load data structures and do everything in memory, do
that instead.

I use MySQL and MongoDB extensively via Clojure for a complex Internet
dating platform so I'm pretty comfortable using databases with
Clojure. Disclosure: I maintain Clojure's java.jdbc contrib library
and I'm the primary committer on CongoMongo, a Clojure wrapper for
MongoDB, so I'm probably more inclined toward those solutions than
other Clojurians might be :)

Sean

On Wed, Jan 1, 2014 at 1:07 AM, curiousGuy  wrote:
> I recently got started with Heroku and Clojure. They provide an optional SQL
> database for handling data, but it is not enabled by default. I'm wondering
> how much sense it makes to use SQL on a Clojure environment, vs just using
> sequence types within the language to store data and backing them up as
> writes out to a file, then reading them back in when necessary? I suppose
> for very large data stores, this is not ideal as you'd have a lot of data in
> memory.
>
> I'm coming from a PHP/MySQL background and am quite new to Clojure so I
> don't want to shoot myself in the foot by quickly adopting old habits rather
> than embracing more idiomatic approaches. Any advice, or anyone actively
> using data in the cloud with Clojure care to comment?
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Storing data on web server with Clojure

2014-01-01 Thread curiousGuy
I recently got started with Heroku and Clojure. They provide an optional 
SQL database for handling data, but it is not enabled by default. I'm 
wondering how much sense it makes to use SQL on a Clojure environment, vs 
just using sequence types within the language to store data and backing 
them up as writes out to a file, then reading them back in when necessary? 
I suppose for very large data stores, this is not ideal as you'd have a lot 
of data in memory.

I'm coming from a PHP/MySQL background and am quite new to Clojure so I 
don't want to shoot myself in the foot by quickly adopting old habits 
rather than embracing more idiomatic approaches. Any advice, or anyone 
actively using data in the cloud with Clojure care to comment?

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.