locked
EF Core: InMemory database only usable for testing? RRS feed

  • Question

  • User-1676113967 posted

    Hey everyone,

    I'm going to develop a web API with CosmosDB as a database but I have to keep the usage low because of the high pricing. At the moment I'm going to use EF Core to control my data collections and that's how I learned about the option to run a database in the memory of the application itself.

    According to the documentation it is just for testing purposes meant but it is never explained why. Is it possible for me to use it as an in memory database to hold relevant data so I only have to write to the CosmosDB database as few as possible? This way of working would spare me a lot of money.

    Wednesday, February 20, 2019 12:42 PM

All replies

  • User197322208 posted

    For example, EF in memory does not have Stored Procedures . See more limitations at https://docs.microsoft.com/en-us/ef/core/miscellaneous/testing/in-memory 

    Wednesday, February 20, 2019 1:09 PM
  • User475983607 posted

    According to the documentation it is just for testing purposes meant but it is never explained why.

    The following doc covers in-memory DB limitations.

    https://docs.microsoft.com/en-us/ef/core/miscellaneous/testing/in-memory

    Wednesday, February 20, 2019 1:19 PM
  • User-1676113967 posted

    Is there any good way I could store data locally in my web application? So I don't have to make a lot of calls to my database?

    I know there is SQLite but CosmosDB is NoSQL so that won't work together very well...

    Wednesday, February 20, 2019 2:28 PM
  • User475983607 posted

    Is there any good way I could store data locally in my web application? So I don't have to make a lot of calls to my database?

    Doesn't this approach defeat the reason for using Cosmos DB in the first place?  Plus this approach introduces the risk of losing data.

    I know there is SQLite but CosmosDB is NoSQL so that won't work together very well...

    I don't understand why this is true since you'll need to write code to move the data.  Can you explain?

    Wednesday, February 20, 2019 3:12 PM