FinUniversity Electronic Library

     

Details

BUELTA, JAIME. PYTHON ARCHITECTURE PATTERNS [[electronic resource]]: master api design, event-driven structures, and package management... in python. — [S.l.]: PACKT PUBLISHING LIMITED, 2022. — 1 online resource — <URL:http://elib.fa.ru/ebsco/3134268.pdf>.

Record create date: 1/14/2022

Subject: Python (Computer program language); Software patterns.; Python (Langage de programmation); Logiciels — Modèles de conception.; COMPUTERS — General.; COMPUTERS — Intelligence (AI) & Semantics.; COMPUTERS — Social Aspects — General.; Python (Computer program language); Software patterns.

Collections: EBSCO

Allowed Actions:

Action 'Read' will be available if you login or access site from another network Action 'Download' will be available if you login or access site from another network

Group: Anonymous

Network: Internet

Annotation

Make the best of your test suites by using cutting-edge software architecture patterns in Python Key Features Learn how to create scalable and maintainable applications Build a web system for micro messaging using concepts in the book Use profiling to find bottlenecks and improve the speed of the system Book Description Developing large-scale systems that continuously grow in scale and complexity requires a thorough understanding of how software projects should be implemented. Software developers, architects, and technical management teams rely on high-level software design patterns such as microservices architecture, event-driven architecture, and the strategic patterns prescribed by domain-driven design (DDD) to make their work easier. This book covers these proven architecture design patterns with a forward-looking approach to help Python developers manage application complexity--and get the most value out of their test suites. Starting with the initial stages of design, you will learn about the main blocks and mental flow to use at the start of a project. The book covers various architectural patterns like microservices, web services, and event-driven structures and how to choose the one best suited to your project. Establishing a foundation of required concepts, you will progress into development, debugging, and testing to produce high-quality code that is ready for deployment. You will learn about ongoing operations on how to continue the task after the system is deployed to end users, as the software development lifecycle is never finished. By the end of this Python book, you will have developed "architectural thinking": a different way of approaching software design, including making changes to ongoing systems. What you will learn Think like an architect, analyzing software architecture patterns Explore API design, data storage, and data representation methods Investigate the nuances of common architectural structures Utilize and interoperate elements of patterns such as microservices Implement test-driven development to perform quality code testing Recognize chunks of code that can be restructured as packages Maintain backward compatibility and deploy iterative changes Who this book is for This book will help software developers and architects understand the structure of large complex systems and adopt architectural patterns that are scalable. Examples in the book are implemented in Python so a fair grasp of basic Python concepts is expected. Proficiency in any programming languages such as Java or JavaScript is sufficient.

Document access rights

Network User group Action
Finuniversity Local Network All Read Print Download
Internet Readers Read Print
-> Internet Anonymous

