{"id":303459,"date":"2020-05-12T15:01:29","date_gmt":"2020-05-12T15:01:29","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=303459"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=303459","title":{"rendered":"\u0414\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b JDBC"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/501432\/\">\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a SQL \u0431\u0430\u0437\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 <em>Vert.X SQL<\/em> \u0438 <em>R2DBC<\/em>. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430 PostgreSQL \u0438 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043e\u0431\u0435\u0440\u0442\u043a\u0430\u0445 Java. <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vm\/46\/dl\/vm46dlyyevwn43fkcov62egi-no.jpeg\"><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e: JDBC \u2014 \u044d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442. \u0421\u043b\u0443\u0436\u0438\u043b \u0438 \u0441\u043b\u0443\u0436\u0438\u0442 \u0432\u0435\u0440\u043e\u0439 \u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u0439.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e <a href=\"https:\/\/habr.com\/ru\/post\/500446\/\">\u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u044f\u043d\u0438\u044f<\/a> \u043f\u0440\u043e\u0441\u044f\u0442 \u043d\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u0418 \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u043c\u044b\u0441\u043b \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u0442\u0435\u0441\u043d\u0438\u0442\u044c JDBC.<\/p>\n<p>  <\/p>\n<p>\u042f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0434\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a SQL \u0431\u0430\u0437\u0430\u043c \u0438\u0437 JVM \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0438\u0445 (\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439) \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0430\u0442\u044b\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043a\u0441\u0442, \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u043e\u0440\u0438\u044f \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h3 id=\"poyasneniya-k-materialu\">\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043a \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0443<\/h3>\n<p>  <\/p>\n<p>\u0411\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u044f \u0432\u0437\u044f\u043b <a href=\"https:\/\/github.com\/devrimgunduz\/pagila\/\" rel=\"nofollow\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>. \u0415\u0451 \u044f \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u0441\u0435\u0440\u0432\u0435\u0440 \u0411\u0414 (PostgreSQL 12) \u043d\u0435 \u043c\u0435\u0448\u0430\u043b \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 \u0421\u0423\u0411\u0414, \u043e\u0442 \u0441\u0445\u0435\u043c\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435, \u043e\u0442 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u0435\u0449\u0435.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u0433\u043e JDK \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u2014 \u0434\u043b\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0432 OpenJDK 11, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b, \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u0434\u043b\u044f Oracle JDK 8, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 <em>pg_sleep(seconds)<\/em> \u0438\u0437 PostgreSQL. <\/p>\n<p>  <\/p>\n<p>\u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u2014 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 (netty). \u0415\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0434\u0430\u0436\u0435 \u0432 patch-\u0432\u0435\u0440\u0441\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u043e\u043c\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443. \u042d\u0442\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u043e\u0439 \u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u044e, \u0435\u0441\u043b\u0438 netty \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443, \u0431\u0435\u0437 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0441\u0442\u0430\u0442\u044c\u0438. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u0430\u043a \u0438 \u0432 JDBC, \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044e. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0438 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043e \u0432 \u043f\u0443\u043b, \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0435\u043b\u044c\u0437\u044f, \u043a\u0430\u043a \u0438 \u0432 JDBC. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 \u0431\u0435\u0437 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u2014 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 ThreadLocal \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439, \u0447\u0442\u043e \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0442\u0443\u0442, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 <a href=\"https:\/\/github.com\/votez\/database-access\" rel=\"nofollow\">GitHub<\/a>. <\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0442\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u043c\u0435\u0440\u044f\u0442\u044c \u0432 \u043f\u043e\u043b\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0447\u0430\u0441\u0442\u044f\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0432\u0435\u0431-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043c\u0435\u0440\u044f\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u043d\u0438\u043c, \u0430 \u043d\u0435 &quot;\u0447\u0438\u0441\u0442\u044b\u0439&quot; \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c. \u041c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043b\u0443\u0447\u0448\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u0434\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 &quot;\u0432\u0447\u0438\u0441\u0442\u0443\u044e&quot; \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u0430\u044f.<\/p>\n<p>  <\/p>\n<h3 id=\"zachem-nuzhny-neblokiruyuschie-vyzovy-teoriya\">\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u043d\u044b \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u044b. \u0422\u0435\u043e\u0440\u0438\u044f.<\/h3>\n<p>  <\/p>\n<p>\u041d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u2014 \u044d\u0442\u043e \u043f\u0440\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0430 \u043d\u0435 \u043f\u0440\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c. \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442, \u043d\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u0441\u0435\u0431\u044f \u043f\u0440\u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043a\u0438 \u043e\u0447\u0435\u043d\u044c &quot;\u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0435&quot;, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u2014 \u044d\u0442\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b. \u0427\u0442\u043e-\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u0435\u0441\u0442\u044c. \u041f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u043d\u0430 \u0442\u044b\u0441\u044f\u0447\u0430\u0445, \u0432 \u043b\u0443\u0447\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u043e\u0442\u043e\u043a\u0430\u0445. \u0421 \u0434\u0435\u0441\u044f\u0442\u043a\u0430\u043c\u0438 \u0442\u044b\u0441\u044f\u0447 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0437\u0430\u043c\u0435\u0442\u043d\u044b, \u0441 \u0441\u043e\u0442\u043d\u044f\u043c\u0438 \u2014 \u0438\u0445 \u043d\u0435 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c. \u0422\u0430\u043a \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u043e\u0435, \u043e \u0447\u0435\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u2014 \u0430 \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0442\u0430\u043a\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439? \u0418\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0438\u043d\u043e\u0433\u0434\u0430 \u043e \u0442\u0430\u043a\u0438\u0445 \u043e\u0431\u044a\u0435\u043c\u0430\u0445 \u0440\u0435\u0447\u0438 \u043d\u0435 \u0438\u0434\u0435\u0442 \u0438 \u0441\u043c\u044b\u0441\u043b \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e API \u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f. \u041f\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u044b\u043c API \u044f \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e \u043d\u0435 JDBC, \u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u043e\u0432\u0435\u0440\u0445 \u043d\u0435\u0433\u043e \u2014 JPA, JOOQ, Hibernate ORM \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u043d\u0435 \u0438\u0437-\u0437\u0430 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043d\u043e \u0438 \u0438\u0437-\u0437\u0430 &quot;\u0431\u0443\u0442\u044b\u043b\u043e\u0447\u043d\u044b\u0445 \u0433\u043e\u0440\u043b\u044b\u0448\u0435\u043a&quot; \u2014 \u043e\u0434\u0438\u043d \u043f\u0443\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0431\u0430\u0437\u0435 \u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043a \u0438\u0437 \u043f\u0443\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u043b\u0441\u044f \u0431\u044b \u0440\u0430\u043d\u044c\u0448\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u0441\u044f\u0442\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043b\u0435\u0437\u0435\u0442 \u0432 \u0431\u0430\u0437\u0443 \u0438 \u0432\u0438\u0441\u043d\u0435\u0442. \u0420\u0430\u043d\u044c\u0448\u0435 \u0443 \u043d\u0430\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0438 \u0433\u043b\u0443\u043f\u044b\u0435 \u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u0435\u0437\u043b\u0438 \u0432 \u0431\u0430\u0437\u0443 \u0438 \u0443\u0436 \u0435\u0441\u043b\u0438 \u0442\u0430\u043c \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043b\u043e \u2014 \u043f\u0440\u043e\u043f\u0430\u043b\u043e \u0432\u0441\u0435 (\u0443\u043f\u0440\u043e\u0449\u0430\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443). \u0421\u0435\u0439\u0447\u0430\u0441 \u0443 \u043d\u0430\u0441 \u043a\u0443\u0447\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439 \u0438 \u043c\u044b \u043b\u0435\u0437\u0435\u043c \u0438\u0437 \u043a\u043e\u0434\u0430 \u0432\u043e \u0432\u0441\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0432\u043e \u0432\u0441\u044f\u043a\u0438\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438 \u0431\u0430\u0437\u044b, \u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0443\u043b\u0430\u043c\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430\u043c \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 &quot;\u0431\u0443\u0442\u044b\u043b\u043e\u0447\u043d\u044b\u0445 \u0433\u043e\u0440\u043b\u044b\u0448\u0435\u043a&quot; \u043c\u043e\u0433\u0443\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0447\u0435\u043c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u043b \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u0447\u0435\u0440\u043f\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0431\u0430\u0437\u044b, \u0430 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0442\u043e\u043a &quot;\u0443\u0442\u0435\u043a&quot; \u0438 \u0437\u0430\u0432\u0438\u0441 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. <\/p>\n<p>  <\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 1<\/strong>: \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043d\u0430 \u043f\u0443\u043b\u0435 \u043f\u044f\u0442\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u044b \u043a \u0432\u0435\u0431-\u0441\u0442\u0435\u043a\u0443 (\u0430 \u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u0431\u0430\u0437\u044b \u2014 \u043d\u0443 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0441\u0442\u044f\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u0434\u0435\u043b\u0430\u0442\u044c) \u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u044f\u0442\u044c\u0434\u0435\u0441\u044f\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u043d\u0438 \u0432\u0441\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043d\u044f\u0442\u044b \u0438 \u043d\u0438 \u043e\u0434\u0438\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u0442. \u0415\u0441\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439, \u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u0441\u044f\u0442\u044b\u0439 (\u043f\u043e\u0441\u043b\u0435 \u043f\u044f\u0442\u0438\u0434\u0435\u0441\u044f\u0442\u043e\u0433\u043e) \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0441\u043d\u0443\u0442\u044c, \u0430 \u0434\u0435\u0432\u044f\u0442\u044c \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043d\u0430\u0434\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0431\u0438\u0440\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u044d\u0448\u0430). <\/p>\n<p>  <\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 2<\/strong>: \u0412\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043a \u0431\u0430\u0437\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u0430\u043a \u043d\u0430\u0434\u043e, \u043f\u0443\u043b \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043a \u0432\u0432\u043e\u0434\u0443 \u0432\u044b\u0432\u043e\u0434\u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439. \u0412\u0440\u043e\u0434\u0435 \u0432\u0441\u0435 \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435. \u0412\u0434\u0440\u0443\u0433 \u043a\u0442\u043e-\u0442\u043e \u0434\u043e\u043f\u0438\u0441\u0430\u043b \u043a\u043e\u0434, \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0432 \u043d\u0430\u0448 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0430\u0433\u0430\u0449\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u0441\u044f\u0442\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438\u0437 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e REST \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0434\u0430 \u0435\u0449\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0435. \u0412\u043e\u0442 \u043f\u043e\u0442\u043e\u043a &quot;\u0443\u0442\u0435\u043a&quot; \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0438 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0440\u043e\u0441, \u0445\u043e\u0442\u044f \u043c\u043e\u0433 \u0431\u044b.<\/p>\n<p>  <\/p>\n<p>\u0415\u0449\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e &quot;\u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439&quot; \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043a &quot;\u043f\u043e\u0442\u043e\u043a\u0443&quot;, \u0430 \u043d\u0435 \u043a \u0447\u0435\u043c\u0443-\u0442\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u043c\u0443. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f &quot;\u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0435&quot; \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0447\u0435\u0433\u043e-\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0436\u0434\u0430\u0442\u044c. \u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0443 \u043d\u0430\u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0411\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0438\u043b\u0438 \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0443 \u043d\u0430\u0441 \u0432\u0432\u043e\u0434-\u0432\u044b\u0432\u043e\u0434, \u0430 &quot;\u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e&quot; \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0443\u043b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439. \u0416\u0434\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e, \u0445\u043e\u0442\u044f \u043f\u043e\u0442\u043e\u043a\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u2014 \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u0447\u0435\u043c-\u0442\u043e, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0435, \u043e \u0447\u0435\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u2014 \u044d\u0442\u043e \u043e\u0431\u0449\u0438\u0439 \u0441\u0442\u0438\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043f\u043e\u043c\u0438\u043c\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u2014 \u043a\u0430\u043a \u0432 &quot;\u041f\u0440\u0438\u043c\u0435\u0440\u0435 2&quot;. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u043e\u0431 \u044d\u0442\u043e\u043c \u0442\u0432\u0435\u0440\u0434\u044f\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0442\u043e\u0440\u043e\u043c \u043c\u0438\u0442\u0430\u043f\u0435 \u043e \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 \u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442.<\/p>\n<p>  <\/p>\n<h3 id=\"chto-plohogo-v-neblokiruyuschih-biblitekah-teoriya\">\u0427\u0442\u043e \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u0432 \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u0442\u0435\u043a\u0430\u0445. \u0422\u0435\u043e\u0440\u0438\u044f.<\/h3>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435: \u041f\u043b\u043e\u0445\u043e, \u0447\u0442\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\/\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0442 (\u0442\u043e\u043b\u044c\u043a\u043e Spring Data R2DBC \u043d\u0430\u0448\u0435\u043b). \u0414\u043b\u044f JDBC \u0435\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u2014 JPA, JOOQ, Hibernate ORM, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0434\u043e\u0440\u043e\u0432\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044e\u0442 \u0436\u0438\u0437\u043d\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u0422\u0430\u043c \u0438 \u043a\u044d\u0448 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0438, \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 \u043d\u0443 \u0438 \u0432\u0441\u044f\u043a\u043e\u0435, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0437\u0430 \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442. \u041f\u0443\u043b\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 \u2014 \u0432\u0441\u0435 \u044d\u0442\u043e \u043b\u0438\u0431\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u043b\u0438\u0431\u043e \u0431\u0435\u0437\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0435: \u042d\u0442\u043e \u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e \u0438 \u043f\u043e\u043a\u0430 \u043f\u043b\u043e\u0445\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041f\u043e\u0434 \u044d\u0442\u0438\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0432\u0435 \u0432\u0435\u0449\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0438 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442\u0434\u0430\u044e\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 JDBC \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430\u043c, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u043f\u0438\u0448\u0443\u0442 \u0438\u043b\u0438 \u0437\u0430\u043f\u0430\u0437\u0434\u044b\u0432\u0430\u044e\u0442 \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438, \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043d\u043e\u0432\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0431\u0430\u0437 \u0432 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/li>\n<li>\u043d\u0435 \u0432\u0441\u044f\u043a\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Oracle \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"vertx-sql-pg-client\">Vert.X SQL (PG) Client.<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430\u0431\u043e\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043e\u0442 Eclipse, \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 <a href=\"https:\/\/github.com\/eclipse-vertx\/vertx-sql-client\" rel=\"nofollow\">GitHub<\/a> \u0438 <a href=\"https:\/\/vertx.io\/docs\/vertx-pg-client\/java\/\" rel=\"nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a> \u0434\u043b\u044f Postgres.<br \/>  \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438: <\/p>\n<p>  <\/p>\n<ul>\n<li>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f PostgreSQL, MySQL, MSSQL, DB2<\/li>\n<li>\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 callback, \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 RxJava2. \u041d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d \u043d\u0430\u0441\u0447\u0435\u0442 \u043a\u043e\u0440\u0443\u0442\u0438\u043d Kotlin, \u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e.<\/li>\n<li>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 vert.x \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 Quarkus.<\/li>\n<li>\u0411\u044b\u0441\u0442\u0440\u0430\u044f. <\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u2192 <a href=\"https:\/\/www.techempower.com\/benchmarks\/#section=data-r18&amp;hw=ph&amp;test=db\" rel=\"nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430<\/a> \u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c\u0443 \u043f\u0443\u043d\u043a\u0442\u0443<\/p>\n<p>  <\/p>\n<p>\u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0440\u043e\u0434\u0435 H2, \u0447\u0442\u043e \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445. \u0415\u0441\u0442\u044c \u043d\u0435\u0434\u0430\u0432\u043d\u044f\u044f \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f <a href=\"https:\/\/habr.com\/ru\/post\/501454\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a> \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0434\u043e \u043d\u0430 \u0442\u043e\u0439 \u0431\u0430\u0437\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d\u0435, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u0440\u0435\u0446\u0435\u043f\u0442 \u0443\u0441\u043f\u0435\u0445\u0430 \u0438 \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.<\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c\u0443 (rxjava2) \u0435\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0443 \u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u043c\u043e\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">    &lt;dependency&gt;       &lt;groupId&gt;io.vertx&lt;\/groupId&gt;       &lt;artifactId&gt;vertx-pg-client&lt;\/artifactId&gt;       &lt;version&gt;3.9.0&lt;\/version&gt;     &lt;\/dependency&gt;     &lt;dependency&gt;       &lt;groupId&gt;io.vertx&lt;\/groupId&gt;       &lt;artifactId&gt;vertx-rx-java2&lt;\/artifactId&gt;       &lt;version&gt;3.9.0&lt;\/version&gt;     &lt;\/dependency&gt;     &lt;dependency&gt;       &lt;groupId&gt;io.netty&lt;\/groupId&gt;       &lt;artifactId&gt;netty-transport-native-epoll&lt;\/artifactId&gt;       &lt;version&gt;4.1.15.Final&lt;\/version&gt;       &lt;classifier&gt;linux-x86_64&lt;\/classifier&gt;     &lt;\/dependency&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0443\u043b \u0438 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 API:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">import io.vertx.pgclient.PgConnectOptions; import io.vertx.reactivex.pgclient.PgPool; import io.vertx.reactivex.sqlclient.Pool; import io.vertx.reactivex.sqlclient.Tuple; import io.vertx.sqlclient.PoolOptions;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f. \u0412\u0430\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c prepared statement \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0443\u043b\u0430 \u2014 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">        PgConnectOptions connectOptions = new PgConnectOptions()                 .setPort(5432)                 .setHost(host)                 .setDatabase(&quot;postgres&quot;)                 .setCachePreparedStatements(true)                 .setPreparedStatementCacheMaxSize(1000)                 .setSsl(false)                 .setUser(user)                 .setPassword(password);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u043f\u0443\u043b\u0430 \u0441 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c <em>pool<\/em> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 50). <\/p>\n<p>  <\/p>\n<pre><code class=\"java\">       PoolOptions poolOptions = new PoolOptions()                 .setMaxSize(pool);         Pool client = PgPool.pool(connectOptions, poolOptions);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c \u043e\u0442\u0432\u0435\u0442\u043e\u043c <em>\u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438<\/em>. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<ol>\n<li><em>\u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438<\/em> \u0434\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u0443\u043b\u0430<\/li>\n<li>\u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, <em>\u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438<\/em> \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441<\/li>\n<li>\u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, <em>\u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438<\/em> \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0432 <em>Tuple<\/em><\/li>\n<li>\u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 <em>RowSet<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>Iterable<\/em><\/li>\n<li>\u043f\u0440\u043e\u0448\u043b\u0438\u0441\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0438 \u0432\u044b\u0442\u0430\u0449\u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u043a\u043e\u043b\u043e\u043d\u043a\u0438.<\/li>\n<li>\u0432\u0435\u0440\u043d\u0443\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0432 \u043f\u0443\u043b, &quot;\u0437\u0430\u043a\u0440\u044b\u0432&quot; \u0435\u0433\u043e.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u043d\u0430 \u043f\u0443\u043b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439.<br \/>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a <strong>$1 $2 $3<\/strong> \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041c\u0435\u0442\u043e\u0434\u044b, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 <em>rx<\/em> \u2014 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0434\u043b\u044f RxJava2, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 vert.x. \u0411\u0435\u0437 \u043d\u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u044b\u0433\u0440\u0430\u0442\u044c \u0432 callback hell. \u0415\u0441\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 RxJava2 \u043e\u0431\u0435\u0440\u0442\u043a\u0435, \u0432\u044b\u0439\u0434\u0435\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">        Flowable&lt;String&gt; titles = client.rxGetConnection()                 .flatMapPublisher(connection -&gt;                         connection.rxPrepare(&quot;SELECT title FROM nicer_but_slower_film_list WHERE FID = $1&quot;)                                 .flatMap(statement -&gt; statement.query().rxExecute(Tuple.of(Math.abs(random.nextInt(990)))))                                 .flattenAsFlowable(Functions.identity())                                 .map(row -&gt; row.getString(&quot;title&quot;))                                 .doOnError(Throwable::printStackTrace)                                 .subscribeOn(Schedulers.computation())                                 .doFinally(connection::close));<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0443\u043b \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044c<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">client.close();<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"r2dbc\">R2DBC<\/h3>\n<p>  <\/p>\n<p>\u2192\u00a0<a href=\"https:\/\/r2dbc.io\/\" rel=\"nofollow\">\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u2014 MariaDB, MySQL, PostgreSQL, MSSQL, H2<\/li>\n<li>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0432 Spring Data R2DBC, \u0447\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u043e\u0434 Spring Boot<\/li>\n<li>\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 Reactive Streams, \u043f\u043e\u043e\u0449\u0440\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u043d\u0438\u0435 Project Reactor<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u043f\u0443\u043b\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">    &lt;dependency&gt;       &lt;groupId&gt;io.r2dbc&lt;\/groupId&gt;       &lt;artifactId&gt;r2dbc-postgresql&lt;\/artifactId&gt;       &lt;version&gt;0.8.2.RELEASE&lt;\/version&gt;     &lt;\/dependency&gt;     &lt;dependency&gt;       &lt;groupId&gt;io.r2dbc&lt;\/groupId&gt;       &lt;artifactId&gt;r2dbc-pool&lt;\/artifactId&gt;       &lt;version&gt;0.8.2.RELEASE&lt;\/version&gt;     &lt;\/dependency&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0443\u043b\u043e\u043c \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0434\u0435\u0442 \u0438 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 Project Reactor.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">import io.r2dbc.pool.ConnectionPool; import io.r2dbc.pool.ConnectionPoolConfiguration; import io.r2dbc.spi.ConnectionFactories; import io.r2dbc.spi.ConnectionFactory; import io.r2dbc.spi.ConnectionFactoryOptions;  import reactor.core.publisher.Flux; import reactor.core.publisher.Mono;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0442\u0440\u043e\u0438\u043c \u0444\u0430\u0431\u0440\u0438\u043a\u0443 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0438 \u043f\u0443\u043b. Prepared Statement \u043a\u044d\u0448\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u0434\u0430, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u043f\u043e\u043d\u044f\u043b \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">        ConnectionFactory connectionFactory = ConnectionFactories.get(ConnectionFactoryOptions.builder()                 .option(DRIVER, &quot;postgresql&quot;)                 .option(HOST, host)                 .option(PORT, 5432)  \/\/ optional, defaults to 5432                 .option(USER, user)                 .option(PASSWORD, password)                 .option(DATABASE, &quot;postgres&quot;)  \/\/ optional                 .option(SSL, false)  \/\/ optional                 .build());         ConnectionPoolConfiguration configuration = ConnectionPoolConfiguration.builder(connectionFactory)                 .maxIdleTime(Duration.ofMillis(1000))                 .maxSize(poolSize)                 .build();          ConnectionPool pool = new ConnectionPool(configuration);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c \u043e\u0442\u0432\u0435\u0442\u043e\u043c <em>\u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438<\/em>. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<ol>\n<li><em>\u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438<\/em> \u0434\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u0443\u043b\u0430<\/li>\n<li>\u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441<\/li>\n<li>\u0437\u0430\u0434\u0430\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/li>\n<li><em>\u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438<\/em> \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441<\/li>\n<li>\u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u043e\u0442\u043e\u043a <em>Result<\/em><\/li>\n<li>\u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 mapper-\u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 <em>\u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438<\/em> \u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/li>\n<li>\u0432\u0435\u0440\u043d\u0443\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0432 \u043f\u0443\u043b, <em>\u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0432<\/em> &quot;\u0437\u0430\u043a\u0440\u044b\u0442\u044c&quot; \u0435\u0433\u043e.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0443\u043d\u043a\u0442 \u2014 \u0434\u043b\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u0443\u043b \u0438\u043b\u0438 \u0434\u043b\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <em>close<\/em>, \u043d\u0430\u0434\u043e \u0435\u0449\u0435 \u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a <strong>$1 $2 $3<\/strong> \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 Project Reactor \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">        Flux&lt;String&gt; titles = Flux.usingWhen(pool.create(), connection -&gt;                         Flux.from(                                 connection.createStatement(&quot;SELECT title FROM nicer_but_slower_film_list WHERE FID = $1&quot;)                                         .bind(&quot;$1&quot;, Math.abs(random.nextInt(990)))                                         .execute()                         ).flatMap(result -&gt; result.map(RdbcTest::getTitle))                 , Connection::close);              private static String getTitle(Row row, RowMetadata meta) {         return row.get(&quot;title&quot;, String.class);     } <\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0443 \u0438 \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u043f\u0443\u043b \u0432 \u043a\u043e\u043d\u0446\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">       pool.close();<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"imitaciya-nagruzki\">\u0418\u043c\u0438\u0442\u0430\u0446\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/h3>\n<p>  <\/p>\n<p>\u042f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e &quot;\u0432\u0447\u0438\u0441\u0442\u0443\u044e&quot; \u0433\u043e\u043d\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0431\u0430\u0437\u0435 \u0441\u043c\u044b\u0441\u043b\u0430 \u043c\u0430\u043b\u043e, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0430 \u0441 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u0438 \u043e\u0442\u043b\u043e\u0432\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0431\u0430\u0433\u0438. \u0411\u0443\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 R2DBC, VertX \u0438 JDBC. <em>Executions<\/em> (\u0441\u043a\u0430\u0436\u0435\u043c, 50 000) \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e <em>concurrency<\/em> (\u0441\u043a\u0430\u0436\u0435\u043c, 1000) \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0425\u0432\u0430\u043b\u0430 backpressure.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0448\u0443 \u043d\u0435 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0441\u0442, \u043b\u0438\u0448\u044c \u043a\u0430\u043a \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0442\u044e\u043d\u0438\u043d\u0433\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043b\u0443\u0447\u0448\u0435 \u0442\u0430\u0449\u0438\u0442\u044c \u0443 \u0442\u0435\u0445, \u043a\u0442\u043e \u044d\u0442\u0438\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u0438\u0441\u0442\u0440\u0430\u0441\u0442\u043d\u043e) \u0438\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u0438\u043c \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">VertX<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">        Flowable.range(1, executions)                 .doOnNext(i -&gt; { if (i % chunk == 0) LOGGER.info(&quot;Process {}&quot;, i);})                 .flatMap(i -&gt; client.preparedQuery(                         &quot;SELECT title FROM nicer_but_slower_film_list WHERE FID = $1&quot;)                                 .rxExecute(Tuple.of(Math.abs(random.nextInt(990))))                                 .doOnError(Throwable::printStackTrace)                                 .flattenAsFlowable(Functions.identity())                                 .map(row -&gt; row.getString(&quot;title&quot;).length())                                 .doOnError(Throwable::printStackTrace)                                 .subscribeOn(Schedulers.computation()),                         false, concurrency)                 .doOnComplete(() -&gt; LOGGER.info(&quot;Done with VertX&quot;))                 .blockingSubscribe(unused -&gt; {                }, Throwable::printStackTrace);<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">R2DBC<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">        Flux.range(1, executions)                 .doOnNext(i -&gt; {  if (i % chunk == 0) LOGGER.info(&quot;Processing {}&quot;, i);})                 .flatMap(i -&gt; Flux.usingWhen(pool.create(),                         connection -&gt; Flux.from(                                 connection.createStatement(&quot;SELECT title FROM nicer_but_slower_film_list WHERE FID = $1&quot;)                                         .bind(&quot;$1&quot;, Math.abs(random.nextInt(990)))                                         .execute()                         )                                 .flatMap(result -&gt; Flux.from(result.map(RdbcTest::getTitle))),                         Connection::close)                                 .subscribeOn(Schedulers.parallel())                                 .doOnError(Throwable::printStackTrace)                         , concurrency)                 .doOnError(Throwable::printStackTrace)                 .doOnComplete(() -&gt; LOGGER.info(&quot;Done with R2DBC&quot;))                 .blockLast();<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">JDBC + Hikari Pool + Reactor<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">       HikariConfig config = new HikariConfig();         config.setJdbcUrl(&quot;jdbc:postgresql:\/\/&quot; + host + &quot;\/postgres&quot;);         config.setMaximumPoolSize(poolSize);         config.setIsolateInternalQueries(false);          HikariDataSource ds = new HikariDataSource(config);          Flux.range(1, executions)                 .flatMap(Mono::just)                 .flatMap(index -&gt; Mono.fromCallable(ds::getConnection)                                 .doOnNext(i -&gt; { if (index % chunk == 0) LOGGER.info(&quot;Process {}&quot;, index);})                                 .map(this::request).subscribeOn(Schedulers.elastic())                         , concurrency                 )                 .subscribeOn(Schedulers.elastic())                 .doOnError(Throwable::printStackTrace)                 .doOnComplete( ()-&gt;LOGGER.info(&quot;Done with JDBC&quot;))                 .blockLast();      private Integer request(Connection connection) {         try {             var s = connection.prepareStatement(                     &quot;SELECT title FROM nicer_but_slower_film_list WHERE FID = ?&quot;             );             s.setInt(1, Math.abs(random.nextInt(990)));             var results = s.executeQuery();             int counter = 0;             while (results.next()) {                 counter += results.getString(&quot;title&quot;).length();             }             results.close();             s.close();             connection.close();             return counter;         } catch (RuntimeException e) {             e.printStackTrace();             throw e;         } catch (Exception e) {             e.printStackTrace();             throw new IllegalStateException(e);         }     }<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0425\u043e\u0447\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <em>time<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">\/usr\/bin\/time --verbose java ...<\/code><\/pre>\n<p>  <\/p>\n<p>\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 Java Mission Control \u2014 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0449\u0443 Java Flight Recorder.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">java -XX:StartFlightRecording=disk=true,dumponexit=true,filename=\/tmp\/r2dbc.jfr,settings=profile,path-to-gc-roots=false,delay=1s,name=R2DBC ...<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b <em>time<\/em> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432\u0440\u0435\u043c\u044f \u0432 userspace \u0438 \u0432 system, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041d\u0430 \u043c\u043e\u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0445 VertX \u0432\u044b\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u043b\u0435\u043a\u043e \u0432\u043f\u0435\u0440\u0435\u0434, R2DBC \u0438 JDBC \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0447\u0430\u0449\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442. \u042d\u0442\u043e \u0432\u0441\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0445 &quot;\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432&quot; \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u0443\u043b\u0430 (\u044d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u043a\u0442\u043e\u0440 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0443 \u043c\u0435\u043d\u044f). \u041f\u043e\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0430\u043c\u0438 R2DBC \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 \u0432 system \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0438\u043d\u043e\u0433\u0434\u0430 \u0432 userspace. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u043a\u043e\u043f\u0430\u0442\u044c \u0433\u043b\u0443\u0431\u0436\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 vertx \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043d\u0430 <em>\u044d\u0442\u0438\u0445<\/em> \u043f\u0440\u043e\u0433\u043e\u043d\u0430\u0445.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">time R2DBC<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">        Command being timed: &quot;java -jar r2dbc-1.0-SNAPSHOT-jar-with-dependencies.jar -iterations 50000 -concurrent 1000 -pool 50 -user anonymous -password 12345678 -host pg12.local&quot;         User time (seconds): 34.28         System time (seconds): 5.55         Percent of CPU this job got: 10%         Maximum resident set size (kbytes): 307004         Minor (reclaiming a frame) page faults: 76835         Voluntary context switches: 121789         Involuntary context switches: 9670<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">time JDBC<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">        Command being timed: &quot;java -jar jdbc-1.0-SNAPSHOT-jar-with-dependencies.jar -iterations 50000 -concurrent 1000 -pool 50 -user anonymous -password 12345678 -host pg12.local&quot;         User time (seconds): 38.72         System time (seconds): 5.80         Percent of CPU this job got: 76%         Maximum resident set size (kbytes): 459688         Minor (reclaiming a frame) page faults: 125453         Voluntary context switches: 187752         Involuntary context switches: 14221<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">time VertX<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">        Command being timed: &quot;java -jar vertx-1.0-SNAPSHOT-jar-with-dependencies.jar -iterations 50000 -concurrent 1000 -pool 50-user anonymous -password 12345678 -host pg12.local&quot;         User time (seconds): 19.06         System time (seconds): 2.02         Percent of CPU this job got: 20%         Maximum resident set size (kbytes): 178516         Minor (reclaiming a frame) page faults: 43054         Voluntary context switches: 109914         Involuntary context switches: 4691<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 Java Mission Control? JDBC \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0447\u0430\u0449\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 GC. \u0417\u0430\u0442\u043e \u0435\u0441\u0442\u044c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0449\u0438\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0434\u043b\u044f \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0439 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Threads. <\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0435<\/p>\n<p>  <\/p>\n<p>R2DBC:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/km\/cw\/ba\/kmcwbapdg8tnrfavnzzbuvif54e.png\" alt=\"R2DBC\"><\/p>\n<p>  <\/p>\n<p>VertX:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hq\/9b\/8a\/hq9b8afsns4msbp7b1wevxlcq-e.png\" alt=\"VertX\"><\/p>\n<p>  <\/p>\n<p>\u0418 &quot;\u0436\u0443\u0442\u043a\u0438\u0439&quot; JDBC:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2n\/vf\/wu\/2nvfwushb-bwcej3y-zwngfhpho.png\" alt=\"JDBC\"><\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u043a\u0440\u0430\u0441\u043d\u043e\u0435, \u0432\u0441\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043e. \u0423\u0436\u0430\u0441 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b. \u041d\u0443 \u043d\u0430 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c &quot;\u0438 \u0447\u0442\u043e?&quot;. \u0421\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 \u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u0447\u0435\u0440\u0442\u043e\u0447\u043a\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0447\u0430\u0442 \u0438 \u0441\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u043c\u0435\u0448\u0430\u044e\u0442 \u0434\u0440\u0443\u0433\u0438\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412\u043e\u0442 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043d\u043e \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0430!<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/501432\/\"> https:\/\/habr.com\/ru\/post\/501432\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/501432\/\">\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a SQL \u0431\u0430\u0437\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 <em>Vert.X SQL<\/em> \u0438 <em>R2DBC<\/em>. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430 PostgreSQL \u0438 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043e\u0431\u0435\u0440\u0442\u043a\u0430\u0445 Java. <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vm\/46\/dl\/vm46dlyyevwn43fkcov62egi-no.jpeg\"><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e: JDBC \u2014 \u044d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442. \u0421\u043b\u0443\u0436\u0438\u043b \u0438 \u0441\u043b\u0443\u0436\u0438\u0442 \u0432\u0435\u0440\u043e\u0439 \u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u0439.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e <a href=\"https:\/\/habr.com\/ru\/post\/500446\/\">\u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u044f\u043d\u0438\u044f<\/a> \u043f\u0440\u043e\u0441\u044f\u0442 \u043d\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u0418 \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u043c\u044b\u0441\u043b \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u0442\u0435\u0441\u043d\u0438\u0442\u044c JDBC.<\/p>\n<p>  <\/p>\n<p>\u042f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0434\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a SQL \u0431\u0430\u0437\u0430\u043c \u0438\u0437 JVM \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0438\u0445 (\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439) \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0430\u0442\u044b\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043a\u0441\u0442, \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u043e\u0440\u0438\u044f \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-303459","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/303459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=303459"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/303459\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=303459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=303459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=303459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}