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 删除虚拟显示器驱动 删除所有 Xorg 配置文件 删除显示器缓存文件 重启系统 可是依旧无法退出虚拟显示器
  • ¥15 vscode程序一直报同样的错,如何解决?
  • ¥15 关于使用unity中遇到的问题
  • ¥15 开放世界如何写线性关卡的用例(类似原神)
  • ¥15 关于并联谐振电磁感应加热
  • ¥15 this signal is connected to multiple drivers怎么解决
  • ¥60 请查询全国几个煤炭大省近十年的煤炭铁路及公路的货物周转量
  • ¥15 请帮我看看我这道c语言题到底漏了哪种情况吧!
  • ¥66 如何制作支付宝扫码跳转到发红包界面
  • ¥15 pnpm 下载element-plus