Table of Contents

  • Cover
  • Copyright
  • Table of Contents
  • Preface
  • Chapter 1: Introduction to Software Architecture
    • Defining the structure of a system
    • Division into smaller units
      • In-process communication
    • Conway's Law – Effects on software architecture
    • Application example – Overview
    • Security aspects of software architecture
    • Summary
  • Part I
  • Chapter 2: API Design
    • Abstractions
      • Using the right abstractions
      • Leaking abstractions
      • Resources and action abstractions
    • RESTful interfaces
      • A more practical definition
      • Headers and statuses
      • Designing resources
      • Resources and parameters
      • Pagination
      • Designing a RESTful API process
      • Using the Open API specification
    • Authentication
      • Authenticating HTML interfaces
      • Authenticating RESTful interfaces
        • Self-encoded tokens
    • Versioning the API
      • Why versioning?
      • Internal versus external versioning
      • Semantic versioning
      • Simple versioning
    • Frontend and backend
      • Model View Controller structure
    • HTML interfaces
      • Traditional HTML interfaces
      • Dynamic pages
      • Single-page apps
      • Hybrid approach
    • Designing the API for the example
      • Endpoints
        • Review of the design and implementation
    • Summary
  • Chapter 3: Data Modeling
    • Types of databases
      • Relational databases
      • Non-relational databases
        • Key-value stores
        • Document stores
        • Wide-column databases
        • Graph databases
      • Small databases
    • Database transactions
    • Distributed relational databases
      • Primary/replica
      • Sharding
        • Pure sharding
        • Mixed sharding
        • Table sharding
      • Advantages and disadvantages of sharding
    • Schema design
      • Schema normalization
      • Denormalization
    • Data indexing
      • Cardinality
    • Summary
  • Chapter 4: The Data Layer
    • The Model layer
      • Domain-Driven Design
      • Using ORM
        • Independence from the database
        • Independence from SQL and the Repository pattern
        • No problems related to composing SQL
      • The Unit of Work pattern and encapsulating the data
      • CQRS, using different models for read and write
    • Database migrations
      • Backward compatibility
      • Relational schema changes
        • Changing the database without interruption
        • Data migrations
      • Changes without enforcing a schema
    • Dealing with legacy databases
      • Detecting a schema from a database
      • Syncing the existing schema to the ORM definition
    • Summary
  • Part II
  • Chapter 5: The Twelve-Factor App Methodology
    • Intro to the Twelve-Factor App
    • Continuous Integration
    • Scalability
    • Configuration
    • The Twelve Factors
      • Build once, run multiple times
      • Dependencies and configurations
      • Scalability
      • Monitoring and admin
    • Containerized Twelve-Factor Apps
    • Summary
  • Chapter 6: Web Server Structures
    • Request-response
    • Web architecture
    • Web servers
      • Serving static content externally
      • Reverse proxy
      • Logging
      • Advanced usages
    • uWSGI
      • The WSGI application
      • Interacting with the web server
      • Processes
      • Process lifecycle
    • Python worker
      • Django MVT architecture
      • Routing a request towards a View
      • The View
        • HttpRequest
        • HttpResponse
      • Middleware
      • Django REST framework
        • Models
        • URL routing
        • Views
        • Serializer
    • External layers
    • Summary
  • Chapter 7: Event-Driven Structures
    • Sending events
    • Asynchronous tasks
    • Subdividing tasks
    • Scheduled tasks
    • Queue effects
      • Single code for all workers
      • Cloud queues and workers
    • Celery
      • Configuring Celery
      • Celery worker
      • Triggering tasks
      • Connecting the dots
      • Scheduled tasks
      • Celery Flower
      • Flower HTTP API
    • Summary
  • Chapter 8: Advanced Event-Driven Structures
    • Streaming events
    • Pipelines
      • Preparation
      • Base task
      • Image task
      • Video task
      • Connecting the tasks
      • Running the task
    • Defining a bus
    • More complex systems
    • Testing event-driven systems
    • Summary
  • Chapter 9: Microservices vs Monolith
    • Monolithic architecture
    • The microservices architecture
    • Which architecture to choose
      • A side note about similar designs
    • The key factor – team communication
    • Moving from a monolith to microservices
      • Challenges for the migration
      • A move in four acts
        • 1. Analyze
        • 2. Design
        • 3. Plan
        • 4. Execute
    • Containerizing services
      • Building and running an image
      • Building and running a web service
        • uWSGI configuration
        • nginx configuration
        • Start script
        • Building and running
        • Caveats
    • Orchestration and Kubernetes
    • Summary
  • Part III
  • Chapter 10: Testing and TDD
    • Testing the code
    • Different levels of testing
      • Unit tests
      • Integration tests
      • System tests
    • Testing philosophy
      • How to design a great test
      • Structuring tests
    • Test-Driven Development
      • Introducing TDD into new teams
      • Problems and limitations
      • Example of the TDD process
    • Introduction to unit testing in Python
      • Python unittest
      • Pytest
    • Testing external dependencies
      • Mocking
      • Dependency injection
      • Dependency injection in OOP
    • Advanced pytest
      • Grouping tests
      • Using fixtures
    • Summary
  • Chapter 11: Package Management
    • The creation of a new package
    • Trivial packaging in Python
    • The Python packaging ecosystem
      • PyPI
      • Virtual environments
      • Preparing an environment
        • A note on containers
      • Python packages
    • Creating a package
      • Development mode
      • Pure Python package
    • Cython
    • Python package with binary code
    • Uploading your package to PyPI
    • Creating your own private index
    • Summary
  • Part IV
  • Chapter 12: Logging
    • Log basics
    • Producing logs in Python
    • Detecting problems through logs
      • Detecting expected errors
      • Capturing unexpected errors
    • Log strategies
    • Adding logs while developing
    • Log limitations
    • Summary
  • Chapter 13: Metrics
    • Metrics versus logs
      • Kinds of metrics
    • Generating metrics with Prometheus
      • Preparing the environment
      • Configuring Django Prometheus
      • Checking the metrics
      • Starting a Prometheus server
    • Querying Prometheus
    • Proactively working with metrics
    • Alerting
    • Summary
  • Chapter 14: Profiling
    • Profiling basics
    • Types of profilers
    • Profiling code for time
      • Using the built-in cProfile module
      • Line profiler
    • Partial profiling
      • Example web server returning prime numbers
      • Profiling the whole process
      • Generating a profile file per request
    • Memory profiling
      • Using memory_profiler
      • Memory optimization
    • Summary
  • Chapter 15: Debugging
    • Detecting and processing defects
    • Investigation in production
    • Understanding the problem in production
      • Logging a request ID
      • Analyzing data
      • Increasing logging
    • Local debugging
    • Python introspection tools
    • Debugging with logs
    • Debugging with breakpoints
    • Summary
  • Chapter 16: Ongoing Architecture
    • Adjusting the architecture
    • Scheduled downtime
      • Maintenance window
    • Incidents
      • Postmortem analysis
      • Premortem analysis
    • Load testing
    • Versioning
    • Backward compatibility
      • Incremental changes
      • Deploying without interruption
    • Feature flags
    • Teamwork aspects of changes
    • Summary
  • PacktPage
  • Other Books You May Enjoy
  • Index

Usage statistics

stat Access count: 1
Last 30 days: 0
Detailed usage statistics