万本电子书0元读

万本电子书0元读

顶部广告

Microservices with Clojure电子书

售       价:¥

3人正在读 | 0人评论 9.8

作       者:Anuj Kumar

出  版  社:Packt Publishing

出版时间:2018-01-25

字       数:43.3万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
The common patterns and practices of the microservice architecture and their application using the Clojure programming language. About This Book ? Relevance of the microservice architecture and benefits of Clojure's functional and simple features to implement it. ? Learn best practices and common principles to avoid common pitfalls while developing microservices. ? Learn how to use Pedestal to build your next microservices, secure them using JWT, and monitor them using the ELK stack Who This Book Is For You should have a working knowledge of programming in Clojure. However, no knowledge of RESTful architecture, microservices, or web services is expected. If you are looking to apply techniques to your own projects, taking your first steps into microservice architecture, this book is for you. What You Will Learn ? Explore the pros and cons of monolithic and microservice architectures ? Use Clojure to effectively build a reallife application using Microservices ? Gain practical knowledge of the Clojure Pedestal framework and how to use it to build Microservices ? Explore various persistence patterns and learn how to use Apache Kafka to build event-driven microservice architectures ? Secure your Microservices using JWT ? Monitor Microservices at scale using the ELK stack ? Deploy Microservices at scale using container orchestration platforms such as Kubernetes In Detail The microservice architecture is sweeping the world as the de facto pattern with which to design and build scalable, easy-tomaintain web applications. This book will teach you common patterns and practices, and will show you how to apply these using the Clojure programming language. This book will teach you the fundamental concepts of architectural design and RESTful communication, and show you patterns that provide manageable code that is supportable in development and at scale in production. We will provide you with examples of how to put these concepts and patterns into practice with Clojure. This book will explain and illustrate, with practical examples, how teams of all sizes can start solving problems with microservices. You will learn the importance of writing code that is asynchronous and non-blocking and how Pedestal helps us do this. Later, the book explains how to build Reactive microservices in Clojure that adhere to the principles underlying the Reactive Manifesto. We finish off by showing you various ways to monitor, test, and secure your microservices. By the end, you will be fully capable of setting up, modifying, and deploying a microservice with Clojure and Pedestal. Style and approach This book highlights the merits of the microservice architecture and its implementation with Clojure. Learn to implement microservices by migrating a monolithic application to a microservice-based architecture.
目录展开

Title Page

Copyright and Credits

Microservices with Clojure

Dedication

Packt Upsell

Why subscribe?

PacktPub.com

Contributors

About the author

About the reviewer

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Conventions used

Get in touch

Reviews

Monolithic Versus Microservices

Dawn of application architecture

Monolithic architecture

Microservices

Data management

When to use what

Monolithic applications to microservices

Identifying candidates for microservices

Release cycle and the deployment process

Summary

Microservices Architecture

Domain-driven design

Bounded context

Identifying bounded contexts

Organizing around bounded contexts

Components

Hexagonal architecture

Messaging and contracts

Direct messaging

Observer model

Service contracts

Service discovery

Service registry

Service discovery patterns

Data management

Direct lookup

Asynchronous events

Combining data

Transactions

Automated continuous deployment

CI/CD

Scaling

Summary

Microservices for Helping Hands Application

Design

Users and entities

User stories

Domain model

Monolithic architecture

Application components

Deployment

Limitations

Moving to microservices

Isolating services by persistence

Isolating services by business logic

Messaging and events

Extensibility

Workflows for Helping Hands

Service provider workflow

Service workflow

Service consumer workflow

Order workflow

Summary

Development Environment

Clojure and REPL

History of Clojure

REPL

Clojure build tools

Leiningen

Boot

Clojure project

Configuring a project

Running a project

Running tests

Generating reports

Generating artifacts

Clojure IDE

Summary

REST APIs for Microservices

Introducing REST

RESTful APIs

Status codes

Naming conventions

Using RESTful APIs via cURL

REST APIs for Helping Hands

Consumer and Provider APIs

Service and Order APIs

Summary

Introduction to Pedestal

Pedestal concepts

Interceptors

The interceptor chain

Importance of a Context Map

Creating a Pedestal service

Using interceptors and handlers

Creating routes

Declaring routers

Accessing request parameters

Creating interceptors

Handling errors and exceptions

Logging

Publishing operational metrics

Using chain providers

Using server-sent events (SSE)

Creating interceptors for SSE

Using WebSockets

Using WebSocket with Pedestal and Jetty

Summary

Achieving Immutability with Datomic

Datomic architecture

Datomic versus traditional database

Development model

Data model

Schema

Using Datomic

Getting started with Datomic

Connecting to a database

Transacting data

Using Datalog to query

Achieving immutability

Deleting a database

Summary

Building Microservices for Helping Hands

Implementing Hexagonal Architecture

Designing the interceptor chain and context

Creating a Pedestal project

Defining generic interceptors

Interceptor for Auth

Interceptor for the data model

Interceptor for events

Creating a microservice for Service Consumer

Adding routes

Defining the Datomic schema

Creating a persistence adapter

Creating interceptors

Testing routes

Creating a microservice for Service Provider

Adding routes

Defining Datomic schema

Creating a persistence adapter

Creating interceptors

Testing routes

Creating a microservice for Services

Adding routes

Defining a Datomic schema

Creating a persistence adapter

Creating interceptors

Testing routes

Creating a microservice for Order

Adding routes

Defining Datomic schema

Creating a persistence adapter

Creating interceptors

Testing routes

Creating a microservice for Lookup

Defining the Elasticsearch index

Creating query interceptors

Using geo queries

Getting status with aggregation queries

Creating a microservice for alerts

Adding routes

Creating an email interceptor using Postal

Summary

Configuring Microservices

Configuration principles

Defining configuration parameters

Using configuration parameters

Using Omniconf for configuration

Enabling Omniconf

Integrating with Helping Hands

Managing application states with mount

Enabling mount

Integrating with Helping Hands

Summary

Event-Driven Patterns for Microservices

Implementing event-driven patterns

Event sourcing

Using the CQRS pattern

Introduction to Apache Kafka

Design principles

Getting Kafka

Using Kafka as a messaging system

Using Kafka as an event store

Using Kafka for Helping Hands

Using Kafka APIs

Initializing Kafka with Mount

Integrating the Alert Service with Kafka

Using Avro for data transfer

Summary

Deploying and Monitoring Secured Microservices

Enabling authentication and authorization

Introducing Tokens and JWT

Creating an Auth service for Helping Hands

Using a Nimbus JOSE JWT library for Tokens

Creating a secret key for JSON Web Encryption

Creating Tokens

Enabling users and roles for authorization

Creating Auth APIs using Pedestal

Monitoring microservices

Using ELK Stack for monitoring

Setting up Elasticsearch

Setting up Kibana

Setting up Logstash

Using ELK Stack with Collectd

Logging and monitoring guidelines

Deploying microservices at scale

Introducing Containers and Docker

Setting up Docker

Creating a Docker image for Helping Hands

Introducing Kubernetes

Getting started with Kubernetes

Summary

Other Books You May Enjoy

Leave a review - let other readers know what you think

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部