du8791069 2013-01-22 18:54
浏览 46
已采纳

是否可以拥有脱机数据库

Short Story: I downloaded a java/flash uploader and one of the files was a .db. After some research I found that is a database. Which prompted the question. Can I make a database (.db) file and save it in a folder in my root directory instead of having to rely on another server and sql query's? Thereby theoretically speeding up my website by accessing only local files.

The Problem: I have done lots of research and found no answer. Mainly I think because I have never dealt with this before so i don't know where to look.

The Question: Has anyone ever heard of such a thing? And if so, could you refer me to a tutorial website or provide a brief definition/ explanation/ example of how this would work and what type of communication language would be used between the files? SQL? something else? I just don't know!

Thank you all for your help.

  • 写回答

6条回答 默认 最新

  • douya1855 2013-01-22 19:01
    关注

    [The good part] Theoretically, yes, you can do it. One example would be sqlite database. This database is a single file that you store wherever you want. If you're coding in PHP, you'll need to have the corresponding extension installed with your PHP to access/query this database.

    [The bad part] This only makes sense if you're dealing with small amounts of data and your queries are relatively simple. Sqlite databases are slow and support only a limited set of sql operations. They also don't have support for many standard datatypes and lack a lot of built-in functions that you may rely on. Sqlite databases are very good if you want a simple db support in a standalone app (e.g. mobile application with local data), but not very good for storing large amounts of transactional data.

    [The verdict] If you're looking to speed up your web application, switching from a proper database to sqlite will probably only hinder your app, not help it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog