SCIM (
http://www.simplecloud.info/) is a really interesting standard which is about REST APIs for shipping user identities around between cloud platforms.
It appears to have some heavy hitters behind it. The initial version was by some accounts a little wild and woolly but 2.0 seems pretty well thought out.
Your requirements might map pretty well to SCIM users and groups (i.e., where your users can be members of one or more groups).
As far as the microservices angle goes, some of the conventional wisdom is that microservices should not share state (e.g a shared database). If you buy into this, it follows that Jørn's suggestion of...
- A users service (that only knows about users)
- A companies service (that only knows about companies)
- An employment service (that knows about both users and companies).
... is a good thing in terms of making services smaller.
But it means that the bogeyman of microservices - replication - rears its head.
Practically speaking, for the employment service to be able to offer much in the way of searching employments (as one example), while not sharing a database with the users and companies services, , it will instead need to replicate inwards from the users service and the companies services. That's because normally complex searching boils down to joins.
Replication is not necessarily a bad or overly difficult thing, but its clearly more moving parts.
If, on the other hand, a user is never interesting on its own, and nor is a company - i,e your system is all about the employments - then what's the point in trying to keep three separate services? It would be far easier just to build one which spans users, companies and employments in one shared database. Making things smaller and smaller ad infinitum to achieve some goal like < X lines of code is ideology.
Like any other endeavour, sizing and bounding microservices always boils down to ... it depends.