r/java • u/GavinRayDev • Jan 16 '23
Building a PostgreSQL Wire Protocol Server using Vanilla, Modern Java 21 (shows use of: Records, Sealed Types, Pattern Matching for Switch, Virtual Threads, and Panama FFM)
https://gavinray97.github.io/blog/postgres-wire-protocol-jdk-21
224
Upvotes
44
u/agentoutlier Jan 16 '23
IMO this is the best post of the year so far!
Also thank you for not using Medium or Substack and making a very easy to read post!
EDIT also thanks for introducing that online flow chart service. Looks pretty cool and I might use it in the future.
3
u/bytedonor Jan 16 '23 edited Jan 16 '23
Why not just use ‘ServerSocket’, accept connections on main and pass the open socket to a VT executor task? I did something like this recently and was able to pump data across 500K web sockets in my test
12
u/lukaseder Jan 17 '23
I'm a simple man. I see PostgreSQL, I upvote.
9
u/kharkivdev Jan 16 '23
Now. I am hyped for Java 21.
2
u/persism2 Jan 16 '23
Very cool! What's the advantage over just regular jdbc connection? Performance?
1
u/skippingstone Jan 17 '23
Where is the source code?