Hi!

I'm not any good at Clojure, but it seems like a great language! I
have tried some examples and am reading a book about it. I have
dabbled with Haskell before and I am really fascinated by the
functional paradigm.

I'm planning to reduce my time at my full time job to create a small
startup. And I am thinking about create a lean and mean architecture
which will enable me to get things done.

For me, a big part of getting things done will be having fun. And I
can see myself having lots of fun developing in Clojure. Also the
expressiveness of functional languages attract me and I think it will
be a great part of achieving results too.

I am thinking about creating a layered architecture like this:

1. Front end
2. Business
3. Database

It is a pretty common architecture I think. When it comes to OO
languages like Java it is commonly used. In my own a opinion a bit too
common as the separation between layers turns it more into procedural
programming than OOP. But that isn't what this post is about, and I
suspect this kind of architecture could be suitable when I put Clojure
into the mix.

I think that the "2. Business Layer" should be Clojure. It would talk
to the "1. Front End" by a web service REST interface. Exactly how the
data should be encoded is something I haven't though about yet. But
JSON seems like an easy format.

Ideally the "1. Front End" would support users which have JavaScript
turned off as well as the most common on. I have used a bit of Wicket
for Java and I like it. So I might use Wicket for that and have the
models (Wicket has the data needed for the web user interface in an
abstraction called models) talk to the "2. Business Layer".

When it comes to the "3. Database" I am leaning towards PostgreSQL, or
maybe MySQL. They have been around for a long while and at least I
know MySQL relatively well. The NoSQL solutions seems a bit
interesting too, but I have no experience with them.

My idea is basically to create a good Customer Relationships
Management (CRM) system and sell it as a service to companies. The
users will input information about customers and related events and it
will be easy to search. I'll have quite a lot of business logic which
makes these tasks easier. The logic will most often be stuff which
handles graphs (which SQL really has some problems handling nicely).

Some must have goals:

1. If it becomes a success, it needs to be able to scale over multiple
machines with load balancing. There will be some data which should be
replicated between the machines, but a delay is all right.
2. As I sell it uptime is important. If I have several machines and
one of them dies. I'd like the service to be available using the other
machines.

It would be nice if I supported both clients able to execute
JavaScript and those who do not. But I think most clients will be able
to use JavaScript.

My questions:

1. Do you think Wicket is a good choice for the front end for me? It
has session state on the server which I need to replicate in more or
less real time. If I have the state on the client using JavaScript I
don't have to deal with that replication. But how would I achieve that
in the most smooth way? Should I go for Compojure for the front end to
not have to deal with two languages? And then maybe skip the
separation of layer "1. Front End" and "2. Business"?

2. Will it be hard to write a nice web service interface in Clojure?
Is it a suitable communication strategy with Clojure? Maybe I am
making it too complicated?

3. Clojure has a lot of nice stuff for handling data in transactions.
But if all my data resides in a database will I get to really enjoy
this advantage? I have been thinking about actually storing the data
using Clojure and skip the database, to get more out of Clojure. Is
that idea too crazy? I will have to deal with data replication myself
then, or maybe something like memcache will solve it for me?

4. Clojure has stuff to deal with transactions. But so do databases.
How do they come together in a nice symbiosis? Making most of the
processing on the database is often regarded as a best practice. But
then I will be writing some logic in SQL and others in Clojure. I am
not so thrilled about SQL as I am with Clojure. Where should I draw
the line to get the best system and enjoy the fruits of Clojure?

5. Is it hard to debug Clojure? Using Java/C# today you get a real
treat when it comes to debugging with interactive stepping, expression
watching and a lot of other cool things. Where is Clojure debugging
compared to other languages? Is the debugging features as necessary as
in other languages?

6. And what about profiling? I guess I can use any JVM profiler. But
will it be hard for me to connect a performance problem with the
relevant Clojure code?

7. Any other advice or thoughts you have about this?

Thank you SO MUCH for reading this rather long mail! I appreciate it
and would really love if you have some feedback for me!

Best regards,
Kent Larsson

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to