Giter VIP home page Giter VIP logo

demos-serverless-persistence's Introduction

Persistance in Serverless Applications

This repository contains demos for my talk: 'Persistence in Serverless Applications'.

The src folder contains an Azure Functions project (.NET 6 in-process) with the following HTTP triggered functions:

Name Binding Description
StorePlayerWithStreamBlobOutput Blob output Using Stream
StorePlayerWithStringBlobOutput Blob output Using string
StorePlayerWithStringBlobOutputDynamic Blob output Using IBinder (dynamic binding)
GetPlayerWithStreamBlobInput Blob input Using Stream
GetPlayerWithStringBlobInputDynamic Blob input Using IBinder (dynamic binding)
StorePlayerReturnAttributeTableOutput Table output Using return attribute
StorePlayersWithCollectorTableOutput Table output Using IAsyncCollector<PlayerEntity>
GetPlayerByRegionAndIdTableInput Table input Using PlayerEntity
GetPlayersByRegionTableClient Table input Using TableClient
StorePlayerCosmosOutput CosmosDB output Using the Player
StorePlayerReturnAttributeCosmosOutput CosmosDB output Using return attribute
StorePlayersWithCollectorCosmosOutput CosmosDB output Using IAsyncCollector<Player>
GetPlayerByRegionAndIdCosmosInput CosmosDB input Using Player
GetPlayersByRegionDocumentClientCosmosInput CosmosDB input Using DocumentClient
UpdatePlayerScore Durable Entity Uses Durable Functions

Running locally

Prerequisites

All VSCode extensions are automatically recommended to be installed when you open this folder in VSCode.

Running the Function App

  1. Clone this repo.
  2. Open the folder in VSCode.
  3. Install the recommended extensions.
  4. Ensure that a CosmosDB instance is present in either the cloud or the emulator with these settings:
    • Database: gamedb
    • Collection: players
    • PartitionKey: region
  5. Build the project to ensure that there are no errors:
    • Via the build task: CTRL/CMD+SHIFT+B or
    • Via the terminal in the src/ServerlessPersistence folder: dotnet build
  6. Start Azurite services:
    • Via the command palette: CRTL/CMD+SHIFT+P -> Azurite: Start
  7. Run the Function App:
    • Via the debug command: F5 or
    • Via the terminal in the src/ServerlessPersistence folder: func start.
  8. Now use the http files located in tst and a REST client to trigger the functions.

More info

If you want to learn more about Azure Functions, have a look at Azure Functions University, a free and open source curriculum on GitHub and YouTube.

Found a bug or want to ask a question? Feel free to raise an issue or submit a pull request. Or you can reach out to me on Twitter.

demos-serverless-persistence's People

Contributors

dependabot[bot] avatar marcduiker avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.