I have a simple web app in ASP.NET MVC which uses Sql CE for the backend database, using EF. Everything works fine, except that I'd like to keep a log of impressions for users hitting an api in the app- I get enough requests that it crashes the server. I've tried a couple options which do not perform well enough and I had to disable them. I'm keying off a user id in the database which has a unique index on it.
-in all cases, if the member doesn't exist in the db, a new record is created and saved.
in v1, look up member in db, increment an impression counter, save the record back. This was way too slow and crashed the server.
in v2, I simply checked if the record existed and create it. if it exists, I do nothing. This is still too slow, but faster than v1.
I'm looking into keeping an in-memory db for this next, and store it out to sql ce occasionally. My concern is, will this still not work if I store up 1000 items in a few seconds, and then try to store them in a single update? It feels like sql ce may just not be capable of doing what I need at all, or am I overlooking some simple performance optimization?