Share & Socket — an engineering notebook

Every company’s most valuable data is sitting on a file share nobody wants to touch.

Share & Socket is about the plumbing: Java and the JVM, the file protocols that still carry most corporate documents, and the slow, careful work of getting that data into modern cloud and AI systems without breaking anything on the way.

For backend developers, platform engineers and the person who inherited the NAS.

clientsmb2 handshakeserver
NEGOTIATE — which dialects do you speak?
3.1.1, signing required
SESSION_SETUP — here’s who I am
session granted
TREE_CONNECT \\fileserver\finance
CREATE Q3-forecast.xlsx
READ offset 0, 64 KB
data
CLOSE

Simplified. Eight messages to read one file — and every one can fail differently.

what we write about

Three layers of the stack.

Most writing about software stays on one layer. The interesting problems — and the expensive ones — happen where the layers meet.

L3

Data to AI

indexing · extraction · retrieval · API costs

Turning decades of documents on shared drives into something an AI system can search and reason over: permissions, file formats, chunking, embeddings, and the model bill that arrives at the end of the month.

L2

Files & Protocols

SMB · NFS · S3 · NAS · migrations

How data actually moves between machines. Protocol versions, authentication, locking, the security history, and the practical business of moving millions of files from an old share to somewhere better.

L1

Java & the JVM

libraries · upgrades · performance · I/O

The runtime still behind a huge share of enterprise systems. Library choices, version upgrades, virtual threads, memory under load, and why the I/O code is always the part nobody wants to own.

field notes

Thirty years of one protocol.

SMB is the protocol behind the Windows “network drive”, and it’s still how most office documents move around a company. Knowing which version you’re running isn’t trivia — it decides your security, your speed and which libraries will even connect.

SMB1 / CIFS

1990s

Chatty, unencrypted and exploited by WannaCry in 2017. Removed by default from current Windows. Turn it off.

SMB 2.0

2006 · Vista

A near-rewrite: far fewer commands, larger reads and writes, much better over slow links.

SMB 2.1

2009 · Windows 7

Better leasing and caching, so clients make fewer round trips to the server.

SMB 3.0

2012 · Server 2012

Encryption, multichannel and transparent failover — the version that made SMB fit for data centres.

SMB 3.0.2

2013 · Windows 8.1

Refinements to performance and the option to disable SMB1 entirely.

SMB 3.1.1

2015–16 · Windows 10

Pre-authentication integrity checks and AES-GCM encryption. Today’s baseline.

reference

Three ways to store a file, compared.

Most migrations are really a move from the first two columns to the third. They behave very differently, and code written for one rarely survives the move unchanged.

SMBNFSObject storage (S3-style)
Home turfWindows offices, shared drivesLinux and Unix serversCloud applications, data lakes, backups
Default portTCP 445TCP 2049HTTPS 443
ModelFiles and folders, stateful sessionsFiles and folders, mounted like local diskObjects in buckets, addressed by key
PermissionsWindows ACLs and Active DirectoryUnix users and groups, or KerberosBucket and object policies, IAM
Edit in placeYes, with byte-range locksYesNo — objects are replaced whole
Scales toLarge, with careLarge, with carePractically unlimited
Typical Java routeDedicated SMB client libraryMounted path via standard file APIsCloud provider SDK over HTTP
Classic gotchaOld dialects, signing and lockoutsUser ID mismatches between machinesNo real folders; renames are copies

the pipeline everyone is building

From \\fileserver to “ask the AI”.

Every company wants its documents searchable by an AI assistant. The demo takes an afternoon. The production version is six stages, and each one has a way to leak data or money.

01

Crawl

Walk the share, track what changed, respect throttling so users don’t notice.

02

Capture permissions

Record who can read each file. Skip this and the AI shows payroll to the intern.

03

Extract

Pull text out of PDFs, spreadsheets, scans and twenty-year-old Word formats.

04

Chunk

Split documents into passages small enough to retrieve, large enough to make sense.

05

Embed & index

Turn passages into vectors and store them with their permissions attached.

06

Answer

Retrieve the right passages, check access, send them to a model, cite the source.

Permissions drift.Access on the share changes every week. An index built once and never refreshed slowly becomes a data leak.
Duplicates everywhere.The same contract saved in eight folders means eight copies in the index and eight times the cost to embed it.
The model bill.Embedding a large share is a one-off cost; answering questions is forever. Choosing the model for stage six matters most.

Recently committed.

newest first

a note from the editor

Why write about plumbing?

Because it’s where systems actually fail. Nobody’s production incident starts with the elegant part of the architecture. It starts with a file share that only accepts an old protocol version, a library that hasn’t been updated since the person who added it left, or a nightly job that quietly stopped copying files three months ago.

That layer is also where the next few years of work are. Every company with an AI ambition is discovering that its most useful knowledge lives in folders on network drives, guarded by permissions nobody has reviewed in a decade. Getting it out safely is unglamorous, slow and genuinely hard. It deserves better writing than it gets.

So that’s what this is: practical notes from the boring middle of the stack, with real versions, real ports and honest trade-offs.

Mats Lindqvist

Editor, Share & Socket

Mats Lindqvist, editor of Share & Socket

Mats Lindqvist · backend engineer & editor

faq

Questions, answered once.

01

Is this the jCIFS project?

No. The jcifs.org domain was once home to the jCIFS open-source Java library. Share & Socket is an independent publication under new ownership. We don’t develop, host or support jCIFS or any fork of it, and there are no downloads here. If you need the library, look for its current maintainers through your usual package repository.

02

Is SMB1 still safe to use?

No. SMB1 was exploited at scale in the 2017 WannaCry outbreak and is no longer installed by default on current versions of Windows. If a device or application still needs it, treat that as a migration project, not a setting to leave on.

03

Should we move our file shares to object storage?

Often, but not wholesale. Object storage is cheaper and scales further, but it doesn’t support editing files in place or traditional folder permissions. Many organisations keep SMB for active collaboration and move archives and application data to object storage.

04

Why does this site write about AI costs?

Because the moment you connect a file share to an AI assistant, every question has a price. Embedding documents, running searches and generating answers all use paid model APIs, and those costs are now part of the engineering decisions we cover.

05

Do you take sponsored posts?

We don’t publish paid placements as editorial. When we mention a tool, library or service, it’s because we think it’s useful to readers.

Contact Us

We'd love to hear from you