chronoxor / NetCoreServer

Ultra fast and low latency asynchronous socket server & client C# .NET Core library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
https://chronoxor.github.io/NetCoreServer
MIT License
2.81k stars 583 forks source link

TCP Server with Async Database Process #233

Open 3ddark opened 2 years ago

3ddark commented 2 years ago

Can you add an example of asynchronous database operation working with a TCP Socket Server?

How it works on Linux(Ubuntu 22.04). What is its performance? Will it be more efficient with only MSSQL? Will it be more efficient with PostgreSQL?

chronoxor commented 2 years ago

We use FluentMigrator to have a single database migration that builds DB scheme for any abstract DB (Oracle, MySQL, Postgres, SQLite, etc). We use PostgreSQL on stage & prod, SQLite for local development and CI/CD unit testing.

If you want to have a best performance in .NET you might choose raw ADO.NET and very simple CRUD queries and do very carefully with indexes design with query profiling. From the other way EF is quick for starting and support your data access layer.