SQL和Neo4j可以在.NET应用程序的身份微服务中一起使用吗?

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

Can SQL and Neo4j be used together in an Identity Microservice part of a .NET application

问题

我正在开发一个基于微服务架构的.NET Core应用程序。作为其中的一部分,我们正在设计一个用于用户身份验证和授权的身份微服务。

我们考虑采用多语言持久性方法,具体而言是使用SQL Server存储用户配置数据,因为它对结构化数据和ACID事务有很好的支持,以及使用Neo4j管理复杂关系和访问控制列表,因为它能够高效处理复杂的关系和查询。

然而,我们意识到这种方法引入了架构复杂性,因为应用程序需要与两种不同类型的数据库交互,并在它们之间管理数据一致性。

在Identity微服务中同时使用SQL Server和Neo4j的实际经验或系统示例有吗?在架构、性能、数据一致性和运维复杂性方面,我们应该考虑哪些关键因素?

对于架构、性能、数据一致性和运维复杂性,您应该考虑的关键因素是什么?

英文:

I am currently developing a .NET Core application based on a microservices architecture. As part of this, we are designing an Identity microservice for user authentication and authorization.

We're considering a polyglot persistence approach, specifically using SQL Server for user profile data, given its strong support for structured data and ACID transactions, and Neo4j for managing complex relationships and access control lists, given its ability to handle complex relationships and queries efficiently.

However, we're aware that this approach introduces architectural complexity, as the application would need to interact with two different types of databases and manage data consistency across them.

Do you have any real-world experience or examples of systems that use both SQL Server and Neo4j for an Identity microservice? What are the key considerations we should take into account in terms of architecture, performance, data consistency, and operational complexity?

Any advice, lessons learned, or pointers to relevant resources would be greatly appreciated.

答案1

得分: 0

如果你添加SQL Server到你的解决方案中的唯一(或主要)原因是ACID事务,我建议放弃它,坚持使用Neo4j,因为它符合ACID标准,你可以同时拥有最佳的两个世界(用于相应SQL列的节点属性和图数据库的关系),而且避免了你提到的复杂性。一致性在相同的数据库管理系统和数据类型下已经很困难,如果加入其他类型,管理和扩展会变得非常困难。

英文:

If the reason for you to add SQL Server to your solution is only (or mainly) ACID transactions, I'd recommend to ditch it and stick with Neo4j as it is ACID compliant and you would have the best of both worlds (node properties for your respective SQL columns and relationships from a Graph DB), without the complexity you mentioned.
Consistency is hard enough with same DBMS and data types. If you add other types in the mix, it can get really hard to manage and scale.

答案2

得分: 0

绝对可以,将SQL Server和Neo4j结合在微服务架构中的身份微服务中,可以兼顾结构化数据管理和高效的复杂关系处理。

要成功采用这种方法,请首先明确定义每个数据库的数据范围 - 利用SQL Server存储用户资料和敏感信息,而Neo4j可用于管理复杂关系和访问控制列表。

英文:

Absolutely, combining SQL Server and Neo4j for an Identity microservice within a microservices architecture can provide the best of both worlds - structured data management and efficient complex relationship handling.

To navigate this approach successfully, start by clearly defining the scope of data for each database - utilize SQL Server for storing user profiles and sensitive information, while Neo4j can be leveraged for managing intricate relationships and access control lists.

huangapple
  • 本文由 发表于 2023年5月18日 01:38:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/76274804.html
匿名

发表评论

匿名网友

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

确定