Mastering ServiceStack
eBook - ePub

Mastering ServiceStack

Andreas Niedermair

Compartir libro
  1. 216 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Mastering ServiceStack

Andreas Niedermair

Detalles del libro
Vista previa del libro
Índice
Citas

Información del 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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Mastering ServiceStack un PDF/ePUB en línea?
Sí, puedes acceder a Mastering ServiceStack de Andreas Niedermair en formato PDF o ePUB, así como a otros libros populares de Informatica y Programmazione open source. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2015
ISBN
9781783986583
Edición
1
Categoría
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...

Índice