万本电子书0元读

万本电子书0元读

顶部广告

Distributed Computing with Go电子书

售       价:¥

1人正在读 | 0人评论 9.8

作       者:V.N. Nikhil Anurag

出  版  社:Packt Publishing

出版时间:2018-02-28

字       数:24.3万

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

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

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
A tutorial leading the aspiring Go developer to full mastery of Golang's distributed features. About This Book ? This book provides enough concurrency theory to give you a contextual understanding of Go concurrency ? It gives weight to synchronous and asynchronous data streams in Golang web applications ? It makes Goroutines and Channels completely familiar and natural to Go developers Who This Book Is For This book is for developers who are familiar with the Golang syntax and have a good idea of how basic Go development works. It would be advantageous if you have been through a web application product cycle, although it’s not necessary. What You Will Learn ? Gain proficiency with concurrency and parallelism in Go ? Learn how to test your application using Go's standard library ? Learn industry best practices with technologies such as REST, OpenAPI, Docker, and so on ? Design and build a distributed search engine ? Learn strategies on how to design a system for web scale In Detail Distributed Computing with Go gives developers with a good idea how basic Go development works the tools to fulfill the true potential of Golang development in a world of concurrent web and cloud applications. Nikhil starts out by setting up a professional Go development environment. Then you’ll learn the basic concepts and practices of Golang concurrent and parallel development. You’ll find out in the new few chapters how to balance resources and data with REST and standard web approaches while keeping concurrency in mind. Most Go applications these days will run in a data center or on the cloud, which is a condition upon which the next chapter depends. There, you’ll expand your skills considerably by writing a distributed document indexing system during the next two chapters. This system has to balance a large corpus of documents with considerable analytical demands. Another use case is the way in which a web application written in Go can be consciously redesigned to take distributed features into account. The chapter is rather interesting for Go developers who have to migrate existing Go applications to computationally and memory-intensive environments. The final chapter relates to the rather onerous task of testing parallel and distributed applications, something that is not usually taught in standard computer science curricula. Style and approach Distributed Computing with Go takes you through a series of carefully graded tutorials, building ever more sophisticated applications.
目录展开

Title Page

Copyright and Credits

Distributed Computing with Go

Packt Upsell

Why subscribe?

PacktPub.com

Contributors

About the author

About the reviewers

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

Download the color images

Conventions used

Get in touch

Reviews

Developer Environment for Go

GOROOT

GOPATH

src/

pkg/

bin/

Package management

go get

glide

go dep

Structuring a project

Working with book's code

Containers

Docker

Docker versus Virtual Machine (VM)

Understanding Docker

Testing Docker setup

Dockerfile

main.go

Testing in Go

variadic.go

variadic_test.go

Running tests in variadic_test.go

addInt.go

addInt_test.go

Running tests in addInt_test.go

nil_test.go

Running tests in nil_test.go

Summary

Understanding Goroutines

Concurrency and parallelism

Concurrency

Code overview

Serial task execution

Serial task execution with goroutines

Concurrent task execution

Parallelism

Go's runtime scheduler

Goroutine

OS thread or machine

Context or processor

Scheduling with G, M, and P

Gotchas when using goroutines

Single goroutine halting the complete program

Goroutines aren't predictable

Summary

Channels and Messages

Controlling parallelism

Distributed work without channels

Distributed work with channels

What is a channel?

Solving the cashier problem with goroutines

Channels and data communication

Messages and events

Types of channels

The unbuffered channel

The buffered channel

The unidirectional buffer

Closing channels

Multiplexing channels

Summary

The RESTful Web

HTTP and sessions

A brief history of HTTP

HTTP sessions

The REST protocol

The server and client architecture

The standard data format

Resources

Reusing the HTTP protocol

GET

POST

PUT and PATCH

DELETE

Upgradable components

Fundamentals of a REST server

A simple web server

Designing a REST API

The data format

The book resource

GET /api/books

GET /api/books/<id>

POST /api/books

PUT /api/books/<id>

DELETE /api/books/<id>

Unsuccessful requests

Design decisions

The REST server for books API

main.go

books-handler/common.go

books-handler/actions.go

books-handler/handler.go

How to make REST calls

cURL

GET

DELETE

PUT

POST

Postman

net/http

Summary

Introducing Goophr

What is Goophr?

Design overview

OpenAPI specification

Goophr Concierge API definition

Goophr Librarian API definition

Project structure

Summary

Goophr Concierge

Revisiting the API definition

Document feeder – the REST API endpoint

Query handler – the REST API endpoint

Conventions

Code conventions

Diagram conventions

Logical flow diagrams

The doc processor

The doc store

The index processor

The line store

The consolidated flow diagram

Queue workers

Single stores

Buffered channels

The Concierge source code

Running tests

The Concierge server

Summary

Goophr Librarian

The standard indexing model

An example – books with an index of words

The inverted indexing model

An example – the inverted index for words in books

Ranking

Revisiting the API definition

The document indexer – the REST API endpoint

The query resolver – the REST API endpoint

Code conventions

Librarian source code

main.go

common/helpers.go

api/index.go

api/query.go

Testing Librarian

Testing feeder.go using /api/index

Testing /api/query

Summary

Deploying Goophr

Updating Goophr Concierge

Handle multiple Librarians

Aggregated search results

Orchestrating with docker-compose

Environment variables and API ports

The file server

The Goophr source code

librarian/main.go

concierge/main.go

concierge/api/query.go

simple-server/Dockerfile

simple-server/main.go

docker-compose.yaml

.env

Running Goophr with docker-compose

Adding documents to Goophr

Searching for keywords with Goophr

Search – "apple"

Search – "cake"

Search – "apple", "cake"

Individual logs with docker-compose

Authorization on a web server

secure/secure.go

secure/secure_test.go

Test results

Summary

Foundations of Web Scale Architecture

Scaling a web application

The single server instance

Separate layers for the web and database

Multiple server instances

The load balancer

Multi-availability zones

The database

SQL versus NoSQL

Which type of database should we use?

Database replication

Master-replica replication

Master-master replication

Failover cluster replication

Monolith versus microservices

Mediator design pattern

Deployment options

Maintainability of multiple instances

Summary

Other Books You May Enjoy

Leave a review - let other readers know what you think

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

发表评论

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

买过这本书的人还买过

读了这本书的人还在读

回顶部