U.3 Storage

0 views
Skip to first unread message

Noah Casanova

unread,
Aug 3, 2024, 6:12:23 PM8/3/24
to sungattresra

The Storage interface of the Web Storage API provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items.

Here we access a Storage object by calling localStorage. We first test whether the local storage contains data items using !localStorage.getItem('bgcolor'). If it does, we run a function called setStyles() that grabs the data items using Storage.getItem() and uses those values to update page styles. If it doesn't, we run another function, populateStorage(), which uses Storage.setItem() to set the item values, then runs setStyles().

Amazon Simple Storage Service (Amazon S3) is an object storage service offering industry-leading scalability, data availability, security, and performance. Millions of customers of all sizes and industries store, manage, analyze, and protect any amount of data for virtually any use case, such as data lakes, cloud-native applications, and mobile apps. With cost-effective storage classes and easy-to-use management features, you can optimize costs, organize and analyze data, and configure fine-tuned access controls to meet specific business and compliance requirements.

A data lake is a centralized repository that allows you to store all your structured and unstructured data at any scale. You can run data analytics, artificial intelligence (AI), machine learning (ML), and high-performance computing (HPC) applications to unlock the value of your data.

Meet your recovery time objective (RTO), recovery point objective (RPO), and compliance requirements with S3's robust replication functionality, data protection with AWS Backup, and various AWS Partner Network solutions.

Because Amazon S3 stores more than 350 trillion objects (exabytes of data) for virtually any use case and averages over 100 million requests per second, it may be the starting point of your generative AI journey.

Amazon S3 stores data as objects within buckets. An object is a file and any metadata that describes the file. A bucket is a container for objects. To store your data in Amazon S3, you first create a bucket and specify a bucket name and AWS Region. Then, you upload your data to that bucket as objects in Amazon S3. Each object has a key (or key name), which is the unique identifier for the object within the bucket.

S3 provides features that you can configure to support your specific use case. For example, you can use S3 Versioning to keep multiple versions of an object in the same bucket, which allows you to restore objects that are accidentally deleted or overwritten. Buckets and the objects in them are private and can only be accessed with explicitly granted access permissions. You can use bucket policies, AWS Identity and Access Management (IAM) policies, S3 Access Points, and access control lists (ACLs) to manage access.

The second section has an illustration of an empty bucket. The second section is titled "Amazon S3." The second section says, "Object storage built to store and retrieve any amount of data from anywhere."

The second section has more text under the heading "Store data." The text says, "Create bucket, specify the Region, access controls, and management options. Upload any amount of data." A nearby illustration shows a bucket that contains a square, a circle, and a triangle.
The second section also has icons that show Amazon S3 features. The features are "Control access to data," "Optimize cost with storage classes," "Replicate data to any Region," "Access from on-premises or VPC," "Protect and secure your data," and "Gain visibility into your storage."

The third section is titled "Analyze data." The third section says, "Use AWS and third-party services to analyze your data to gain insights." Nearby icons show ways of analyzing data: "artificial intelligence (AI)," "advanced analytics," and "machine learning (ML)."

Upload, download, and manage Azure Storage blobs, files, queues, and tables, as well as Azure Data Lake Storage entities and Azure managed disks. Configure storage permissions and access controls, tiers, and rules.

Efficiently connect and manage your Azure storage service accounts and resources across subscriptions and organizations. Create, delete, view, edit, and manage resources for Azure Storage, Azure Data Lake Storage, and Azure managed disks.

Save time and simplify your workflow by previewing data directly in Storage Explorer. View text data with rich formatting for JSON, view PDF documents, and browse images without having to download files to your computer.

Customize Azure Storage Explorer to meet your needs. For example, use the Azure Data Factory extension to move data from other cloud storage services, such as AWS S3, to Azure Storage. Add the Azure App Configuration extension to your storage explorer to manage your application settings and feature flags in one place.

Seamlessly view, search, and interact with your data and resources using an intuitive interface. Improved accessibility with multiple screen reader options, high contrast themes, and hot keys on Windows and macOS.

The Storage API provides an extension-specific way to persist user data and state. It's similar to the web platform's storage APIs (IndexedDB, and Storage), but was designed to meet the storage needs of extensions. The following are a few key features:

We can take this idea even further. In this example, we have an options page thatallows the user to toggle a "debug mode" (implementation not shown here). The options page immediately saves the new settings to storage.sync, and the service worker uses storage.onChanged to apply the setting as soon as possible.

Because service workers don't run all the time, Manifest V3 extensions sometimes need toasynchronously load data from storage before they execute their event handlers. To do this, thefollowing snippet uses an async action.onClicked event handler that waits for the storageCacheglobal to be populated before executing its logic.

Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility. You cannot use both on the same function call. The promise resolves with the same type that is passed to the callback.

A single key to get, list of keys to get, or a dictionary specifying default values (see description of the object). An empty list or object will return an empty result object. Pass in null to get the entire contents of storage.

Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to , with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation).

The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError when using a callback, or a rejected Promise if using async/await.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages