简体   繁体   English

SQLite和Flex

[英]SQLite and Flex

I am developing a GPS calculator that uses a lot of data to calculate different values, such as RMSE (root mean square error) and NSSDA (national standard for spatial data). 我正在开发一个GPS计算器,该计算器使用大量数据来计算不同的值,例如RMSE(均方根误差)和NSSDA(空间数据的国家标准)。 The data is from a variety of different models of GPS units with a great degree in variation, ie internal/external antennae; 数据来自各种不同型号的GPS单元,它们的变化程度很大,即内部/外部天线; auto, WAAS, DGPS, PPS signal; 自动,WAAS,DGPS,PPS信号; open, light, medium, heavy canopy; 敞开的,轻的,中等的,重的顶篷; etc. Basically a whole lot of data needs to be stored to compute the huge variety of desired outcomes. 基本上,需要存储大量数据才能计算出各种所需的结果。

The data will always be read, and only in rare conditions will new data be added. 数据将始终被读取,只有在极少数情况下才会添加新数据。 If it does need to be added, it will most likely be by one of the developers, not users of the program. 如果确实需要添加它,则它很可能由开发人员之一而不是该程序的用户添加。 Because of this, we are very interested in using SQLite. 因此,我们对使用SQLite非常感兴趣。 We have Oracle on our server, but any creation of tables must be done by higher-ups, which can sometimes take weeks. 我们的服务器上安装了Oracle,但是任何表的创建都必须由高层来完成,有时可能需要数周的时间。 For this reason SQLite seems like it might work for us. 因此,SQLite似乎可以为我们工作。 I have never used SQLite, so I am wondering if it is the right choice. 我从未使用过SQLite,所以我想知道这是否是正确的选择。 However, most documentation about SQLite and Flex seems to be pertaining to AIR applications and SQLite as a local database. 但是,有关SQLite和Flex的大多数文档似乎都与AIR应用程序和SQLite作为本地数据库有关。 Would having an SQLite file on the server with a flex application performing the desired calculations even work? 在服务器上使用Flex应用程序执行所需计算的SQLite文件是否还能工作? Or am I way off the mark on the use of SQLite files? 还是我无法使用SQLite文件?

I don't know Flex. 我不知道Flex。 But I like SQLite very much. 但是我非常喜欢SQLite。

Your application (reading data with very seldom updates -- mostly of just one instance) I would see as an ideal situation for SQLite! 我认为您的应用程序(很少有更新读取数据-大多是一个实例)对于SQLite来说是一种理想的情况!

SQLite is very performant and also scales up gracefully. SQLite的性能非常好,并且可以正常扩展。 The only application, I would not recommend it, is when you have a heavy transaction burden (many concurrent modifications of Db contents). 我不建议您使用的唯一应用程序是当您有沉重的事务负担(许多同时修改Db内容)时。 Also when you have to have a really big data mass to handle (millions or billions of rows) I would more likely think of a grown up database with possibility to use multiple CPUs or instances ... 同样,当您必须处理非常大的数据量(数百万或数十亿行)时,我很可能会想到一个可以使用多个CPU或实例的成熟数据库...

But all that seams to be not your case here. 但是所有这些都不是您的情况。

A Flex application won't be able to use a SQLite database located on the user's computer - for that, you need to use AIR. Flex应用程序将无法使用位于用户计算机上的SQLite数据库-为此,您需要使用AIR。 But you seem to be saying that the SQLite database would remain on the server, and be queried by the Flex client. 但是您似乎在说SQLite数据库将保留在服务器上,并由Flex客户端查询。 You only seem to want to use SQLite because setting up stuff in Oracle takes too long because of internal business processes. 您似乎只想使用SQLite,因为由于内部业务流程,在Oracle中设置内容花费的时间太长。

So, you can certainly set up a SQLite database on your server, serve the data it contains to clients, using a whole host of server-side frameworks (my favourite: Django ), and read and present the data using Flex in the client's browser. 因此,您当然可以在服务器上建立一个SQLite数据库,使用一整套服务器端框架(我最喜欢的Django )将其包含的数据提供给客户端,并在客户端的浏览器中使用Flex读取和呈现数据。 SQLite is a good choice for small-to-medium-sized applications. SQLite是中小型应用程序的不错选择。

Not the way you're probably thinking, no -- there's no SQLite client built into Flex proper. 不是您可能想到的方式,不是-Flex本身没有内置SQLite客户端。 From a Web-based Flex app, the only way to access a relational database (even a SQLite file) is through a web-service API of some sort. 从基于Web的Flex应用程序中,访问关系数据库(甚至是SQLite文件)的唯一方法是通过某种Web服务API。

If you haven't already run across it, here's some useful StackOverflow discussion for you addressing the scalability of SQLite specifically: 如果您还没有运行过它,那么这里有一些有用的StackOverflow讨论,可用于您专门解决SQLite的可伸缩性:

How Scalable is SQLite? SQLite的可伸缩性如何?

Based on your description of the project, assuming you're not going to have very high volume (even if it's only selects), SQLite might be an acceptable choice. 根据您对项目的描述,假设您不会有很高的数量(即使只是选择),则SQLite可能是可接受的选择。

But my personal suggestion would be that if you have any ability whatever to run even a simple a RDBMS instance somewhere (MySQL, for example), definitely go that route. 但是我个人的建议是,即使您有能力在某个地方(例如MySQL)运行一个简单的RDBMS实例,也可以采用这种方法。 You might simply be limited operationally -- every company's different in that sense. 您可能只是在操作上受到限制-在这种意义上,每个公司都不一样。 But if you can help it, don't choose a flat file as the database of your Web app. 但是,如果您能提供帮助,请不要选择平面文件作为Web应用程序的数据库。 Even if you don't run into contention issues right off the bat, you'll almost surely run into them eventually. 即使您没有立即遇到争用问题,您也几乎肯定会最终遇到它们。 That's a headache best avoided if you can manage it. 如果可以管理的话,最好避免这种头痛。

I love sqlLITE but I have only used it with Perl. 我喜欢sqlLITE,但是我只在Perl中使用过它。

You could use something like Amazon's SimpleDB which is a database that can be accessed as a webService. 您可以使用类似于Amazon的SimpleDB之类的东西,该数据库可以作为WebService进行访问。 It's also free if you have less than 1GB of data and use it less than 25 hours a month. 如果您的数据量少于1GB,并且每月使用时间少于25小时,则它是免费的。

Link to simpleDB http://aws.amazon.com/simpledb/ 链接到simpleDB http://aws.amazon.com/simpledb/

There is an AS3 library for simpleDB but I don't have the reputation to have more than one link :-(.. So google: "Amazon illustratedlife simpleDB" 有一个用于simpleDB的AS3库,但我不以拥有多个链接而著称:-( .. google:“ Amazon illustrationlife simpleDB”

Good Luck 祝好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM