JSON 友好的数据库?
我有一个纯 jQuery 应用程序,它以 JSON 格式保存对象并提供客户端编辑。我想将 JSON 持久保存到数据库中,但一切似乎都有点矫枉过正(就像 C# 中的对象映射)。我即将决定将整个 JSON 字符串存储到数据库的单个列中。我希望有更多优雅的、创造性的方法,比如 jQuery/JSON/数据库框架,但找不到任何东西(也许 NoSql 可以使用?)。
关于如何使用尽可能少的服务器代码将 JSON 持久保存到数据库有什么建议或建议吗?
I have a pure jQuery app that keeps it's objects in JSON format and provides client-side editing. I want to persist the JSON to a database, but everything seems like overkill (like object mapping in C#). I am close to settling on storing the whole JSON string into a single column of a database. I was hoping there was more of an elegant, creative approach like a jQuery/JSON/database framework out there, but couldn't find anything (maybe NoSql can be of use?).
Any suggestions or advise on how to persisting JSON to a database using as less server code as possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我会查看 MongoDB 因为它是 JSON 样式的文档。
它还有大量驱动程序,所以我不认为这是一个问题。
I would check out MongoDB due to it's JSON style documents.
It also has plenty of drivers, so I wouldn't see it being an issue.
我认为使用服务器端技术是可以的,你的描述对我来说并不清楚。
满足您的需求首先想到的是 MongoDB (http://www.mongodb.org/) 。它具有 javascript shell 和以 JSON(技术上为 BSON)本机表示的对象。
服务器支持索引和其他给你温暖的 SQL 模糊的东西。
I assume it's ok to use a server side technology, your description wasn't real clear for me.
The first thing that comes to mind for your needs is MongoDB (http://www.mongodb.org/). It sports a javascript shell and objects that are natively represented in JSON (BSON technically).
The server supports indexing and other things that give you the warm SQL fuzzies.
CouchDB 怎么样?它使用 JSON 表示法来存储对象,您可以通过其 REST 接口直接从客户端访问数据库。
此外,已经有几个针对 CouchDB 的 jquery 插件,jqCouch 仅举一个。
What about CouchDB? It uses JSON notation to store the objects and you could access the db directly from the client side via its REST interface.
Besides, there are already several jquery plugins for CouchDB, jqCouch just to mention one.