Different Types of Data Storage


Data storage is an essential function for applications that want to monitor the progress of users, allow login, or perform other important functions. There are a variety of ways to store information about users however the most efficient solution depends on the problem you’re trying solve.

Local storage is a fantastic way to store small amounts of data, such as user registration and login information which do not require immediate sync. However, it is restricted by the size of the hard drive and is only used with code written by the client (and cannot be altered through server-side scripts). Local storage is also susceptible to losing data when the application is shut down, or the device reset.

Database storage is great for storing larger amounts of data that might need to be edited. It lets you keep track of the data of your users by saving their unique identifier into a database table and connecting that identifier to the database. This is more complex than other data storage options however it is suitable for enterprise or large-scale apps that require storage of the user’s data across multiple sessions.

WebView2 stores information about the browser using UDFs. This includes permissions, cookies, and cached resources. This data expires based upon the user’s Web & Application Activity settings. It can be cleared manually via actions on Google. To store additional user information you must define the user’s personal UDF location that has Write access to the WebView2. See the WinUI 3.cs file in the WebView2Samples repo for an example of how to do this with ICoreWebView2Environment7.