Techniques for obtaining a closest match connection to a resource (e.g., a database) from a cache are provided. The request specifies desired attribute values for the connection and a closest match connection is identified. The attributes can have associated weights that are utilized in order to determine the closest match connection to satisfy the connection request.