将 SQLite 数据库文件放在 Azure 应用服务中的何处? [英] Where to put SQLite database file in Azure App Service?

查看:31
本文介绍了将 SQLite 数据库文件放在 Azure 应用服务中的何处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Q1:您认为在 Azure 中放置 SQLite 数据库文件 (database.sqlite) 的合适位置Web App 文件系统?例如:

  1. D:homedatadatabase.sqlite
  2. D:homesitedatabase.sqlite
  3. D:homesitewwwrootdatabase.sqlite
  4. 其他?

Q2:为了确保公共用户无法访问数据库文件以及在部署期间或应用程序运行时不会被意外覆盖,还应该考虑什么放大/缩小?(Web 应用程序配置为从本地 Git 存储库进行部署)

Q3:从哪里可以详细了解 Azure 应用服务中使用的文件系统,官方源 URL?例如.它如何在单个 Web 应用程序中的多个 VM 之间共享,当应用程序向上/向下扩展时它如何工作,D:home(持久性)与 D: 之间的区别是什么本地(非持久)...

请注意,SQLiteAzure 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:

    1. D:homedatadatabase.sqlite
    2. D:homesitedatabase.sqlite
    3. D:homesitewwwrootdatabase.sqlite
    4. 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) vs D: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

    解决方案

    In a Web App, your app is deployed to d:homesitewwwroot. This is the area where you may write files. As an example, the ghost deployment writes its SQLite database to d:homesitewwwrootcontentdataghost.db. (easy to see this, if you open up the kudu console via yourapp.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 应用服务中的何处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