mysql字段存储xml_在MySQL数据库中存储XML数据的最佳方式,有一些具体要求

bd96500e110b49cbb3cd949968f18be7.png

I am receiving XML data from a service. The test data I am receiving back has about 300 XML nodes, clearly far too many to create individual rows for in a MySQL database.

The problem is that we ideally need to store all the data, and we will probably need to reference the data again at some point in the future - we can't just process through it once and delete the XML string.

What's the best way of storing this data in a MySQL database?

I have forecast that at the predicted rate within a few months, if we were to store the raw XML data in TEXT format, the database could grow to around 500MB. In the long run this feels impractical.

解决方案

You could create a blob column (i.e. mediumtext column). Instead of inserting XML purely as strings in the DB, you could zip the XML, then store in MySQL.

When you read from MySQL, you unzip it again. Since XML is text you'll get very high compression rates (close to 80% compression). The thought process being, disk IO takes a lot longer time than compression/un-compression which is predominantly Processor bound.

The downside being you will no longer be able to query or do full text search using SQL....

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Camunda,CREATE_TIME_字段是用于存储流程实例创建时间的字段,它是从系统时间获取的。如果CREATE_TIME_时间不准确,可能是因为数据库服务器的时间设置不正确,或者与应用服务器的时间不同步。 为了解决这个问题,你可以尝试以下几种方法: 1. 检查数据库服务器的时间设置,确保它与应用服务器的时间相同步。 2. 在camunda.cfg.xml文件添加以下配置: ```xml <property name="databaseSchemaUpdate">true</property> <property name="jobExecutorActivate">true</property> <property name="history">full</property> <property name="useLocalTransactionState">true</property> <property name="jdbcBatchProcessing">false</property> <property name="jobExecutorDeploymentAware">true</property> <property name="asyncExecutorEnabled">true</property> <property name="asyncExecutorActivate">true</property> <property name="asyncExecutorCorePoolSize">10</property> <property name="asyncExecutorMaxPoolSize">100</property> <property name="asyncExecutorQueueSize">1000</property> <property name="asyncExecutorKeepAliveTime">5000</property> <property name="asyncExecutorThreadPoolQueue">false</property> <property name="asyncExecutorThreadPoolRejectedPolicy">discard</property> <property name="asyncExecutorWaitTimeInMillis">5000</property> <property name="asyncExecutorDefaultTimerJobAcquireWaitTime">10000</property> <property name="asyncExecutorDefaultAsyncJobAcquireWaitTime">10000</property> <property name="asyncExecutorDefaultQueueSizeFullWaitTime">10000</property> <property name="asyncExecutorDefaultCorePoolSize">10</property> <property name="asyncExecutorDefaultMaxPoolSize">100</property> <property name="asyncExecutorDefaultKeepAliveTime">5000</property> <property name="asyncExecutorDefaultQueueCapacity">1000</property> <property name="processEngineBootstrapSchemaResource">create/activiti.postgres.create.engine.sql</property> <property name="processEngineBootstrapHistoryResource">create/activiti.postgres.create.history.sql</property> <property name="processEngineBootstrapIdentityResource">create/activiti.postgres.create.identity.sql</property> <property name="processEngineBootstrapAuthorizationResource">create/activiti.postgres.create.authorization.sql</property> <property name="jdbcUrl">jdbc:postgresql://localhost:5432/activiti</property> <property name="jdbcDriver">org.postgresql.Driver</property> <property name="jdbcUsername">postgres</property> <property name="jdbcPassword">postgres</property> ``` 注意:上面的配置是基于PostgreSQL数据库的,如果你使用的是MySQL数据库,需要将其的一些配置项进行相应的修改。 3. 确保你的Camunda版本是最新的,如果不是,可以尝试升级到最新版本。 4. 如果以上方法都无法解决问题,可以尝试重新安装Camunda并重新配置数据库,然后重新部署你的流程定义。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值