Where to put SQLite database file in Azure App Service?(将 SQLite 数据库文件放在 Azure 应用服务中的何处?)
问题描述
Q1:您认为在 Azure 中放置 SQLite 数据库文件 (database.sqlite
) 的合适位置Web App 文件系统?例如:
D:homedatadatabase.sqlite
D:homesitedatabase.sqlite
D:homesitewwwrootdatabase.sqlite
- 其他?
Q2:为了确保公共用户无法访问数据库文件以及在部署期间或应用程序运行时不会被意外覆盖,还应该考虑什么放大/缩小?(Web 应用程序配置为从本地 Git 存储库进行部署)
Q3:从哪里可以详细了解 Azure 应用服务中使用的文件系统,官方源 URL?例如.它如何在单个 Web 应用程序中的多个 VM 之间共享,当应用程序向上/向下扩展时它如何工作,D:home
(持久性)与 D: 之间的区别是什么本地
(非持久)...
请注意,SQLite 在 Azure Blob 存储 中不起作用,因此它不是一种选择.请不要建议其他存储解决方案,这个问题专门针对 SQLite.
参考资料
此文件区域在您的 Web 应用程序实例之间共享.类似于 SMB 文件共享,但特定于 Web 应用(与 Azure 的文件服务不同).
wwwroot
下的内容是持久的,除非您删除您的应用服务.向上/向下扩展会影响可用空间量.(我不知道如果您按比例缩小并且较小的尺寸比您已经消耗的磁盘空间少会发生什么.Q1: Where do you think is the right place to put a SQLite database file (
database.sqlite
) in Azure Web App file system? For example:D:homedatadatabase.sqlite
D:homesitedatabase.sqlite
D:homesitewwwrootdatabase.sqlite
- other?
Q2: What else should be taken into consideration in order to make sure that the database file won't be accessible to public users as well as not being accidentally overwritten during deployments or when the app is scaled up/down? (The Web App is configured for deployments from a Local Git Repository)
Q3: Where to learn more about the file system used in Azure App Service, the official source URL? E.g. how it's shared between multiple VMs within a single Web App, how does it work when the App is scaled up/down, what's the difference between
D:home
(persistent) vsD:local
(non-persistent)...Note that SQLite does not work in Azure Blob Storage, so that one is not an option. Please, don't suggest alternative storage solutions, this question is specifically about SQLite.
References
- Appropriate Uses For SQLite
解决方案In a Web App, your app is deployed to
d:homesitewwwroot
. This is the area where you may write files. As an example, theghost
deployment writes its SQLite database tod:homesitewwwrootcontentdataghost.db.
(easy to see this, if you open up the kudu console viayourapp.scm.azurewebsites.net
):This file area is shared amongst your web app instances. Similar to an SMB file share, but specific to web apps (and different than Azure's File Service).
The content under
wwwroot
is durable, unless you delete your app service. Scaling up/down impacts the amount of space available. (I have no idea what happens if you scale down and the smaller size has less disk space than what you're consuming already).这篇关于将 SQLite 数据库文件放在 Azure 应用服务中的何处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将 SQLite 数据库文件放在 Azure 应用服务中的何处?


- SQL 临时表问题 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01