You are previewing Building Web, Cloud, and Mobile Solutions with F#.

Building Web, Cloud, and Mobile Solutions with F#

Cover of Building Web, Cloud, and Mobile Solutions with F# by Daniel Mohl Published by O'Reilly Media, Inc.
  1. Building Web, Cloud, and Mobile Solutions with F#
  2. Preface
    1. Who This Book Is For
    2. Getting Set Up to Run the Examples
    3. How This Book Is Organized
    4. Conventions Used in This Book
    5. Using Code Examples
    6. Safari® Books Online
    7. How to Contact Us
    8. Acknowledgments
  3. 1. Building an ASP.NET MVC 4 Web Application with F#
    1. The F# ASP.NET MVC 4 Project Templates
      1. Finding and Installing the Templates
      2. Exploring the C# Project
      3. Dissecting the F# Project
    2. F# Controllers and Models
      1. Controllers
      2. Models
    3. Interacting with a Database
      1. Entity Framework
      2. Querying the Data
      3. Querying with Type Providers
    4. Taking Advantage of F#
      1. Moving to a More Functional Approach
      2. Understanding Pipelining and Partial Function Application
      3. Making the Controller More Functional
      4. Simplification with Pattern Matching
    5. Related Advanced Topics and Concepts
      1. Improving Responsiveness with Async Workflows
      2. Caching with MailboxProcessor
      3. Jumping on the Message Bus
      4. Continuation-Passing Style
      5. Creating a Custom Computation Expression
    6. Summary
  4. 2. Creating Web Services with F#
    1. Installing the Existing WCF Project Template
    2. Exploring the Output Code
      1. Consuming the Service
      2. Diving into Records
    3. Building an ASP.NET Web API Service
      1. Analyzing the Template
      2. Interacting with the HTTP Service
    4. Exploring Other Web Frameworks
      1. Service Stack
      2. Nancy
      3. Frank
    5. Testing Your Creation
      1. Getting Set Up
      2. Improving Tests with F#
      3. FsUnit
      4. Unquote
      5. NaturalSpec
    6. Summary
  5. 3. To the Cloud! Taking Advantage of Azure
    1. Building and Hosting F# on Azure
    2. Creating an F# Worker Role
    3. Introducing Fog
    4. Interacting with Azure Storage Options
      1. Blobs
      2. Tables
      3. Queue Storage
      4. SQL Azure
    5. Taking Advantage of the Azure Service Bus
      1. Queues
      2. Topics
    6. Exploring Authentication and Authorization
      1. Authentication and Authorization with ACS
      2. Claims-based Authentication
      3. Claims-based Authorization
    7. Building for Scalability
      1. Building the Web Role
      2. Understanding the PlaceOrderCommand
      3. On to the Worker Roles
      4. Wrapping Up the SQL Azure Worker Role
      5. Adding the Finishing Touches
      6. Caching
      7. CDN and Autoscaling
    8. Shining F# Examples
      1. {m}brace
      2. Cloud Numerics
      3. Framework for .NET Hadoop MapReduce
    9. Summary
  6. 4. Constructing Scalable Web and Mobile Solutions
    1. Scaling with Web Sockets
      1. Building a Web Socket Example with .NET 4.5 and IIS 8
      2. Creating a Web Socket Server with Fleck
    2. Using SignalR
      1. Building a Persistent Connection Example
      2. A JavaScript Client
      3. An F# Client
      4. Constructing a Hub Example
    3. Going Mobile
      1. The jQuery Mobile Approach
      2. Adding Windows Phone
    4. Combining F# and NoSQL
      1. MongoDB
      2. RavenDB
      3. CouchDB
    5. Summary
  7. 5. Functional Frontend Development
    1. Setting the Stage
    2. Looking at LiveScript
      1. Benefits
      2. Usage
      3. Example
    3. Exploring Pit
      1. Benefits
      2. Usage
      3. Example
    4. Diving into WebSharper
      1. Benefits
      2. Usage
      3. Example
    5. Summary
  8. A. Useful Tools and Libraries
    1. FAKE (F# Make)
    2. NuGet
      1. Basic Usage
      2. Useful NuGet Packages
    3. ExpectThat
  9. B. Useful Websites
    3. Visual Studio Gallery
  10. C. Client-Side Technologies That Go Well with F#
    1. CoffeeScript
    2. Sass
    3. Underscore.js
  11. Index
  12. About the Author
  13. Colophon
  14. Copyright

Chapter 3. To the Cloud! Taking Advantage of Azure

The future is here, it’s just not evenly distributed yet.

William Gibson

The Preface of this book mentioned that technology is consistently trending towards economies of scale combined with efficient, scalable, and highly available solutions that are intended to be consumable from any modern computing device the user might be utilizing at the time. When it comes to achieving this goal, Windows Azure is a major enabler. The cloud is the future, and platforms such as Windows Azure are helping to evenly distribute it.

It’s easy to see the appeal of Windows Azure. The start-up and operational costs are less than they are with on-premises setups, you no longer have to worry about hardware upkeep, and you can reuse much of your existing development knowledge. That being said, there are a few differences that you must consider when architecting and building solutions for the cloud. Most notably, you must design for scaling across a quantity of commodity servers (i.e., scaling out) rather than seeking to build for environments that primarily scale up. F# is perfect for building this type of solution.

In this chapter I’ll walk you through creating and deploying F# solutions for the cloud. I’ll also show you how to communicate with other roles in your solution and how to harness several of the features that Windows Azure provides. Lastly, I’ll showcase a few of the great F# libraries and frameworks that have been built specifically to take advantage ...

The best content for your career. Discover unlimited learning on demand for around $1/day.