简体   繁体   中英

C# WebAPI with Neo4j - Best Practice for Database connection?

this question is more about architecture than syntax. I am building a WebAPI project in C# and I am using NEo4j, not SQL. It seems to me I will be bypassing Entity Framework and any ORM and going directly to the DB (Is this assumption wrong?) I am using the Neo4j library here . I anticipate a very high volume of traffic to the DB a vast majority of the traffic will be writes. Where is the best place to create my connection object within the MVC framework so I can limit the number of times I call client.connect()? Thanks!

I ultimately decided to use a helper class for GET web service calls and a cache between the Web Services and the DB. For POST web service calls I have implemented a Message queue and separate "DB Loader" service. The lack of ORM has not had an effect on the project and using asynchronous method calls to the helper class and queue seem to have kept the performance at acceptable levels.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM