JavaScript Dev

JavaScript Dev

1607655000

A Super Simple and Easy to Use Reactive Library for Subscribing to Any Data

AsService

Use any data as a service

A super simple and easy to use reactive library for subscribing to any data. contains a hook for react js.

What does it exactly do?

It helps programmers (both back and front end) to avoid complexity of traditional state management systems such as React Redux and reactive programming pattern library like Rxjs. It is lightweight and easy to use library contains one core function and a hook for react. By using it we can subscribe vast the majority of data type such as primitive, complex, promises and function as a service and receive all changes by particular parameter (parametric subscription). We do not even need to control the subscribe-unsubscribe process in react with simple hook it do all the process automatically.

Install

npm i @barteh/as-service --save

Usage

Import library
import { AsService, Server } from "@barteh/as-service";
one: Primitive type (number | string | Array) as service
var srv1 = new AsService(5); // number as service
srv1.Observable()
.subscribe(a => console.log("ser1 data via observable is:", a));

srv1.load().then(a => console.log("ser1 data via promis:", a));
two: Pure object as service
var srv2 = new AsService({x: 9}); // object as service

srv2.Observable()
.subscribe(a => console.log("ser2 data via observable is:", a));

srv2.load().then(a => console.log("ser2 data via promis:", a));
three: Function as service (parametric observable)
var srv3 = new AsService(param => param * 3); // function as service
srv3.Observable(2) //parametric observe
.subscribe(a => console.log("ser3 data via observable is:", a));

//passing (Number) 2  as parameter
srv3.load(2).then(a => console.log("ser3 data via promis:", a));
four: Promise as service
var ser4 = new AsService(param => new Promise((res, rej) => res(`im promise with parameter: ${param}`)));

ser4.Observable("myparam")
.subscribe(a => console.log("srv4: ", a));

ser4.load("myparam");
five: XHR as Service

using built in advanced methods name [ Server ] wraps axios for retrive data from http server and localforge for cache data. Following sample uses class [ Server ] as input of AsService. You can use your own xhr library instead of this.

if http://myserver/contacts/getcontact.ctrl http REST service exists.

import {AsService,Server} from "@barteh/as-service"

var controller1 = (x, y) => Server.controller("contacts","getcontact", { name: x, lname: y });

var srv5 = new AsService(controller1);

srv5.Observable("Ahad", "Rafat")
.subscribe(a => console.log("srv5:", a));
six: observe state

current state of a service is observable states can be one of [“start”,“loading”,“idle”]

var srv6=new AsService(8);

srv6.StateObservable(77).subscribe(a=>console.log("current state is: ",a))

srv6.load(77);
Output
> ser1 data via observable is: 5
> ser2 data via observable is: { x: 9 }
> ser3 data via observable is: 6
> srv4:  im promise with parameter: myparam

seven: AsService as AsService (Recursive Service)

asn AsService can use argument of constructor with deferent mapper but same loader. this is usefull to derivate a service from other. it important if you want to decrease number of services complexity and increase reusability of code.

const ser1=new AsService([5,6,7,8]);
const ser2=new AsService(ser1,/*mapper*/ a=>a.map(b=>b*2)); //=> [10,12,14,16]
eight: derive from a Service using map() operator.

you can create new Service derived from another service using map operator. this operator sends both data and parameter to mapper function. mapper parameters can be more than loader parameters.

/*map(data,...params)*/
const ser1=new AsService((x,y)=>x+y);
const ser2=ser1.map((data,x,y,z)=>data+z);

ser1.load(/*x*/1,/*y*/,2,/*z*/,3)
.then(a=>console.log(a));
// output 
// > 6

const ser1=new AsService([5,6,7,8]);
const ser2=ser1.map(a=>a.filter(b=>b<7)); // ==> [5,6]

Test

npm test

Using Both for web and node js

Build

npm run build

Use in ES5

var { AsService } = require("@barteh/as-service");

var t = new AsService(8);

t.Observable()
.subscribe(a => console.log(a))

Download Details:

Author: barteh

Source Code: https://github.com/barteh/as-service

#react #reactjs #javascript

What is GEEK

Buddha Community

A Super Simple and Easy to Use Reactive Library for Subscribing to Any Data
Siphiwe  Nair

Siphiwe Nair

1620466520

Your Data Architecture: Simple Best Practices for Your Data Strategy

If you accumulate data on which you base your decision-making as an organization, you should probably think about your data architecture and possible best practices.

If you accumulate data on which you base your decision-making as an organization, you most probably need to think about your data architecture and consider possible best practices. Gaining a competitive edge, remaining customer-centric to the greatest extent possible, and streamlining processes to get on-the-button outcomes can all be traced back to an organization’s capacity to build a future-ready data architecture.

In what follows, we offer a short overview of the overarching capabilities of data architecture. These include user-centricity, elasticity, robustness, and the capacity to ensure the seamless flow of data at all times. Added to these are automation enablement, plus security and data governance considerations. These points from our checklist for what we perceive to be an anticipatory analytics ecosystem.

#big data #data science #big data analytics #data analysis #data architecture #data transformation #data platform #data strategy #cloud data platform #data acquisition

Gerhard  Brink

Gerhard Brink

1620629020

Getting Started With Data Lakes

