How to store common data inside the application [closed] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
We have configuration data stored within the tables like casestatustypes with columns such as statusid, name, description. How to store these kind of data in the web application, instead of hitting the database each time for retrieving the statusid.

You use a technique known as caching. Basically, you build an in-memory copy of the data that you use for retrieval purposes. When you start the application, you pull from the database to create this cache. When you do an insert, update, or delete; you do it to both the cache and database.
Its easy enough to implement yourself, and there are several good libraries out there (Microsoft even has one in Enterprise Library http://msdn.microsoft.com/library/cc467894.aspx).
Gotchas:
If the data set is large, you'll want to implement a caching strategy that doesn't hold the entire dataset in memory (libraries are useful for this).
Since its a web-app, you need to make sure the cache isn't going to be re-created for each session.

Related

SQL - To load into memory, or to query database [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I'm interested in your opinions, best thoughts ...
Would you say it's better to just query the database any time you want to retrieve data (even if you know it'll be static), or store the data in server(web) session memory?
On the one hand, storing in memory would allow faster processing of data, and decrease SQL server loads. On the other hand, it can somewhat increase complication of application code, and web server/system resources.
The answer depends (as most do) on your specific needs. If your database has the bandwidth but your web server doesn't, you should do it in SQL. And vice versa. There's no way to recommend anything to anyone without knowing their situation.
You can use static dictionaries to store static data from database.
The benefit of use this is have only one instance of each dictionary and reduce the number of request to the database.
You can refer to this question to see how to implement this.

How to Implement Audit trial in ASP.NET MVC [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
We have developed an asp.net mvc application and is live for 2 years.
Now our client is asking for Audit Trail.
Requirement
Should be able to define which column / table needs to be audited
Should be able to create a report based on the same.
Below is our current scenario
We are using SQL Server 2012 as backend
Our data access layer communicated to DB only through Store Procedure.
We are not using any model binders.
What is the best way to implement audit trail in the current scenario?
Define the business scenarios that need to be audited.
Identify the code entry points where those scenarios happen
Design the audit data model based on what data you want/need to store
Write data in your audit table/tables on the previously identified code entry points
This answer is intentionally vague. Auditing is not something that ASP.NET or any framework can do for you. This is usually intimately related to your business logic code and requirements

Local files or remote server [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I've developed a desktop application(Accountant App). This application is going to import invoices data and do a lot of other things. All data will be stored on remote database (SQL Server). This app needs some 'pre loaded data' to work properly, like a list containing a bunch of cities etc. My question is: Is better to have this data (cities, states, zipcodes) stored in the remote database or is better to use xml, csv files and deploy them with each individual instance of the application? This data will be updated eventually. And this data will be used frequently by the users.
Well you can either use an external file or store them in the database. I think storing it in the database is the better approach since you won't have to distribute another extra file and all of your data will be at one place. Don't forget to seed the data every time you clear the database though.

how to pre load a read only database in asp.net [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have used fastcgi when a process starts up and then executes and serves results to a client. I used to preload a readonly database into memory during the start up and then use that to server results. The advantage being the data gets loaded and prepared only once and is readily available.
How can this be accomplished in ASP.NET technology without using an external database technology like memcached etc?
It depends on how complicated the database is, but if I needed to do this I would load the database into the application cache as datatables, within the global.asax application_startup method.

C# Saving Objects [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I want to be able to save several objects which are linked each other. Idea is to have a Client object, Project object, Work object which will interfere each other. All data within will be as string and int. Everything will be joined in Record Object in which I will choose values from mentions object plus adding new entries.
What would be the best way to save all into a file - serialization? Is it possible to do it with some kind of data base? So far it is recorded in Excel table.
Serialization is fast and compact way to do it, but with linq you have XML and XML serialization which is closer to what you are looking for :
http://msdn.microsoft.com/en-us/library/bb387098.aspx
To go further Linq was created to simplify database queries so by default you will be able to access any ODBC compatible database (sqLite MySQL etc...)
FYI : You can Edit XML and XML scheme with Excel (if that's the kind of things your're into)

Categories