[英]Backend for Web Development using Clojure/ClojureScript
I'm familiar with developing desktop apps in Clojure (written a multithreaded interactive visualization system). 我熟悉在Clojure中开发桌面应用程序(编写多线程交互式可视化系统)。 However, I'm fairly new to Web development using Clojure.
但是,我对使用Clojure的Web开发相当陌生。
I plan to use Clojure on the server for handling logic; 我计划在服务器上使用Clojure来处理逻辑; and ClojureScript for handing client side work.
和ClojureScript用于处理客户端工作。 However, I don't know what to use for my database server.
但是,我不知道我的数据库服务器要使用什么。 Should I use something like Monogodb?
我应该使用像Monogodb这样的东西吗? or Hadoop?
还是Hadoop? Or .... ?
要么 .... ?
The app is something very simple; 该应用程序非常简单; a basic forum.
一个基本的论坛。 Total number of concurrent users will be < 100 at a given time.
在给定时间,并发用户总数将<100。 One thing that is important to me is the ability to easily backup / data consistency -- it's very very important to me that I can easily make daily backups (and not lose all the data.)
对我来说重要的一点是能够轻松备份/数据一致性 - 对我来说非常重要的是我可以轻松地进行日常备份(而不是丢失所有数据)。
Thanks! 谢谢!
You can use many databases; 你可以使用很多数据库; if the database has an API for Java, you should be good to go.
如果数据库有一个Java API,你应该好好去。 MySQL , MongoDB , Postgres , Hadoop … and more.
MySQL , MongoDB , Postgres , Hadoop ......等等。
For a nice overview of the webstack in Clojure, check out brehaut's article on the matter . 有关Clojure中webstack的精彩概述,请查看brehaut 关于此事的文章 。
For getting up and running quickly with Clojure and ClojureScript, try ClojureScriptOne . 要使用Clojure和ClojureScript快速启动和运行,请尝试使用ClojureScriptOne 。
There are many ways to write what you want to write; 有很多方法可以写出你想写的东西; if you're already familiar with Clojure, it shouldn't be too hard to get going.
如果你已经熟悉Clojure,那么开始它应该不会太难。
我自己没有使用它,但Datomic( http://datomic.com/ )看起来很适合来自Clojure的任何人。
Datomic is an amazing database, and I'd highly recommend it. Datomic是一个了不起的数据库,我强烈推荐它。 It has many features which set it apart from other database systems:
它具有许多功能,使其与其他数据库系统区别开来:
pull
api, which let's you pull data out of the database more simply using a GraphQL like expression which specifies the shape of a document-like structure you'd like to pull out of the database. pull
api,它允许您使用类似GraphQL的表达式从数据库中提取数据,该表达式指定了您想要从数据库中提取的类文档结构的形状。 These queries can even be used from within the :find
clause of a Datalog query. :find
子句中使用这些查询。 One of the things worth pointing out here is that by embracing the EAV data model and datalog/pull queries, Datomic ends up having structural flexibility closer to that of a NoSQL database, while still being fundamentally relational, and even more expressive in it's relational queries than SQL. 值得指出的一点是,通过采用EAV数据模型和数据记录/拉取查询,Datomic最终具有更接近NoSQL数据库的结构灵活性,同时仍然是基本的关系,并且在其关系查询中更具表现力比SQL。
It's amazing and you should absolutely give it a shot. 这太棒了,你绝对应该试一试。 It will melt your brain a little.
它会使你的大脑融化一点。 In the good way.
好的方式。
It's also worth noting that it's popularity has inspired a number of successful open source projects, so the underlying approach is not going anywhere any time soon: 值得注意的是,它的受欢迎程度激发了许多成功的开源项目,因此基础方法不会很快就会出现:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.