Frameworks for Efficient Enterprise Analytics

The opportunities big data offers also come with very real challenges that many organizations are facing today. Often, it’s finding the most cost-effective, scalable way to store and process boundless volumes of data in multiple formats that come from a growing number of sources. Then organizations need the analytical capabilities and flexibility to turn this data into insights that can meet their specific business objectives.

This Refcard dives into how a data lake helps tackle these challenges at both ends — from its enhanced architecture that’s designed for efficient data ingestion, storage, and management to its advanced analytics functionality and performance flexibility. You’ll also explore key benefits and common use cases.

Introduction

As technology continues to evolve with new data sources, such as IoT sensors and social media churning out large volumes of data, there has never been a better time to discuss the possibilities and challenges of managing such data for varying analytical insights. In this Refcard, we dig deep into how data lakes solve the problem of storing and processing enormous amounts of data. While doing so, we also explore the benefits of data lakes, their use cases, and how they differ from data warehouses (DWHs).


This is a preview of the Getting Started With Data Lakes Refcard. To read the entire Refcard, please download the PDF from the link above.

#big data #data analytics #data analysis #business analytics #data warehouse #data storage #data lake #data lake architecture #data lake governance #data lake management

Gerhard  Brink

Gerhard Brink

1624699032

Introduction to Data Libraries for Small Data Science Teams

At smaller companies access to and control of data is one of the biggest challenges faced by data analysts and data scientists. The same is true at larger companies when an analytics team is forced to navigate bureaucracy, cybersecurity and over-taxed IT, rather than benefit from a team of data engineers dedicated to collecting and making good data available.

Creative, persistent analysts find ways to get access to at least some of this data. Through a combination of daily processes to save email attachments, run database queries, and copy and paste from internal web pages one might build up a mighty collection of data sets on a personal computer or in a team shared drive or even a database.

But this solution does not scale well, and is rarely documented and understood by others who could take it over if a particular analyst moves on to a different role or company. In addition, it is a nightmare to maintain. One may spend a significant part of each day executing these processes and troubleshooting failures; there may be little time to actually use this data!

I lived this for years at different companies. We found ways to be effective but data management took up way too much of our time and energy. Often, we did not have the data we needed to answer a question. I continued to learn from the ingenuity of others and my own trial and error, which led me to the theoretical framework that I will present in this blog series: building a self-managed data library.

A data library is _not _a data warehousedata lake, or any other formal BI architecture. It does not require any particular technology or skill set (coding will not be required but it will greatly increase the speed at which you can build and the degree of automation possible). So what is a data library and how can a small data analytics team use it to overcome the challenges I’ve described?

#big data #cloud & devops #data libraries #small data science teams #introduction to data libraries for small data science teams #data science

Database Vs Data Warehouse Vs Data Lake: A Simple Explanation

Databases store data in a structured form. The structure makes it possible to find and edit data. With their structured structure, databases are used for data management, data storage, data evaluation, and targeted processing of data.
In this sense, data is all information that is to be saved and later reused in various contexts. These can be date and time values, texts, addresses, numbers, but also pictures. The data should be able to be evaluated and processed later.

The amount of data the database could store is limited, so enterprise companies tend to use data warehouses, which are versions for huge streams of data.

#data-warehouse #data-lake #cloud-data-warehouse #what-is-aws-data-lake #data-science #data-analytics #database #big-data #web-monetization

Data Lake and Data Mesh Use Cases

As data mesh advocates come to suggest that the data mesh should replace the monolithic, centralized data lake, I wanted to check in with Dipti Borkar, co-founder and Chief Product Officer at Ahana. Dipti has been a tremendous resource for me over the years as she has held leadership positions at Couchbase, Kinetica, and Alluxio.

Definitions

  • A data lake is a concept consisting of a collection of storage instances of various data assets. These assets are stored in a near-exact, or even exact, copy of the resource format and in addition to the originating data stores.
  • A data mesh is a type of data platform architecture that embraces the ubiquity of data in the enterprise by leveraging a domain-oriented, self-serve design. Mesh is an abstraction layer that sits atop data sources and provides access.

According to Dipti, while data lakes and data mesh both have use cases they work well for, data mesh can’t replace the data lake unless all data sources are created equal — and for many, that’s not the case.

Data Sources

All data sources are not equal. There are different dimensions of data:

  • Amount of data being stored
  • Importance of the data
  • Type of data
  • Type of analysis to be supported
  • Longevity of the data being stored
  • Cost of managing and processing the data

Each data source has its purpose. Some are built for fast access for small amounts of data, some are meant for real transactions, some are meant for data that applications need, and some are meant for getting insights on large amounts of data.

AWS S3

Things changed when AWS commoditized the storage layer with the AWS S3 object-store 15 years ago. Given the ubiquity and affordability of S3 and other cloud storage, companies are moving most of this data to cloud object stores and building data lakes, where it can be analyzed in many different ways.

Because of the low cost, enterprises can store all of their data — enterprise, third-party, IoT, and streaming — into an S3 data lake. However, the data cannot be processed there. You need engines on top like Hive, Presto, and Spark to process it. Hadoop tried to do this with limited success. Presto and Spark have solved the SQL in S3 query problem.

#big data #big data analytics #data lake #data lake and data mesh #data lake #data mesh