Reader small image

You're reading from  Microservices with Clojure

Product typeBook
Published inJan 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781788622240
Edition1st Edition
Languages
Right arrow
Author (1)
Anuj Kumar
Anuj Kumar
author image
Anuj Kumar

Anuj Kumar is the co-founder and chief architect of FORMCEPT, a data analytics startup based in Bangalore, India. He has more than 10 years of experience in designing large-scale distributed systems for storage, retrieval, and analytics. He has been in industry hacking, mainly in the area of data integration, data quality, and data analytics using NLP and machine learning techniques. He has published research papers at ACM conferences, got a few patents granted, and has spoken at TEDx. Prior to FORMCEPT, he has worked with the Oracle Server Technologies division in Bangalore, India.
Read more about Anuj Kumar

Right arrow

Managing application states with mount


Once the configuration parameters are defined using Omniconf, they are accessible across the namespaces as immutable data. The configuration parameters are often used to create stateful objects, such as database connections. For example, in the Consumer service project, Omniconf made it possible to create a consumer database by directly looking up the :datomic :uri configuration parameter within the create-consumer-database function.

The helping-hands.consumer.persistence/create-consumer-database function has a side effect of database being created and also a new connection being initialized to connect to the created database. This connection has a state that must be shared across other namespaces of the Helping Hands Consumer service that need access to the database. In the current implementation, the connection was initialized at the first call to the helping-hands.consumer.core/consumerdb as shown here:

(ns helping-hands.consumer.core
  "Initializes...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Microservices with Clojure
Published in: Jan 2018Publisher: PacktISBN-13: 9781788622240

Author (1)

author image
Anuj Kumar

Anuj Kumar is the co-founder and chief architect of FORMCEPT, a data analytics startup based in Bangalore, India. He has more than 10 years of experience in designing large-scale distributed systems for storage, retrieval, and analytics. He has been in industry hacking, mainly in the area of data integration, data quality, and data analytics using NLP and machine learning techniques. He has published research papers at ACM conferences, got a few patents granted, and has spoken at TEDx. Prior to FORMCEPT, he has worked with the Oracle Server Technologies division in Bangalore, India.
Read more about Anuj Kumar