# Towards Climate Smart Farming--A Reference Architecture for Integrated Farming Systems
## 3 MiFarm-CSA Architecture
### Mixed Farming as a Service
Risks associated with animal manure handling could be related to soil, water and air quality. A socially acceptable manure management system that simultaneously achieves the pressing environmental objectives while balancing the socio-economic welfare of farmers and society at large is needed. Manure management decisions involve a number of decision makers with different and conflicting views of what is acceptable in the context of sustainable development. In order to ensure that the proposed schema is complete, this kind of resource management can not be ignored. For this reason, MiFarm-CSA introduces ReMA includes a series of resource managers to provide the optimal and accurate resource allocation:  
* The Soil Manager (SOMA) aims provide optimal decisions, recommendations and case studies on how the soil quality will be maximized. While each of these decisions, recommendations and case studies represent possible techniques to effectively manage soil resources, each practice will be adequately assessed to identify possible constraints or drawbacks. * The Manure Manager (MAMA) aims to provide optimal decisions, recommendations and case studies on the manure management in Mixed Farming Systems. The utilization of livestock manure to add nutrients back to the soil is one of the key crop-livestock interactions in MFS. Manure when used as a soil amendment can benefit the soil, resulting in crop production and resilience benefits for smallholders via increased nutrient supply to crops and improved soil structure and water holding capacity. Manure has well-documented impacts on soil chemical and physical properties. * The Water Manager (WAMA) will be able to make optimal decisions on the water management on the MFS. Improving water use efficiency and water management on mixed farms is arguably the most important and high potential improvement for farmers to be climate-smart. Optimal water management strategies increase net returns and purchasing power parity of households much more than any other and perhaps presents the only viable pathway to help transition smallholder farmers out of poverty. Due to the withdrawal of market intervention policies, market volatility has increased, causing high income risk for specialized farms. Given that both global agricultural markets and agricultural policies enhanced efficiency in producing more of a same product, e.g., favouring economies of scale through intensification, enlargement and specialization, DiMaRa's goal is to assist MFS to have the flexibility to face uncertain climate and market conditions. As a service, the DiMaRa should be able to gather market-oriented data from several sources, while compiling it using big data analytics for transforming it to knowledge and recommendations. The purpose of DiMaRa lies in three axes:  
* Aggregate accurate and timely climate and market information (weather, demand, supply and prices);
* Process and analyze it in a way such that it will be transformed into usable knowledge (intelligence) using big data analytics;
* Disseminate it to mixed farming stakeholders through web and mobile applications. Data aggregation could encompass (i) data from WCCF, (ii) information about the prices of commodities which are directly or indirectly related to mixed farming ecosystems [104], (iii) data from Agriculture Market Information Services (AMIS), which constitute another source of interest with rich agriculture-related data [105] and (iv) data coming from Google marketing tools such as Google Trends and Google Keyword Tool, which will be utilized to capture near-real time data for trends in the field of agriculture. Moreover, the complete MiFarm-CSA architecture with the four layers and their interconnections is illustrated in Figure 3.