Designing DIA note 27 -- REST & SOAP

4.2.1.1 Different values written at different times

  • data outlives code -- when you deploy a new version of you app, the DB contents are still old
  • migrating data is possible, but expensive on a large dataset
  • LinkedIn's document DB Expresso uses Avro for storage, allowing it to use Avro's schema evolution rules
  • schema evolution allows the entire DB to appear as if it was encoded with a single schema, even though the underlying storage may contain records encoded with various historical versions of schema

4.2.1.2 Archival storage

  • As the data dump is written in 1 go and is thereafter immutable
    ==> formats like Arvo object container files are a good fit
    ==> good chance to encode the data in an analytics-friendly column-oriented format (Parquet)

4.2.2 Dataflow Through Services: REST and RPC

Arrangements to communicate over a network:

  • clients & servers : API exposed by the server is known as a service
  • clients could be : web browser, mobile app, client-side JavsScript app, etc
  • a server can be a client to another service
    ==> approach used to decompose a large app into smaller services by area of functionality
    ==> traditionally SOA (service-oriented architecture), more recently refined as microservices architecture
  • services can impose fine-grained restrictions on what clients can and cannot do ==> provides a degree of encapsulation over DB
  • key design goal of a service-oritented/microservices architecture
    ==> make the app easier to change and maintain by making services independently deployable and evolvable

4.2.2.1 web services

web service -- when HTTP is used as the underlying protocol for talking to the service ==> 2 popular approaches : REST & SOAP

REST SOAP
not a protocol, but rather a design philosophy XML-based protocol
use HTTP features for cache control, authentication, and content type negotiation aims to be independent from HTTP, avoids using HTTP features
simple data formats complex multitude of related standards (web service framework WS-*)
Swagger (OpenAPI) can be used to describe RESTful APIs soap API described using WSDL (Web Service Description Language, an XML-based language)
identify resources by URL WSDL enables code generation ==> client can access a remote service using local classes and method calls
often associated with microservices WSDL is not designed to be human readable ==> users of SOAP rely heavily on tool support

RESTful -- an API designed according to the principles of REST

Reference
Designing Data-Intensive Applications by Martin Kleppman

你可能感兴趣的:(Designing DIA note 27 -- REST & SOAP)