慢速网络上的 MS Access 数据库:分离后端是否更快?
我有一个 Access 数据库,其中包含有关人员的信息(员工资料和相关信息)。前端有一个类似控制台的界面,一次修改一种类型的数据(例如一种形式的学位,另一种形式的联系信息)。它当前链接到多个后端(一个用于每种类型的数据,一个用于基本配置文件信息)。所有文件都位于网络共享上,并且许多后端都已加密。
我这样做的原因是,我知道 MS Access 必须将整个数据库文件拉到本地计算机才能进行任何查询或更新,然后将任何更改的数据放回到网络共享上。我的理论是,如果一个人要更改电话号码或地址(联系信息),他们只需提取/修改/替换联系信息数据库,而不是提取包含联系信息、项目、学位、奖项的单个大型数据库等,只需更改一个电话号码,从而减少多个用户访问数据时锁定数据库和网络流量的可能性。
这是一个明智的结论吗?我是不是误解很大了?我还缺少其他东西吗?
我意识到每个文件都会考虑开销,但我不知道影响有多大。如果我要整合后端,还有一个潜在的好处是能够让 Access 处理级联删除等的引用完整性,而不是为此进行编码...
我会很感激任何想法或(合理有效)批评。
I have an Access database containing information about people (employee profiles and related information). The front end has a single console-like interface that modifies one type of data at a time (such as academic degrees from one form, contact information from another). It is currently linked to multiple back ends (one for each type of data, and one for the basic profile information). All files are located on a network share and many of the back ends are encrypted.
The reason I have done that is that I understand that MS Access has to pull the entire database file to the local computer in order to make any queries or updates, then put any changed data back on the network share. My theory is that if a person is changing a telephone number or address (contact information), they would only have to pull/modify/replace the contact information database, rather than pull a single large database containing contact information, projects, degrees, awards, etc. just to change one telephone number, thus reducing the potential for locked databases and network traffic when multiple users are accessing data.
Is this a sane conclusion? Do I misunderstand a great deal? Am I missing something else?
I realize there is the consideration of overhead with each file, but I don't know how great the impact is. If I were to consolidate the back ends, there is also the potential benefit of being able to let Access handle referential integrity for cascading deletes, etc., rather than coding for that...
I'd appreciate any thoughts or (reasonably valid) criticisms.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个常见的误解:
MS Access 必须将整个数据库文件拉到本地计算机才能进行任何查询或更新
考虑此查询:
如果 EmpID 已建立索引,数据库引擎将读取足够的数据索引来查找哪些表行匹配,然后读取匹配的行。如果索引包含唯一约束(假设EmpID是主键),读取速度会更快。数据库引擎不会读取整个表,甚至也不会读取整个索引。
如果 EmpID 上没有索引,引擎将对员工表进行全表扫描 — 这意味着它必须读取表中的每一行以确定哪些包含匹配的 EmpID 值。
但无论哪种方式,引擎都不需要读取整个数据库……客户、库存、销售等表……它没有理由读取所有这些数据。
您是对的,连接到后端数据库文件会产生开销。引擎必须管理每个数据库的锁定文件。我不知道这种影响有多大。如果是我,我会创建一个新的后端数据库并从其他数据库导入表。然后复制前端并重新链接到后端表。这将使您有机会直接检查性能影响。
在我看来,关系完整性应该是将表合并到单个后端的有力论据。
关于锁定,您不需要为例行 DML(INSERT、UPDATE、DELETE)操作锁定整个后端数据库。数据库基础引擎支持更细粒度的锁定。还有悲观锁定与机会锁定——锁定是在您开始编辑行时发生还是推迟到您保存更改的行时发生。
实际上,如果慢意味着无线网络,“网络慢”可能是最大的问题。仅在硬连线 LAN 上访问才安全。
编辑:访问不适合 WAN 网络环境。请参阅 Albert D. Kallal 的此页。
This is a common misunderstanding:
MS Access has to pull the entire database file to the local computer in order to make any queries or updates
Consider this query:
If EmpID is indexed, the database engine will read just enough of the index to find which table rows match, then read the matching rows. If the index includes a unique constraint (say EmpID is the primary key), the reading will be faster. The database engine doesn't read the entire table, nor even the entire index.
Without an index on EmpID, the engine would do a full table scan of the Employees table --- meaning it would have to read every row from the table to determine which include matching EmpID values.
But either way, the engine doesn't need to read the entire database ... Clients, Inventory, Sales, etc. tables ... it has no reason to read all that data.
You're correct that there is overhead for connections to the back-end database files. The engine must manage a lock file for each database. I don't know the magnitude of that impact. If it were me, I would create a new back-end database and import the tables from the others. Then make a copy of the front-end and re-link to the back-end tables. That would give you the opportunity to examine the performance impact directly.
Seems to me relational integrity should be a strong argument for consolidating the tables into a single back-end.
Regarding locking, you shouldn't ever need to lock the entire back-end database for routine DML (INSERT, UPDATE, DELETE) operations. The database base engine supports more granular locking. Also pessimistic vs. opportunistic locking --- whether the lock occurs once you begin editing a row or is deferred until you save the changed row.
Actually "slow network" could be the biggest concern if slow means a wireless network. Access is only safe on a hard-wired LAN.
Edit: Access is not appropriate for a WAN network environment. See this page by Albert D. Kallal.
ms access 不太适合在局域网或广域网中使用,速度肯定较低。解决方案是使用客户端服务器数据库,例如 Ms SQL Server 或 MySQL。 Ms SQL Server 比 My SQL 好得多,但它不是免费的。对于大型项目,请考虑使用 Ms SQL Server。我再说一次,MS access 仅适用于 1 台计算机,不适用于计算机网络。
ms access is not good to use in local area network nor wide area network which certainly have lower speed. the solution is to use a client server database such as Ms SQL Server or MySQL. Ms SQL Server is much better than My SQL but it is not free. Consider Ms SQL server for large-scale projects. Again I said MS access is only good for 1 computer not for computer network.