将XML数据存储在mongodb集合中 [英] Store XML Data in a mongodb collection
问题描述
我对像mongodb这样的NoSQL数据库还是比较陌生的,请原谅我的无知.
I am still relatively new to NoSQL databases like mongodb, so excuse my ignorance.
背景:
现在,我有一个执行以下操作的系统:
Right now, I have a system that does the following:
- 从客户端收集系统数据
- 将该信息输出到xml文档中
- perl脚本将数据放入xml标记中,并将其放入mySQL数据库中.
- 由apache/php驱动的网站显示数据.
此系统的目的是充当服务器/机箱/网络设备/等的清单.
The purpose of this system is to act as an inventory for servers/chassis/network devices/etc.
这是一个不错的系统,但是由于我在将其用于存储的数据类型时看到了优势,因此我决定使用非关系数据库.
This has been an okay system, but I have decided to go to a non-relational database because of the advantages I see in using that for the type of data I am storing.
问题:
- 使用mongodb从xml文档中提取信息是否非常简单?
- 是否应该重写必须输出JSON/BSON文件而不是XML的脚本?
- 您如何从文件中获取信息并将其放入mongodb数据库中?
推荐答案
当迁移到NoSQL文档数据库时,该决定很大程度上受客户端/用户如何读取或使用数据的影响因为数据大部分是根据使用模式预先汇总/预先合并的.因此,从技术上讲,您可以在导入数据时将数据仅转换为json/bson而不是xml,从而技术上"移至mongodb.
When moving to a NoSQL document DB, the decision is highly influenced by how the data is read or used by the client/user as the data is mostly pre-aggregated/pre-joined based on the usage patterns. So, technically you can move to mongodb "technically" by just converting the data to json/bson instead of xml while importing the data.
这篇关于将XML数据存储在mongodb集合中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!