Optimized storage – time based - multi writes

Front Door
App Service
Functions
Cosmos DB
Table Storage

This architecture uses multiple storage services to optimize storage performance and cost. Azure Cosmos DB holds recent data, and provides availability, performance, and resiliency. Azure Table Storage holds all data, both recent and historical, providing cost-effective storage for the historical data. The native Azure Storage replication capabilities replicate the Azure Cosmos DB data to other regions. The Azure Table Storage data must be replicated also, using either native replication or Azure Data Factory. Periodically, Azure Data Factory deletes historical data from Azure Cosmos DB to reduce costs.

In the scenario, the application generates 3TB of data each month, with three months of data stored in Azure Cosmos DB for high availability and performance. The application data is also written to Azure Table storage in the primary region, where it may subsequently be duplicated to another Azure region using Azure Data Factory. To keep storage costs low, any data that is more than three months old is erased from Azure Cosmos DB.

Other benefits of this approach includes additional resiliency against individual storage service failures and enabling request classification based on their criticality to use the appropriate storage services.

This technique is especially useful in scenarios when you're re-platforming your storage technology to make sure that the system will continue to perform as expected during the migration phase.

Potential use cases

The architecture may be appropriate for any application that uses massive amounts of data that must always be available. Examples include apps that:

  • Track customer spending habits and shopping behavior.
  • Forecast weather.
  • Offer smart traffic systems or implement smart traffic systems or use smart technology to monitor traffic.
  • Analyze manufacturing Internet of Things (IoT) data.
  • Display smart meter data or use smart technology to monitor meter data.

Architecture

Architecture of a resilient system that uses two types of storage to reduce costs.

Download a Visio file of this architecture.

  1. The client authenticates with Azure Active Directory (Azure AD) and is granted access to web applications hosted on Azure App Service.
  2. Azure Front Door, a firewall and layer 7 load balancer, switches user traffic to a different Azure region in case of a regional outage.
  3. Azure App Service hosts websites and RESTful web APIs. Browser clients run AJAX applications that use the APIs.
  4. Web APIs delegate function apps to handle background tasks. The tasks are queued in Azure Queue Storage queues.
  5. The function apps hosted by Azure Functions perform the background tasks, triggered by the queued messages. The function apps update both Azure Cosmos DB and Table Storage.
  6. Azure Cache for Redis caches database data for the function apps. This offloads database activity and speeds up the function apps and web apps.
  7. Azure Cosmos DB holds 3 to 4 months of the most recent data used by the web applications.
  8. Table Storage holds historical data used by the web applications.
  9. Every three months, Azure Data Factory deletes old data from Azure Cosmos DB to reduce storage costs. The data remains in Table Storage.

Components

  • Azure Active Directory (Azure AD) is a multi-tenant identity and access management service that can synchronize with an on-premises directory.
  • Azure DNS is a high-availability hosting service for DNS domains that provides apps with fast DNS queries and quick updates to DNS records. Managing Azure DNS is like managing other Azure services, and uses the same credentials, APIs, tools, and billing.
  • Azure Front Door is a secure content delivery network (CDN) and load balancer with instant failover. It operates at the edge close to users, accelerating content delivery while protecting apps, APIs, and websites from cyber threats.
  • Azure App Service is a fully managed service for building, deploying, and scaling web apps. You can build apps using .NET, .NET Core, Node.js, Java, Python, or PHP. Apps can run in containers or on Windows or Linux. In a mainframe migration, the front-end screens or web interface can be coded as HTTP-based REST APIs. They can be segregated and can be stateless to orchestrate a microservices-based system. For more information on web APIs, see RESTful web API design.
  • Azure Functions provides an environment for running small pieces of code, called functions, without having to establish an application infrastructure. You can use it to process bulk data, integrate systems, work with IoT, and build simple APIs and microservices. With microservices, you can create servers that connect to Azure services and are always up to date.
  • Azure Storage is a set of massively scalable and secure cloud services for data, apps, and workloads. It includes Azure Files, Azure Table Storage, and Azure Queue Storage. Azure Files is often an effective tool for migrating mainframe workloads.
  • Azure Queue Storage provides simple, cost-effective, durable message queueing for large workloads.
  • Azure Table Storage is a NoSQL key-value store for rapid development that uses massive semi-structured datasets. The tables are schemaless and adapt readily as needs change. Access is fast and cost-effective for many types of applications, and typically costs less than other types of keyed storage.
  • Azure Cache for Redis is a fully managed in-memory caching service and message broker for sharing data and state among compute resources. It includes both the open-source Redis and a commercial product from Redis Labs as managed services. You can improve performance of high-throughput online transaction processing applications by designing them to scale and to make use of an in-memory data store such as Azure Cache for Redis.
  • Azure Cosmos DB is a globally distributed, multi-model database that enables your solutions to scale throughput and storage across any number of geographic regions. Comprehensive service level agreements (SLAs) guarantee throughput, latency, availability, and consistency.
  • Azure Data Factory is a managed service that orchestrates and automates data movement and data transformation.

Alternatives

  • Azure Traffic Manager directs incoming DNS requests across the global Azure regions based on your choice of traffic routing methods. It also provides automatic failover and performance routing.
  • Azure Content Delivery Network (CDN) caches static content in edge servers for quick response, and uses network optimizations to improve response for dynamic content. CDN is especially useful when the user base is global.
  • Azure Kubernetes Service (AKS) is a fully managed Kubernetes service for deploying and managing containerized applications. You can use it to implement a microservices architecture whose components scale independently on demand.
  • Azure Container Instances provides a quick and simple way to run tasks without having to manage infrastructure. It's useful during development or for running unscheduled tasks.
  • Azure Service Fabric is a platform for scaling and orchestrating containers and microservices.
  • Azure Service Bus is a reliable cloud messaging service for simple hybrid integration. It can be used instead of Queue Storage in this architecture. For more information, see Storage queues and Service Bus queues - compared and contrasted.

Considerations

  • Application developers must implement multi-writes to both data stores. This may complicate the implementation and management of the overall application.
  • You need to configure Azure Data Factory to delete data based on timestamps from Azure Cosmos DB. Make sure that you have a timestamp column defined in every entity.
  • You can use native replication capabilities of Table Storage to simplify the architecture, but it will limit you to specific Azure regions that support Table replication.

Next steps