title | description | author | ms.date | uid |
---|---|---|---|---|
Microsoft SQL Server Database Provider - Memory-Optimized Tables - EF Core |
How to use Memory-Optimized Tables with the SQL Server Entity Framework Core Database Provider |
AndriySvyryd |
11/05/2019 |
core/providers/sql-server/memory-optimized-tables |
Memory-Optimized Tables are a feature of SQL Server where the entire table resides in memory. A second copy of the table data is maintained on disk, but only for durability purposes. Data in memory-optimized tables is only read from disk during database recovery. For example, after a server restart.
You can specify that the table an entity is mapped to is memory-optimized. When using EF Core to create and maintain a database based on your model (either with migrations or EnsureCreated), a memory-optimized table will be created for these entities.
[!code-csharpIsMemoryOptimized]