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 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记