Microservice Stategies - Scaling your API design workflowJakub Nesetril
油
Across the 200,000+ APIs we've seen at Apiary, here are 5 simple lessons on what to watch out for when switching to micro services.
First presented at SF Microservices meetup on May 19th, 2016.
Skrz.cz hl鱈d叩 ka転d辿 u転ivatelovo prohl辿dnut鱈 nab鱈dky. Jsou to miliony pidirequest哲 denn. Pou転鱈t PHP-FPM by znamenalo zbyten dal邸鱈 server(y). ReactPHP d鱈ky asynchronn鱈mu IO dovoluje s minim叩ln鱈mi n叩roky zpracov叩vat tis鱈ce req/s. Nechtli jsme se vzd叩t Symfony, a tak vznikl bridge mezi Symfony a asynchronn鱈m svtem ReactPHP.
The document contains a series of abstract symbols and patterns with no clear meaning. Various symbols such as lines, shapes, and punctuation are arranged without any apparent structure or message.
The document discusses issues with REST and proposes an alternative approach called Post-REST. It advocates for documentation-first design, focusing on users rather than theoretical purity, and continuing to evolve designs based on user feedback rather than stopping after initial design. APIs should support multiple versions and isolate code handling changes to minimize impact.
Jakub Nesetril, founder and CEO of Apiary, discusses common problems with API development including designing and building APIs without customer input, out of date documentation, and lack of proper support. He advocates for an agile approach of creating API documentation first, offering mock servers for customer input, writing automated tests for documentation, and providing developer support to address these issues.
This document provides an overview of startup accelerators from the perspective of someone who went through one. It discusses why entrepreneurs may want to join an accelerator, some differences between popular accelerators like Y Combinator and TechStars, tips for getting into an accelerator program, advice for getting the most out of the program, and funding considerations. The overall message is that accelerators can provide mentoring, networking opportunities, and small funding that can help startups, but entrepreneurs need to be fully immersed and follow up extensively with contacts.
The document discusses key principles for designing APIs, including that an API serves as an interface between systems and cultures. It emphasizes involving customers early in the design process, starting with a wireframe, and maintaining exhaustive and up-to-date documentation that is automatically generated and tested. The document concludes that APIs should have their contract separated from implementation and encourages automating the design process.
Consuming API description languages - Refract & MinimJakub Nesetril
油
The proliferation of API description languages is great, but poses a barrier to vendors who try to consume all of them. We should start looking at a higher abstraction.
The document is a presentation about Node.js, CoffeeScript, and real-time web technologies. It introduces Node.js as an event-driven JavaScript runtime, not a framework or programming language. It discusses getting started with Node.js and libraries like NPM. It also covers CoffeeScript as a language that compiles to clean JavaScript and introduces syntactic sugar. Finally, it discusses challenges with real-time web technologies and solutions like WebSocket, Socket.io, and Pusher.
Pokud chcete jako v箪voj叩i ulehit pr叩ci ostatn鱈m, nejd鱈v ulehete pr叩ci sob. Deployment aplikace nemus鱈 b箪t voser, d叩 se e邸it bez v箪padku a existuj鱈 slu転by a n叩stroje, kter辿 k tomu pomohou. Pod鱈v叩me se na nastaven鱈 automatizovan箪ch test哲, o泥ukneme Docker a nasad鱈me automaticky aplikaci do clusteru v AWS.
A quick overview of API Design Workflow, describing my views on waterfall API design approach, why we've built Apiary a certain way and random notes from the API industry
This document discusses Node.js and the API documentation service Apiary.io. It provides an overview of the technologies used to build Apiary.io including Express, MongoDB, Redis, and Socket.IO. It also outlines some benefits of Node.js including low-level access and small code size, and some challenges like debugging asynchronous code and long stack traces.
This document discusses REST API tools and describes Apiary.io, which provides documentation and testing for REST APIs. It outlines Apiary.io's key features like being easy to clone and share on GitHub, including debugging and support, and being supported by regression tests. It also gives an overview of the technologies used, including JavaScript, Express, MongoDB, and testing tools like Mocha and Chai.
The document discusses issues with REST and proposes an alternative approach called Post-REST. It advocates for documentation-first design, focusing on users rather than theoretical purity, and continuing to evolve designs based on user feedback rather than stopping after initial design. APIs should support multiple versions and isolate code handling changes to minimize impact.
Jakub Nesetril, founder and CEO of Apiary, discusses common problems with API development including designing and building APIs without customer input, out of date documentation, and lack of proper support. He advocates for an agile approach of creating API documentation first, offering mock servers for customer input, writing automated tests for documentation, and providing developer support to address these issues.
This document provides an overview of startup accelerators from the perspective of someone who went through one. It discusses why entrepreneurs may want to join an accelerator, some differences between popular accelerators like Y Combinator and TechStars, tips for getting into an accelerator program, advice for getting the most out of the program, and funding considerations. The overall message is that accelerators can provide mentoring, networking opportunities, and small funding that can help startups, but entrepreneurs need to be fully immersed and follow up extensively with contacts.
The document discusses key principles for designing APIs, including that an API serves as an interface between systems and cultures. It emphasizes involving customers early in the design process, starting with a wireframe, and maintaining exhaustive and up-to-date documentation that is automatically generated and tested. The document concludes that APIs should have their contract separated from implementation and encourages automating the design process.
Consuming API description languages - Refract & MinimJakub Nesetril
油
The proliferation of API description languages is great, but poses a barrier to vendors who try to consume all of them. We should start looking at a higher abstraction.
The document is a presentation about Node.js, CoffeeScript, and real-time web technologies. It introduces Node.js as an event-driven JavaScript runtime, not a framework or programming language. It discusses getting started with Node.js and libraries like NPM. It also covers CoffeeScript as a language that compiles to clean JavaScript and introduces syntactic sugar. Finally, it discusses challenges with real-time web technologies and solutions like WebSocket, Socket.io, and Pusher.
Pokud chcete jako v箪voj叩i ulehit pr叩ci ostatn鱈m, nejd鱈v ulehete pr叩ci sob. Deployment aplikace nemus鱈 b箪t voser, d叩 se e邸it bez v箪padku a existuj鱈 slu転by a n叩stroje, kter辿 k tomu pomohou. Pod鱈v叩me se na nastaven鱈 automatizovan箪ch test哲, o泥ukneme Docker a nasad鱈me automaticky aplikaci do clusteru v AWS.
A quick overview of API Design Workflow, describing my views on waterfall API design approach, why we've built Apiary a certain way and random notes from the API industry
This document discusses Node.js and the API documentation service Apiary.io. It provides an overview of the technologies used to build Apiary.io including Express, MongoDB, Redis, and Socket.IO. It also outlines some benefits of Node.js including low-level access and small code size, and some challenges like debugging asynchronous code and long stack traces.
This document discusses REST API tools and describes Apiary.io, which provides documentation and testing for REST APIs. It outlines Apiary.io's key features like being easy to clone and share on GitHub, including debugging and support, and being supported by regression tests. It also gives an overview of the technologies used, including JavaScript, Express, MongoDB, and testing tools like Mocha and Chai.
This document provides an overview of Node.js, including:
- Node.js uses a non-blocking and event-driven architecture that is well-suited for real-time applications.
- It includes a short introduction to Node.js' core concepts like blocking vs non-blocking I/O.
- The document outlines example applications, Node.js' ecosystem including modules and tools, and advanced topics like WebSockets and performance.
- It concludes with a Q&A section.
6. TROCHA HISTORIE
1981: internet protocol IP (RFC 791)
packety, IP adresy, smrov叩n鱈
1981: transmission control protocol TCP (RFC 793)
datov箪 penos, spolehlivost, 鱈zen鱈 toku,
multiplexing, spojov叩n鱈, bezpenost
p叩tek, 25. bezna 2011
7. TROCHA HISTORIE
1981: internet protocol IP (RFC 791)
packety, IP adresy, smrov叩n鱈
1981: transmission control protocol TCP (RFC 793)
datov箪 penos, spolehlivost, 鱈zen鱈 toku,
multiplexing, spojov叩n鱈, bezpenost
p叩tek, 25. bezna 2011
8. TCP
This is achieved by requiring a
positive acknowledgment (ACK) from
the receiving TCP. If the ACK is not
received within a timeout interval,
the data is retransmitted.
-RFC 793
p叩tek, 25. bezna 2011
20. NAPROST ZAHLCEN ST
The critical congestion problems the
ARPANET is experiencing causes [...]
mail messages from MILNET
hosts to take up to 2-3 days to be
delivered to BBNNET hosts.
- Nancy Cassidy in mod.risks, September 22 1986
p叩tek, 25. bezna 2011
21. TCP
Should the round-trip time
exceed the maximum retransmission
interval for any host, that host
will begin to introduce more and
more copies of the same datagrams
into the net. The network is now
in serious trouble.
http://www.faqs.org/rfcs/rfc896.html
p叩tek, 25. bezna 2011
22. TCP SLOW START
uv叩d鱈 maxim叩ln鱈 poet pen叩邸en箪ch nepotvrzen箪ch
(ACK) packet哲 a funkci podle kter辿 se zvy邸uje v ase
ka転d辿 nov辿 TCP spojen鱈 se postupn rozj鱈転d鱈
maxim叩ln鱈 rychlosti (poet packet哲) dos叩hne zhruba
po 9 ot叩k叩ch
http://www.faqs.org/rfcs/rfc1122.html
http://mike.bailey.net.au/2010/07/tcp-and-the-lower-bound-of-web-performance/
p叩tek, 25. bezna 2011
23. LATENCE JE ZCELA ZSADN
15ms
vs
250ms
http://mike.bailey.net.au/2010/07/latency-is-a-killer/
p叩tek, 25. bezna 2011
33. PUSH
Client Server
.1 200 OK
HTTP/1
p叩tek, 25. bezna 2011
34. PUSH
browsery ani servery jej nepodporuj鱈
(a転 na HTML5 browsery s WebSocket podporou)
existuj鱈 zp哲soby jak nekompatibilitu obch叩zet
p叩tek, 25. bezna 2011
35. LONG POLLING
Client Server
GET /in
dex.htm
l
O K
HTTP/1.1 200
GET /in
dex.htm
l
p叩tek, 25. bezna 2011
36. PUSH
Our experiment shows that if we want high data
coherence and high network performance, we
should choose the push approach.
http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2007-016.pdf
p叩tek, 25. bezna 2011
37. PUSH
However, push brings some scalability issues; the
server application CPU usage is 7 times higher as in
pull. According to our results, the server starts to
saturate at 350-500 users.
http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2007-016.pdf
p叩tek, 25. bezna 2011
40. SLA, KTER BYSTE MLI ZNT
Building Software Systems at Google
Jeffrey Dean
(AdWords, AdSense, crawler, Protocol Buffers, MapReduce, BigTable)
http://www.stanford.edu/class/ee380/Abstracts/101110.html
p叩tek, 25. bezna 2011
41. SLA, KTER BYSTE MLI ZNT
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 100 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 10,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
Read 1 MB sequentially from network 10,000,000 ns
Read 1 MB sequentially from disk 30,000,000 ns
Send packet CA->Netherlands->CA 150,000,000 ns
p叩tek, 25. bezna 2011
42. SLA, KTER BYSTE MLI ZNT
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 100 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 10,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
Read 1 MB sequentially from network 10,000,000 ns
Read 1 MB sequentially from disk 30,000,000 ns
Send packet CA->Netherlands->CA 150,000,000 ns
p叩tek, 25. bezna 2011
43. SLA, KTER BYSTE MLI ZNT
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 100 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 10,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
Read 1 MB sequentially from network 10,000,000 ns
Read 1 MB sequentially from disk 30,000,000 ns
Send packet CA->Netherlands->CA 150,000,000 ns
p叩tek, 25. bezna 2011
44. BLOKUJC PROVOZ
<?php
1 var $db = new mysqli("host", "user", "password", "database");
2 var $result = db->mysqli_query('SELECT Name FROM City LIMIT 10');
3 foreach ($result as $row)
?>
p叩tek, 25. bezna 2011
52. BLOKUJC PROVOZ
<?php
1 var $db = new mysqli("host", "user", "password", "database");
2 var $result = $db->mysqli_query('SELECT Name FROM City LIMIT 10');
3 foreach ($result as $row)
?>
p叩tek, 25. bezna 2011
53. NE-BLOKUJC PROVOZ
1 client.connect();
2 client.query('SELECT Name FROM City LIMIT 10', function(err, results) {
3 for (var i=0; i < results.length; i++) { };
4 });
p叩tek, 25. bezna 2011
54. NE-BLOKUJC PROVOZ
1 client.connect();
2 client.query('SELECT Name FROM City LIMIT 10',
3 function(err, results) {
4 for (var i=0; i < results.length; i++) { };
5 }
6 );
p叩tek, 25. bezna 2011
58. NODE.JS
runtime (nen鱈 to mod_nodejs, ani node_d)
postaven辿 na v8 (Google Chrome JS engine)
one event-loop, single-threaded
asynchronous and non-blocking
p叩tek, 25. bezna 2011
60. SOCKET.IO
funguje v邸ude (i bez podpory WebSocket)
pokud nutno, pou転鱈v叩 long polling, ash aj.
automatick箪 reconnect, heartbeat
super-jednoduch辿 pou転it鱈
p叩tek, 25. bezna 2011