Upgrade to Pro — share decks privately, control downloads, hide ads and more …

apidays New York 2023 - Why Finance needs Asych...

apidays New York 2023 - Why Finance needs Asychronous APIs, Nicholas Goodman, Solace

apidays New York 2023
APIs for Embedded Business Models: Finance, Healthcare, Retail, and Media
May 16 & 17, 2023

Why Finance needs Asychronous APIs
Nicholas Goodman, Systems Engineer at Solace

------

Check out our conferences at https://www.apidays.global/

Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8

Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io

Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/

apidays

June 29, 2023
Tweet

More Decks by apidays

Other Decks in Programming

Transcript

  1. Agenda • Event-Driven Architecture Solves Everything! Or does it? •

    Challenge 1: Managing Event APIs • Challenge 2: Authorization and Access • Challenge 3: Distributed Processing Woes • Use-Case Demo: Streaming Data from Solace to Snowflake • Concluding Remarks (Eventing and APIs?)
  2. Challenges of Integrating Distributed Systems • Often point-to-point one-off data

    Integrations • Monolithic and siloed with tight coupling • High complexity rigid dependencies and upgrade paths • Challenging transparency, governance, monitoring • Slow pace of development and implementation • Expensive and difficult to integrate customers, partners, suppliers
  3. The Solace Event Mesh • Uniform Connectivity • Hybrid and

    Multi Cloud • Public and Private Cloud • Dynamic Routing • High Availability and Performance • Centralized Security and Governance Fraud Loyalty Digital App Fraud Credit Private Cloud Management & Security Event Mesh
  4. Common Event Messaging Patterns • Streaming Data • Fire and

    Forget • Fan-out • Events are queued • Point-to-Point • Fan-out • Round-trip events • Point-to-Point • Synchronous Flows Request-Response Guaranteed Messaging Direct Messaging Q1 Q2
  5. Basics of Topic Based Routing Data Type MarketData Asset Class

    EQ FX Country US UK Exchange NYSE LSE Ticker IBM VOD Market Data Example Taxonomy: Enumeration: EQ US NYSE IBM I am interested in receiving all market data for IBM from NYSE: I am interested in receiving all market data from any country and any venue where IBM is traded: EQ I am interested in receiving all market data for all equities from every exchange in UK: EQ > MarketData MarketData MarketData * * IBM UK …
  6. Using Topics and Queues Together Consumer Producer Consumer Topic Subscription:

    eq/us/> Publishing to topic: eq/us/{exch}/{ticker} Topic Subscription: */*/nyse/> Topic Subscription: eq/uk/> Topic Subscription: */*/lse/> Producer Publishing to topic: eq/uk/{exch}/{ticker}
  7. Mission Accomplished? Great, use event brokers and all my integration

    problems are gone, right!? … but wait, Who owns the event definitions? What are the payload schemas? Who is allowed to say what? Who is allowed to listen to what? What if something goes wrong in flight? Who owns the error?
  8. Solace Event Portal: API Management for Events • Configure and

    manage broker clusters and event meshes • Design, manage, and version event topics and schemas • Monitor and gain insights on service behaviors and system utilization
  9. Authentication & Authorization • Basic: Choose Internal, LDAP or RADIUS

    • TLS client certificate • Kerberos • OAuth • Clients can retrieve authorization groups from configuration in broker or an external server • Authorization group determines: – Attributes of the client’s connection (client profile) – Topics client can publish & subscribe to (ACL profile) • Connect ACL: Control where client can connect from • Publish ACL: Control which topics client can publish to • Subscribe ACL: Control which topics client can subscribe to 3. Real-time policing of pub/sub topics 2. Client Authorization (based on identity) 1. Authentication (based on username & credentials)
  10. Error Management and Tracing Point to Point: • Client or

    server handles errors What about Event Driven? • Dead Letter Queues • Using Tracing • Best Option: Well-behaved publishers and robust consumers Consumer Queue Dead Message Queue Consumer Message cannot be processed DMQ? No Yes OpenTelemetry Implementations
  11. Mission Accomplished So, putting it all together… • Managed AsyncAPI

    specifications for event topics and data schemas • ACLs govern which apps can send and receive which data • Keep the data moving: smart endpoints and dumb pipes!
  12. Using Best Practices to Design the Connector • Snowflake, a

    Cloud Data Platform recently introduced ability to stream data into tables in real-time with the Snowpipe Streaming API • Tables can accept structured or non-structured (variant) data types • Goal: stream data from Solace into Snowflake tables in real-time • Remember: smart endpoints, dumb pipes! • Design for ELT, not ETL! • Data In == Data Stored
  13. Streaming Data into Snowflake Snowflake Connector Queue-to-Buffer (1:1) Publishers Table-A

    Channel-A Queue-A Queue-B1 Queue-B2 Buffer-A Buffer-B1 Buffer-B2 Table-B Channel-B1 Channel-B2 Topic-to-Queue Mapping (n:n) Buffer-to-Channel (1:1) Channel-to-Table (n:1) Source Destination
  14. 1. Connector opens flow and begins receiving messages which are

    inserted immediately into the Snowpipe Streaming channel and saved locally 2. Channel processes rows as they are received 3. Connector polls the channel for latest committed offset token 4. Whenever offset token increases connector identifies all messages which have been successfully committed 5. Connector sends individual Acks for each successfully inserted message Snowflake Connector 0e4d 0e4c 0e4b 0e4a queue in-memory copy Snowpipe Streaming Channel table 1 5 3 4 1 2 Data Flow and Guaranteed Delivery
  15. Using API Management to Aide Data Governance • A Well

    Governed Event API: • Data quality enforced at source • Data is secured from the right senders to the right consumers • Data will get to its destination uninterrupted and real time • How does this help with Data Governance • In data streaming use cases, Event API governance fulfills some common needs • Enforcing quality and security at its source Image Credit: Data Governance: The Definitive Guide by Evren Eryurek, Uri Gilad, Valliappa Lakshmanan, Anita Kibunguchy-Grant, Jessi Ashdown O’Rielly