1 / 9

Redesign ideas

Redesign ideas. Stephen Hicks. Introduction. Web Services Streaming Refactoring. Web Services. API’s User: e.g. insert(), close() Factory: e.g. createConsumer() System: e.g. startStreaming(), execute() WSDL Subset of… User & Factory API (public) System API (private).

stu
Download Presentation

Redesign ideas

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Redesign ideas Stephen Hicks

  2. Introduction • Web Services • Streaming • Refactoring

  3. Web Services • API’s • User: e.g. insert(), close() • Factory: e.g. createConsumer() • System: e.g. startStreaming(), execute() • WSDL • Subset of… • User & Factory API (public) • System API (private)

  4. WS-Resource Framework • Stateful services • Resources / Instances • Connection ID • SOAP Header • WS-ResourceLifetime • Destroy • InitialTerminationTime • CurrentTime • SetTerminationTime • WS-Addressing • EndpointReference • URL • Resource ID

  5. Streaming • All consumer-side streaming code in StreamingServer • Transport • TCP/IP • Data protocol • consumer ID first 4 bytes sent to socket • Data format • XML • Application logic • Push ResultSet onto stack • Split into separate modules • Well-defined interfaces • Pluggable implementations

  6. Streaming: producers • Which thread should stream data for the producer? • HTTPProcessor* • Simple, no extra threads, user’s insert() calls can block • One I/O thread • insert() returns quickly, slow socket blocks all I/O ( no TCP flow control) • One thread per producer/consumer pair • insert() returns quickly, many threads, slow socket won’t block I/O • One thread per machine connection • insert() returns quickly, slow socket won’t block I/O, no TCP flow control (i.e. if stack.isFull…)

  7. Streaming: consumers • How should the consumer ID be sent? • With each Tuple / ResultSet • One data channel can be used for multiple consumers • “full” check no longer possible • More data sent • XML data must be parsed before being pushed onto stack • Once per “channel”* • One consumer per channel • How many sockets should be used? • One per machine connection • Relatively few sockets • No TCP flow control • One per producer/consumer pair* • Many sockets

  8. General refactoring • Packaging • SQL parsing • Database access • Testing • Refactor tests before most of code • Use tests to verify new code

  9. Producers • One producer • Just change API • Change API and implementation • Define basic behaviour in interfaces • TupleStorer • Store tuple • Retrieve tuple • TupleStreamer • Stream tuple • Plug in different implementations • MemoryTupleStorer, DatabaseTupleStorer • TCPTupleStreamer, JMSTupleStreamer

More Related