在grails的H2 DB中导入CSV [英] Import CSV in H2 DB of grails

查看:169
本文介绍了在grails的H2 DB中导入CSV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是问题的延续:使用CSV格式的Grails(无DB)

我有三个CSV文件作为我的后端(在共享驱动器中),它们不断被greenplum DB(正在附加的行)更新,我想要以导入这些文件在H2DB(默认)的grails,然后使用这些文件。
CSV文件大小为3mb,30mb和60mb,最后一个有550,000行。
这些CSV文件每小时更新一次新数据(追加行)

I have three CSV files as my backend(in shared drive), which are constantly being updated by the greenplum DB (rows being appended) and I want to import these files in the H2DB (default) of grails and then use these files. The CSV files are 3mb, 30mb and 60 mb in size and the last one has 550,000 rows. These CSV files are updated hourly with new data(appending rows)

这里可以安排Quartz。
快速问题:

The scheduling can be done by Quartz here. Quick questions :


  1. 这是否可行? ?在部署应用程序时,WAR文件会存储所有这些数据吗?

  1. Is this feasible? Can H2 DB store this much data? While deploying the app, will the WAR file then store all this data? Will the users not have to install any other DB then when this application is deployed ?

其次,是否可以将这些文件存储在MongoDB中,这可以是托管在一台机器上,数据源可以配置为只从本机获取数据。

Secondly, is it possible to store these files in MongoDB, which can be hosted in one machine and the datasource can be configured to take the data from this machine only?

基本上,当应用程序部署时,用户安装任何东西
(除了像Apache这样的servlet容器,我猜这是强制的,还是不是?
他们应该使用WAR文件并运行应用程序我是纠正/错误在这里?

Basically, when the application is deployed, I don't want users to install any thing (except the servlet container like Apache, which I'm guessing is compulsory, or is it not? They should just use the WAR file and run the application. Am I correct/wrong here?


推荐答案


  1. 这是可行的吗?是的,H2可以将数据存储到磁盘,有一个内存模式(见docs)。

  1. Is this feasible? Yes. H2 can stored the data to disk, there is an in-memory mode (see the docs).

这些文件在MongoDB?是...但是为什么要这样做?

Is it possible to store these files in MongoDB? Yes... but why would you want to do that?

这篇关于在grails的H2 DB中导入CSV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