如何让多人编辑同一个 SQL Server 数据库?

huangapple go评论66阅读模式
英文:

How can I have multiple people editing the same SQL Server Database?

问题

Me and some friends are working on a school project, and I've been looking for a way to allow us all to work and edit on the same database just like we would on a VS project through GitHub.

我和一些朋友正在做一个学校项目,我一直在寻找一种方式,让我们可以像在VS项目中通过GitHub一样在同一个数据库上共同工作和编辑。

I've tried importing the database into an SQL Database project on VS so we could work through GitHub, but I'm not sure if VS is as effective as the actual SSMS.

我尝试将数据库导入到VS上的SQL数据库项目中,以便我们可以通过GitHub合作,但我不确定VS是否和实际的SSMS一样有效。

It doesn't matter if it's not through GitHub, I just want to know if there is a way for us to work on a database without having to export it and then import it again.

即使不是通过GitHub,也没关系,我只是想知道是否有一种方式让我们在不必导出和再次导入的情况下共同工作于数据库。

Edit: By 'editing' I meant just working on the database overall, make changes, get data, edit tables, etc.

编辑:我所指的“编辑”只是指在数据库上的整体工作,进行更改,获取数据,编辑表格等。

英文:

Me and some friends are working on a school project, and I've been looking for a way to allow us all to work and edit on the same database just like we would on a VS project through GitHub.

I've tried importing the database into an SQL Database project on VS so we could work through GitHub, but I'm not sure if VS is as effective as the actual SSMS.

It doesn't matter if it's not through GitHub, I just want to know if there is a way for us to work on a database without having to export it and then import it again.

Edit: By 'editing' I meant just working on the database overall, make changes, get data, edit tables, etc.

答案1

得分: 2

"通过'编辑',我指的只是对整个数据库进行操作,进行更改,获取数据,编辑表格等。

简短回答是 :截至2023年2月,尚未建立起在关系型数据库管理系统(RDBMS)上进行设计和数据的分布式协作工作的成熟工具(除了像 Dolt 这样的实验性数据库之外),特别是在以SQL Server为基础的Microsoft/VS生态系统中。

原因根植于数据库中心的软件开发现实:数据库内的实际数据对于操作和操纵它的系统而言是无关紧要的(有一些例外1),这一原则是使处理非常敏感的数据(例如医疗记录等)的公司能够完成任何工作的关键:开发人员使用仅类似于真实世界数据的虚假生成数据进行工作,而真实数据(关于真实人们的真实数据)则存在于一个几乎没有人能够访问的独立数据库中,但它将具有与开发人员数据库中虚假数据相同的设计/模式。

如果你想要协作进行_数据和设计_,那么今天的工具中<sub>在我看来</sub>“最佳”方法是在云中2拥有一个单一的RDBMS数据库,例如Azure SQL或Amazon RDS - 但是你仍然应该将数据库设计/模式存储在源代码控制中,作为SSDT *.sqlproj 项目,并且不要直接对这个数据库进行设计/模式更改,而是通过SSDT进行 - 只在这个实时/云数据库中进行_数据更改_。

如果你有协作者不能始终连接到这个中央的云托管数据库,那么你将面临_一个非常困难的问题_,这完全值得提一个完全不同的问题(欢迎来到CAP定理)。

英文:

> By 'editing' I meant just working on the database overall, make changes, get data, edit tables, etc.

The short answer is no: as of Feburary 2023 there is no established tooling (outside of experimental databases like Dolt) for distributed collaborative work on both design-and-data on an RDBMS, especially not in the SQL Server-based Microsoft/VS ecosystem.

The reason why is rooted in a reality of database-centric software development: the actual data within a database is irrelevant to working on the system that consumes and manipulates it (with exceptions1), this principle is what enables companies handling very sensitive data (such as medical records, etc) to get any work done: the devs work with fake, generated data that only resembles real-world data, while the real data about real people lives in a separate database that almost no-one can access but it will have the exact same design/schema as the developer's database with the fake data in.

If you want to collaborate on data and the design then the "best" approach with today's tooling <sub>in my opinion</sub> is to have a single RDBMS database in the cloud2 like Azure SQL or Amazon RDS - but you should still have your database design/schema in source-control in an SSDT *.sqlproj project - and to not directly make design/schema changes to this database without going through SSDT - and only make data changes in this live/cloud database.

If you have collaborators that won't always be able to connect to this central single cloud-hosted database then you have a very hard problem to solve which is worthy of another question entirely (welcome to the CAP Theorem).

1: Exceptions like setup/config/"system" data, and seed data for bootstrapping, or data used in test-cases. Point is: designing a database for animal taxonomy doesn't require actual Latin animal species names, and designing a patient/medical database doesn't require having the real details of real people with real conditions stored in your git repository.

2: ugh, I hate that word

huangapple
  • 本文由 发表于 2023年2月10日 06:42:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/75405208.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定