Microservices with Clojure : Develop Event-driven, Scalable, and Reactive Microservices with Real-time Monitoring 🔍
Anuj Kumar Packt Publishing - ebooks Account, Packt Publishing, Birmingham, UK, 2018
英语 [en] · PDF · 10.7MB · 2018 · 📘 非小说类图书 · 🚀/upload/zlib · Save
描述
The common patterns and practices of the microservice architecture and their application using the Clojure programming language. Key Features 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 Book Description 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. 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 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.
备用文件名
zlib/Computers/Other/Anuj Kumar/Microservices with Clojure: Develop event-driven, scalable, and reactive microservices with real-time monitoring_26994830.pdf
备选作者
Kumar, Anuj
备用出版商
Packt Publishing Limited
备用版本
United Kingdom and Ireland, United Kingdom
备用版本
Place of publication not identified, 2018
备用版本
Jan 25, 2018
元数据中的注释
producers:
mPDF 6.0
备用描述
Cover 1
Copyright and Credits 3
Dedication 4
Packt Upsell 5
Contributors 6
Table of Contents 8
Preface 14
Chapter 1: Monolithic Versus Microservices 19
Dawn of application architecture 20
Monolithic architecture 21
Microservices 23
Data management 25
When to use what 26
Monolithic applications to microservices 28
Identifying candidates for microservices 28
Release cycle and the deployment process 30
Summary 31
Chapter 2: Microservices Architecture 33
Domain-driven design 34
Bounded context 34
Identifying bounded contexts 35
Organizing around bounded contexts 36
Components 37
Hexagonal architecture 38
Messaging and contracts 39
Direct messaging 40
Observer model 41
Service contracts 43
Service discovery 44
Service registry 45
Service discovery patterns 46
Data management 47
Direct lookup 47
Asynchronous events 48
Combining data 49
Transactions 51
Automated continuous deployment 53
CI/CD 53
Scaling 56
Summary 56
Chapter 3: Microservices for Helping Hands Application 58
Design 59
Users and entities 59
User stories 60
Domain model 61
Monolithic architecture 63
Application components 63
Deployment 65
Limitations 65
Moving to microservices 67
Isolating services by persistence 67
Isolating services by business logic 68
Messaging and events 70
Extensibility 71
Workflows for Helping Hands 72
Service provider workflow 73
Service workflow 74
Service consumer workflow 75
Order workflow 76
Summary 78
Chapter 4: Development Environment 79
Clojure and REPL 80
History of Clojure 80
REPL 82
Clojure build tools 84
Leiningen 84
Boot 85
Clojure project 87
Configuring a project 88
Running a project 90
Running tests 91
Generating reports 91
Generating artifacts 93
Clojure IDE 93
Summary 94
Chapter 5: REST APIs for Microservices 95
Introducing REST 95
RESTful APIs 97
Status codes 98
Naming conventions 99
Using RESTful APIs via cURL 101
REST APIs for Helping Hands 104
Consumer and Provider APIs 104
Service and Order APIs 105
Summary 106
Chapter 6: Introduction to Pedestal 107
Pedestal concepts 108
Interceptors 109
The interceptor chain 110
Importance of a Context Map 112
Creating a Pedestal service 114
Using interceptors and handlers 116
Creating routes 118
Declaring routers 121
Accessing request parameters 122
Creating interceptors 124
Handling errors and exceptions 125
Logging 127
Publishing operational metrics 129
Using chain providers 131
Using server-sent events (SSE) 133
Creating interceptors for SSE 135
Using WebSockets 137
Using WebSocket with Pedestal and Jetty 138
Summary 142
Chapter 7: Achieving Immutability with Datomic 144
Datomic architecture 145
Datomic versus traditional database 145
Development model 146
Data model 147
Schema 148
Using Datomic 149
Getting started with Datomic 150
Connecting to a database 152
Transacting data 152
Using Datalog to query 154
Achieving immutability 156
Deleting a database 157
Summary 157
Chapter 8: Building Microservices for Helping Hands 158
Implementing Hexagonal Architecture 159
Designing the interceptor chain and context 159
Creating a Pedestal project 160
Defining generic interceptors 162
Interceptor for Auth 162
Interceptor for the data model 165
Interceptor for events 167
Creating a microservice for Service Consumer 167
Adding routes 168
Defining the Datomic schema 169
Creating a persistence adapter 169
Creating interceptors 172
Testing routes 176
Creating a microservice for Service Provider 178
Adding routes 179
Defining Datomic schema 179
Creating a persistence adapter 180
Creating interceptors 182
Testing routes 186
Creating a microservice for Services 188
Adding routes 188
Defining a Datomic schema 189
Creating a persistence adapter 190
Creating interceptors 192
Testing routes 196
Creating a microservice for Order 197
Adding routes 198
Defining Datomic schema 198
Creating a persistence adapter 199
Creating interceptors 202
Testing routes 206
Creating a microservice for Lookup 209
Defining the Elasticsearch index 211
Creating query interceptors 212
Using geo queries 214
Getting status with aggregation queries 215
Creating a microservice for alerts 217
Adding routes 217
Creating an email interceptor using Postal 218
Summary 220
Chapter 9: Configuring Microservices 221
Configuration principles 222
Defining configuration parameters 222
Using configuration parameters 222
Using Omniconf for configuration 223
Enabling Omniconf 223
Integrating with Helping Hands 224
Managing application states with mount 229
Enabling mount 230
Integrating with Helping Hands 231
Summary 234
Chapter 10: Event-Driven Patterns for Microservices 235
Implementing event-driven patterns 236
Event sourcing 237
Using the CQRS pattern 238
Introduction to Apache Kafka 239
Design principles 239
Getting Kafka 240
Using Kafka as a messaging system 243
Using Kafka as an event store 244
Using Kafka for Helping Hands 245
Using Kafka APIs 247
Initializing Kafka with Mount 250
Integrating the Alert Service with Kafka 253
Using Avro for data transfer 254
Summary 256
Chapter 11: Deploying and Monitoring Secured Microservices 257
Enabling authentication and authorization 258
Introducing Tokens and JWT 259
Creating an Auth service for Helping Hands 261
Using a Nimbus JOSE JWT library for Tokens 262
Creating a secret key for JSON Web Encryption 264
Creating Tokens 267
Enabling users and roles for authorization 269
Creating Auth APIs using Pedestal 272
Monitoring microservices 279
Using ELK Stack for monitoring 281
Setting up Elasticsearch 282
Setting up Kibana 286
Setting up Logstash 289
Using ELK Stack with Collectd 292
Logging and monitoring guidelines 304
Deploying microservices at scale 306
Introducing Containers and Docker 306
Setting up Docker 307
Creating a Docker image for Helping Hands 310
Introducing Kubernetes 313
Getting started with Kubernetes 315
Summary 316
Other Books You May Enjoy 317
Index 320
备用描述
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 capa ..
备用描述
Chapter 6: 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; Chapter 7: Achieving Immutability with Datomic; Datomic architecture
备用描述
The Microservice architecture is sweeping the world as the de facto pattern from which to build web-based applications and aids in designing scalable, easy-to-maintain web applications. This book will teach you common patterns and practices, showing you how to apply these using the Clojure programming language.
开源日期
2023-12-02
更多信息……

