Mastering ServiceStack
eBook - ePub

Mastering ServiceStack

Andreas Niedermair

Condividi libro
  1. 216 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Mastering ServiceStack

Andreas Niedermair

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

Utilize ServiceStack as the rock solid foundation of your distributed system

About This Book

  • Take advantage of the various data providers to access authentication and authorization, sessions, cache, and database
  • Leverage asynchronous processing for decoupling components to ease scaling
  • Monitor and tune the performance of your distributed system

Who This Book Is For

Mastering ServiceStack is targeted at developers who have already implemented web services with ASMX, WCF, or ServiceStack and want to gain more insight into the possibilities ServiceStack has to offer to build distributed systems of all scales.

What You Will Learn

  • Design a prudent and resilient API, following the RESTful design
  • Understand the internal processing chain and utilize the provided hooks
  • Incorporate ServiceStack as a full service provider to your existing distributed system
  • Leverage the power of asynchronous processing and add message queues to your architecture
  • Analyze and tune the performance of your service

In Detail

Mastering ServiceStack covers real-life problems that occur over the lifetime of a distributed system and how to solve them by deeply understanding the tools of ServiceStack. Distributed systems is the enterprise solution that provide flexibility, reliability, scaling, and performance. ServiceStack is an outstanding tool belt to create such a system in a frictionless manner, especially sophisticated designed and fun to use.

The book starts with an introduction covering the essentials, but assumes you are just refreshing, are a very fast learner, or are an expert in building web services. Then, the book explains ServiceStack's data transfer object patterns and teach you how it differs from other methods of building web services with different protocols, such as SOAP and SOA. It also introduces more low-level details such as how to extend the User Auth, message queues and concepts on how the technology works.

By the end of this book, you will understand the concepts, framework, issues, and resolutions related to ServiceStack.

Style and approach

A step-by-step approach that follows the natural requirements of a distributed system in a conversational style.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Mastering ServiceStack è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Mastering ServiceStack di Andreas Niedermair in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Informatica e Programmazione open source. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2015
ISBN
9781783986583
Edizione
1
Argomento
Informatica

Mastering ServiceStack


Table of Contents

Mastering ServiceStack
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Distributed Systems and How ServiceStack Jumps in
A message-based service
The processing chains of ServiceStack
HTTP context
Message Queue context
A brief history of distributed systems
The design principles of an API
Usage convenience
Documentation
Consistency
Robustness
Authentication, authorization, and security
Problems with distributed systems
Complexity in design
A broader set of skills
Testing
Rollout
Operating overhead
Tracing
Contracts
Issues at runtime
(Un)atomicity of operations
A shared register
Performance
Summary
2. ServiceStack as Your Unique Point of Access
The IoC container
Registering dependencies
Resolving dependencies
Lifetime of objects
Disposal of objects
Initialization of instances
Custom IoC frameworks
Incorporating the IoC container in your application
The Ticket application
Domain design
The ticket model
The comment model
RESTful design
The TicketService API
The CommentService API
Data access
Functional contract testing
Sessions
Session sharing between your service and a web application
Using the ServiceStack session
Using the ASP.NET session
Cache
Caching session data
Caching responses
Authentication and authorization
Authentication providers
Authentication repository
Limiting access
Processing chain
Adding authentication and authorization to the Ticket application
Extending authentication and authorization
Sliding authentication
Extending the authentication session
Customizing the user entity
Authentication events
Creating a custom authentication provider
Provide credentials in RequestDTOs
Authorization information in the HTTP header
Summary
3. Asynchronous Communication between Components
In Memory MQ
RCON
RedisMQ
Setup
Client managers
Queues
Replying directly back to the producer
Integrate a RedisMQ client into your service
RabbitMQ
Setup
Processing chain
Replying directly back to the producer
Broadcasting a message
Integrate RabbitMQ into your service
Server-sent events
Sending messages from the server
Hooks at the client-side
Subscription events
Receiving messages
Sending messages
Server-side usage of server-sent events
Receiving messages
Sending messages
Configure ServerEventsFeature
Redis server events
Look left and right
Authentication
Filtering requests and responses
Statistics
Summary
4. Analyzing and Tuning a Distributed System
Request logging
Using another data store for your request log entries
Centralizing request logging
Tracking requests of your website
Profiling requests
Profiling self-hosted requests
Profiling database requests
Adding custom steps for fine-grained profiling
Centralizing request profiling
Minimizing the footprint of HTTP requests
Batching requests
Customizing automatic batching
Implementing a RequestDTO to represent a collection
Compressing requests
Compressing responses
Adding MessagePack format
Adding Protobuf format
Accessing information provided by RequestInfoFeature
Summary
5. Documentation and Versioning
Metadata page
Extending the documentation of an operation
Configuring the Metadata page
Customizing templates
HtmlFormat.html
IndexOperations.html
OperationControl.html
Type generator
Querying your service with Swagger
Querying your service with Postman
Versioning requests
Validating your requests
Querying the registered ValdationRules with an API
Summary
6. Extending ServiceStack
Writing your own plugin
Intercepting requests and responses
Registering new services and endpoints
Summary
Index

Mastering ServiceStack

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2015
Production reference: 1211015
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-658-3
www.packtpub.com

Credits

Author
Andreas Niedermair
Reviewers
Stephane Belkheraz
Herdy Handoko
Emad Karamad
Dony Perdana
Cory Taylor
Commissioning Editor
Kunal Parikh
Acquisition Editor
Kevin Colaco
Content Development Editor
Zeeyan Pinheiro
Technical Editor
Saurabh Malhotra
Copy Editor
Sneha Singh
Project Coordinator
Suzanne Coutinho
Proofreader
Safis Editing
Indexer
Priya Sane
Production Coordinator
Nitesh Thakur
Cover Work
Nitesh Thakur

About the Author

Andreas Niedermair is a .NET developer who is rooted in the web fraction (and still affiliated with it). He has worked in numerous enterprise environments building leading industry solutions and has also contributed to the open source community. He is always striving for a deeper understanding of technology to stay on the cutting edge.
He contributed to the ServiceStack 4 Cookbook as a technical revi...

Indice dei contenuti