🚀 快速下载

成为会员以支持书籍、论文等的长期保存。为了感谢您对我们的支持,您将获得高速下载权益。❤️
如果您在本月捐款,您将获得双倍的快速下载次数。

🐢 低速下载

由可信的合作方提供。 更多信息请参见常见问题解答。 (可能需要验证浏览器——无限次下载!)

所有选项下载的文件都相同,应该可以安全使用。即使这样,从互联网下载文件时始终要小心。例如,确保您的设备更新及时。
  • 对于大文件,我们建议使用下载管理器以防止中断。
    推荐的下载管理器:JDownloader
  • 您将需要一个电子书或 PDF 阅读器来打开文件,具体取决于文件格式。
    推荐的电子书阅读器:Anna的档案在线查看器ReadEraCalibre
  • 使用在线工具进行格式转换。
    推荐的转换工具:CloudConvertPrintFriendly
  • 您可以将 PDF 和 EPUB 文件发送到您的 Kindle 或 Kobo 电子阅读器。
    推荐的工具:亚马逊的“发送到 Kindle”djazz 的“发送到 Kobo/Kindle”
  • 支持作者和图书馆
    ✍️ 如果您喜欢这个并且能够负担得起,请考虑购买原版,或直接支持作者。
    📚 如果您当地的图书馆有这本书,请考虑在那里免费借阅。