Categories
Apps

An Overview of Resource-Oriented Architectures

Learn about Resource-Oriented Architecture (ROA), why it is useful, and the best practices for using it.

Service-Oriented Architecture (SOA) and resource-oriented architecture (ROA) are architectural design patterns used to implement robust, scalable distributed application architectures. Distributed architectures are made up of components that are consumed across a network through well-defined interfaces. In ROA, these components are referred to as resources, while in SOA, they are referred to as services. This article presents an overview of resource-oriented architecture.

What is Resource-Oriented Architecture (ROA)?

Resource-Oriented Architecture (ROA) is a style of architecture that extends the REST architectural style and offers a broader, extensible, flexible, and transport-independent architecture. The Resource-Oriented Architecture (ROA) paradigm is built on the notion of a resource. A resource is a self-contained, identifiable entity having a state that can be assigned a uniform resource locator (URI). While a service represents the execution of a requested action, a resource represents a distributed component that is manageable through a consistent, standardized interface.

One of the characteristics of resource-oriented architecture is that they are transport-independent. So, there must be specific mechanisms for exposing resource-oriented services to the external world. When a consumer requests a Uniform Resource Locator (URL) and specifies an access method (e.g., GET, PUT, POST, & DELETE), the URL gets transformed into a relative internal URI. The access method is translated into action.

Resource-Oriented Architecture is modeled around just four concepts:

Resources
URIs
Representations
Links and Connectedness

Here are the four properties of Resource Oriented Architecture:

Addressability
Statelessness
Connectedness
A uniform interface

Resource Oriented Architecture: Resources

Resources are the building blocks of ROA; a resource is a logical representation of information. As an example, a student is an abstract collection of data points that may be represented in a variety of ways, including XHTML, JSON, and XML. A resource name comprises the following:

The type of the resource
Resource identifier
The resource name of the parent
The name of the API service.

A resource is the most crucial abstraction of information in REST or RESTful architecture. The term “resource” refers to any identifiable information. Such information can be a document, a computer, a car, a temporal service (such as “today’s weather in Ohio”), a collection of other resources, a person, a student, and so on.

Each immutable resource representation is identifiable by a relative Universal Resource Indicator (URI), and it may include connections to other resources as well as other immutable resources. Note that a resource can have multiple URIs as well.
Each resource should have the following characteristics:

Is unique
It must have a minimum of one representation
It has attributes, the schema that can be accessed and can provide a context

Uniform Resource Identifier (URI)

A Uniform Resource Identifier (URI) is a sequence of characters that contains the name and address of a resource and is used to identify a logical or a physical resource. Note that a resource must have one or more URIs. Without a URI, a piece of information is not considered a resource since it cannot be referred to or accessed. You can use URIs to identify anything such as real-world objects, web pages, books, etc.

Here’s an example of a URI:

Syntax: :

Example: http://payroll/employee/1234

The following table illustrates how relative URI for a resource can be specified:

Action
Relative URI
Purpose
Read
/student/3
Read a student record having Id as 3.
Delete
/student/4
Delete a student record having Id as 4.

Features of Resource-Oriented Architectures ROA

Here are the four basic properties of Resource-Oriented Architectures:

Addressability

Addressability is an essential feature of resource-oriented architectures. An application can be considered addressable if it publishes the interesting aspects of its data set as service endpoints. These services can be in turn, be used to work with the application’s data. Since resources in ROA are exposed using URIs, an application should expose its data using URIs.

Statelessness

Statelessness is yet another feature of resource-oriented architectures, implying that every HTTP request in this architecture happens in isolation. In other words, when the client requests a resource to the server, the client must provide every piece of information that the server might need for the request to be successful. The server never stores information from the previous requests, i.e., no state information is stored at the server. If the server needs information from an earlier request to process a request, the client must send that information again in another request.

Connectedness

In Resource-Oriented Architecture, representations are hypermedia: documents containing both data and links to other resources. RESTful web services follow the Hypermedia As The Engine Of Application State (HATEOS) principle. This is a principle in which the format of data influences the transition states in your application. The links to other resources are embedded inside the response, but they can differ for the same resource based on its current state.

One of the most significant characteristics of the web is its interconnectedness. i.e., virtually all of the information on the internet is linked together via hyperlinks. A hyperlink can be used to connect any resource that is accessible on the internet to another resource. An application built on ROA should have all of its resources linked to one another and vice versa. When we select the appropriate representation for a resource, we may achieve connectedness in an application.

A Uniform Interface

You should have a set of well-defined methods that can manipulate the resources in your application. For example, HTTP provides the following common operations you might typically need to perform in any application:

HTTP GET – Retrieve a resource
HTTP POST – Create new resources
HTTP PUT – Modify an existing resource
HTTP DELETE – Delete an existing resource

HEAD and OPTIONS HTTP Methods

Here are two other important HTTP methods you should know:

HTTP HEAD – This is used to retrieve metadata-only representation of a resource
HTTP OPTIONS – This is used to check which HTTP methods are supported by a particular resource

Summary

A resource-oriented architecture is stateless and revolves around a resource. A URI is used to identify each resource. You can always have several copies of the same resource on your computer at the same time. You can also have multiple URIs for one resource.

The post An Overview of Resource-Oriented Architectures appeared first on Developer.com.

Read more: developer.com

Categories
News

Redacted comes out of stealth with $60M in funding and a new take on fighting cybercrime

The cybersecurity industry has no shortage of technology to fight against network intruders, app corrupters, email hackers and other cyber criminals. Today a startup called Redacted is coming out of stealth with a different approach to tackling that malicious activity: It applies threat intelligence, and then proactively goes after the hackers to recover data loss and disrupt their activities. And along with its public launch, Redacted is announcing $35 million in funding to expand its business.

The Series B is being led by Ten Eleven Ventures, with participation from Valor Equity Partners and SVB Capital. (Ten Eleven is a VC specializing in cybersecurity that has backed a number of other startups.) It brings the total raised by Redacted — which it specifically styles “[redacted]”…with brackets — to $60 million, including a previous funding of $25 million.

It’s always interesting when a startup comes out of nowhere with a substantial round of VC backing, but it’s almost always because that startup has some interesting pedigree — and that is the case here. The company is led by Max Kelly, who was previously the chief security officer at Facebook and before that held roles at the National Security Agency and U.S. Cyber Command. His co-founder, John Hering, was the founder and CEO of cybersecurity firm Lookout. The startup is populated with a bigger team that the startup likes to say has “more than 300 years of combined experience” in cyber defense, with experience at Facebook, Amazon, NASA JPL, Symantec, Cisco, FBI, CIA, NSA, DIA, Army, Air Force, Navy, U.S. Marine Corps, U.S. Cyber Command and the U.K.’s GCHQ.

Cyware nabs $30M to help organizations detect and stop advanced cyberattacks

I’d actually heard about the company before — it works with another cyber startup I’ve covered called Cado, which provides cyber forensics tools to Redacted (among others). Redacted is not particularly forthcoming about its customers.

The core of what Redacted does comes out of direct experience that Kelly said he had while working at Facebook, where he both built in-house threat response tools but also worked with third-party vendors to secure the social networking giant’s systems, employees and users.

“A big focus of the industry in the last 10 years was preventing the breach,” Kelly said. “But that was always a lie. There is nothing you can do to prevent a breach. The point is not to prevent the breach but the damage from it. Make sure people can’t get data out, and if they do, make sure you can get it back.”

Cado Security locks in $10M for its cloud-native digital forensics platform

There was also the issue of the size of Facebook itself.

“We couldn’t buy any security tools that worked because of the scale of the company,” he said. “So we thought about it and decided that the best approach would be to ask who is doing this, get them to stop.”

In an environment where cybercrime has taken on the profile of some of the most advanced innovations in technology, with both bad actors and security apps and services leaning on artificial intelligence and automation to do their work, it sounds almost too human an approach. But from how Kelly describes it, it sounds like there is a very human face to cybercrime, and the mere fact of identifying bad actors can get them to retreat.

It’s also a highly technical operation: The startup has also built tools, with some of its own tech and leaning on tech built by others, to find patterns in the work that cybercriminals do and eventually track them to where they are.

“If they’re in a place where they can be touched by law enforcement, that can be used to get them to stop,” he said. “But if not, then it’s just the awareness that they’d been seen and that generally causes them to retreat.”

The mix of what Redacted has built to date, he says, is being aimed at smaller, mid-sized and slightly larger corporates, particularly those that are not capable of building tools like this themselves.

There is no cybersecurity skills gap, but CISOs must think creatively

The name, meanwhile, in my opinion says something about the nimble, but also very focused, approach the startup is taking. It comes from a period when the company hadn’t yet come up with a name for itself but was already operating commercially while in stealth mode (which actually is very standard among cybersecurity startups, I’ve found, which don’t really want a lot of attention, for obvious reasons).

“We used it as a placeholder, but I realized, as I talked to people, that they were using the name “Redacted” when referring to us,” Kelly said. He looked up redacted.com and saw it was available. “It was the universe telling me to use the name,” he said with a little smile.

“With the industry’s most advanced pursuit capabilities, Redacted has the power to teach attackers that companies will hold them accountable for attacks,” said Alex Doll, founder and managing general partner at Ten Eleven Ventures, in a statement. “Redacted’s cloud-native security platform also enables them to protect and defend companies that run their operations within a modern cloud architecture. Together, these features enable [redacted] to offer the most holistic and proactive security solution for companies in today’s elevated threat environment.” Doll is joining the board with this round.

Updated to remove the mention of a company that is not a customer.


Read more: feedproxy.google.com

Categories
Software

Eclipse iceoryx Almond supports transmitting large amounts of data quickly

The Eclipse Foundation has announced the release of Eclipse iceoryx Almond, which is the platform’s 1.0 release. Eclipse iceoryx provides a middleware for inter-process-communication (IPC) to allow for transmission of large amounts of data. 

According to the Eclipse Foundation, iceoryx is ideal for applications that need very low latency when transmitting data, such as automotive applications, robotics, gaming, and AI.  

The foundation explained that Eclipse iceoryx has origins in the automotive domain where the typical software for a non-autonomous car contains over 100 million lines of code, which jumps to 300 to 500 million lines for an autonomous car. In order to make real-time decisions, the autonomous car would need to process up to 10GB/s of sensor data.

Eclipse iceoryx has a latency of less than 1 microsecond to transfer a message, regardless of size. It sends the message from publisher to subscriber without creating a single copy, which is important when large amounts of data have to be processed in a short period of time, according to the company.

It currently offers support for Linux, QNX, and MacOS operating systems as well as C and C++. The team plans to add support for Windows and Rust in a future release. 

“Eclipse iceoryx is a great example of open source software addressing a critical industry need,” said Mike Milinkovich, executive director of the Eclipse Foundation. “With this release, as well as other projects like Eclipse Cyclone DDS and working groups like OpenADx, I feel that the Eclipse Foundation is quickly becoming the home of developer toolchains and software for autonomous vehicles designed with safety certifications in mind.”

 

The post Eclipse iceoryx Almond supports transmitting large amounts of data quickly appeared first on SD Times.

Read more: sdtimes.com

Categories
Technology Videos

COOLEST RC VEHICLES


For copyright matters please contact us at: copymanager.mn@gmail.com

BRAIN TIME ► https://goo.gl/tTWgH2

1. Tamiya Knight Hauler (Preview)
https://youtu.be/FgTa5wvHW1c
https://www.youtube.com/channel/UCX2-frpuBe3e99K7lDQxT7Q

2. RoboEVO
https://youtu.be/XVAy_6E0MZI
https://youtu.be/yHaA7LCPtWY
https://www.youtube.com/channel/UCvv2L1CtqbaYXbMKIKxhhlQ

3. Airbus A380
https://youtu.be/SwfdKQBcs1I
https://www.youtube.com/channel/UCgZm_RyXOqIIhF24_7hgCzQ

4. Wacker Neuson RTSC3
https://youtu.be/P7PrTWBV_No
https://youtu.be/PtXWwrAAeK0
https://www.youtube.com/channel/UCYCFLm53KuKyQH8OuaAp1JQ

5. Traxxas Ford Bronco TRX-4
https://youtu.be/u38K3e_yWs4
https://www.youtube.com/channel/UC4Q7GgIQ4kFXnZ3XIBFgUig

6. Rheinmetall Mission Master XT
https://youtu.be/y5exKJD_n9o
https://www.youtube.com/channel/UCdrHMWb1G4p0nftdwi_ch_A

7. Redcat SixtyFour
https://youtu.be/Zpgp29xhx0s
https://youtu.be/IX5Ddgd1BCA
https://youtu.be/A3W0qlOOBdE
https://www.youtube.com/channel/UCzvQ_89MScBaY_rXTofgfIw

8. A+T Nutzfahrzeuge LOGLIFT 140S
https://youtu.be/JORyo9zff3g
https://www.youtube.com/channel/UCjhycWJ5GpM_k8M77NYXPRw

9. Graupner Bell 212 Twin Jet
https://youtu.be/8Bu9VCIM9HU
https://www.youtube.com/channel/UC3SreIZcERFQeFzqIPomK6w

00:00 – Tamiya Knight Hauler (Preview)
01:29 – RoboEVO
02:50 – Airbus A380
04:20 – Wacker Neuson RTSC3
05:48 – Traxxas Ford Bronco TRX-4
07:22 – Rheinmetall Mission Master XT
08:24 – Redcat SixtyFour
09:34 – A+T Nutzfahrzeuge LOGLIFT 140S
10:28 – Graupner Bell 212 Twin Jet

Read more: youtube.com

Categories
Software

Ambassador Labs launches Ambassador Developer Control Plane 1.0

Ambassador Labs announced the release of its new Ambassador Developer Control Plane 1.0 (DCP), which lets developers code, ship and run apps using Kubernetes faster.

The control plane provides a new managed cloud UI and an integrated toolchain built entirely on top of Cloud Native Computing Foundation (CNCF) open-source projects. 

Developers can use the control plane to view and manage their organization’s apps and services across development, deployment, and production environments without needing to stitch together Kubernetes tools or needing to compromise productivity. 

Ambassador Labs also unveiled two new developer programs that are designed to elevate hands-on learning with Kubernetes: Summer of Kubernetes and the Ambassador Community Advocate program.

“Kubernetes has become an industry-standard and organizations are now faced with a dizzying ecosystem of cloud native open source tools. To deal with increasingly complex tool sprawl, companies have resorted to gluing together various homegrown systems to improve the Kubernetes developer experience,” said Richard Li, the CEO and founder of Ambassador Labs. “A modern developer control plane is necessary to accelerate Kubernetes adoption with less complexity and our mission is to put one in the hands of every developer and at the heart of every organization.” 

DCP is now available as a managed solution that integrates the Service Catalog, source control, Kubernetes and key CNCF technologies in a new UI.

Also, Telepresence now runs in more places with support for container-based continuous integration systems, macOS and Linux. 

The new platform can also be used to manage canary releases to quickly and safely ship updates since DCP is powered by the open-source project Argo and can integrate into existing GitOps workflows. 

Contributors to Emissary-ingress, a CNCF Incubation project, now benefit from an overhauled contribution, release, and testing process, according to the company in a post that contains additional details. 

The post Ambassador Labs launches Ambassador Developer Control Plane 1.0 appeared first on SD Times.

Read more: sdtimes.com

Categories
Technology Videos

SELF-DEFENSE GADGETS THAT YOU CAN BUY RIGHT NOW


For copyright matters please contact us at: copymanager.mn@gmail.com

Mind Warehouse ► https://goo.gl/aeW8Sk

1. TOPS Knives Mini Slingshot (Preview)
https://youtu.be/emyoIAgF9O8
https://youtu.be/crJ2Spwn05I
https://www.youtube.com/channel/UCrOJd7qAeDSpyOZ2BG52B1Q

2. WATTOZZ Electroshock gun
https://youtu.be/id4SHcM8lfQ
https://youtu.be/Nw5ILCmAC9s
https://youtu.be/bTOfmcbX3e4
https://www.youtube.com/channel/UCw5xXk-FlqHPnC8X9GZZ1Mg

3. Kuba Kickz
https://youtu.be/Opsfek8gFF4
https://www.youtube.com/channel/UCtERNfKuX5b80-X13jSe4Fg
https://youtu.be/U7FTBr-hcSY
https://www.youtube.com/channel/UCFPlshMClpF7fkjRWEjCvHw
https://youtu.be/BsDWv8FXGOg
https://www.youtube.com/channel/UCDCGZZYzNHrW26M6CkftWnQ

4. Byrna HD (Preview)
https://youtu.be/Ii-3lL01bZs
https://youtu.be/5AvIlRwqm3w
https://youtu.be/s3sA0pO8UyM
https://youtu.be/rQ1CNXQvkBQ
https://youtu.be/04neU4UU974
https://www.youtube.com/channel/UCsd__wC1miuRs0Q8uAttc6Q

5. OOTDTY AK47 (Preview)
https://youtu.be/zJ0t6AErKSA
https://www.youtube.com/channel/UCl0FFpD2P6QfAYBtLYTpP-w

6. Streetwise Bulletproof Backpack
https://youtu.be/W7c2RbmMV0U
https://www.youtube.com/channel/UCJHcaFmdkM5FWqAZumeBz9A

7. M48 Sword Cane
https://youtu.be/n2XOOmVjF6E
https://youtu.be/Lphon1VlG3E
https://www.youtube.com/channel/UC2oAiWeJvtyywDLdo53WNOg

8. Monkey Fist (Preview)
https://youtu.be/nNeCsc-C17U
https://www.youtube.com/channel/UCnl46nUgmQeco7GS-D7M4uQ
https://youtu.be/JtWl9Mz2SPg
https://www.youtube.com/channel/UCeW7Y48Sj5gBE8l-oV-1vJQ
https://ae-cn.alicdn.com/9f8e1de30350cb41/wkc9ctwt5SmwQRGfOYi/CBFZYVFSa2cj0m6LVzA_298124772257_sd_hq.mp4
https://youtu.be/gw8qr7mYou4
https://www.youtube.com/channel/UCaV6qLJi2jK1vHn_lkJGDbQ
https://youtu.be/wuCMyPjvdNQ
https://www.youtube.com/channel/UCLBkELq5mdIp9j-hwqQPo1A
https://youtu.be/AlvLAujdLac
https://www.youtube.com/channel/UCsKChnLez16mPhgJxW3q0Rg

9. BISON GEARS Kiridashi
https://youtu.be/xOF7XfCHTZs
https://youtu.be/-0bFlwRs-FM
https://www.youtube.com/channel/UCE8HMuiUaZgWZF9MYo9jWTQ

10. CRKT Williams Defense Key
https://youtu.be/_hkpU72mZg0
https://youtu.be/o2e35CW9ThA
https://www.youtube.com/channel/UCT7_erWnRA9DHWRh5iRIdcw

00:00 – TOPS KNIVES MINI SLING (preview)
01:13 – WATTOZZ ELECTROSHOCK GUN
02:28 – KUBA KICKZ
03:25 – BYRNA HD (preview)
04:31 – OOTDTY AK47
05:24 – STREETWISE BULLETPROOF BACKPACK
06:32 – M48 SWORD CANE
07:26 – MONKEY FIST
08:27 – BISON GEARS KIRIDASHI
09:21 – CRKT WILLIAMS DEFENSE KEY

Read more: youtube.com

Categories
News

Kushki, an Ecuador-based fintech, raises $86M to build financial infrastructure in LatAm

Just about every week there’s a blockbuster round coming out of South America, but in certain countries such as Ecuador, things have been more hush-hush. However, Kushki, a Quito-based fintech, is bringing attention to the region with today’s announcement of an $86 million Series B and a $600 million valuation.

“We never thought that we would return home [from the U.S.] and build a company that was more valuable in Ecuador than we had built in the U.S.,” said Aron Schwarzkopf, CEO and co-founder of Kushki.

Schwarzkopf and his business partner, Sebastián Castro, previously built and sold a fintech called Leaf in the U.S. in 2014. The two are originally from Ecuador but moved to Boston for college, where they met watching soccer.

Unlike many other fintechs in LatAm that are out to help the unbanked, Kushki works behind the scenes building the tech infrastructure that companies like Nubank use to transfer money. Some of the functionalities they build enable both local and cross-border payment players in credit and debit cards, bank transfers, digital cash, mobile wallets and other alternative payment methods.

“We realized there was a gigantic opportunity to democratize and create infrastructure to move money,” Schwarzkopf told TechCrunch.

The company, which was founded in 2017, already has operations in Mexico, Colombia, Ecuador, Peru and Chile. The Series B will be used to accelerate growth and expand to Brazil and nine other markets in Central America.

Generally, expanding to Brazil is an expensive proposition, and therefore not a path that all companies can take, even though it can be an extremely profitable move if done right. Some of the challenges include the need to translate everything into Portuguese followed by the varying financial regulations.

There have never been more $100M+ fintech rounds than right now

That’s why Kushki’s approach has to be somewhat custom in each country.

“We focus on going into the markets and we basically rebuild an entire infrastructure, so we put everything into one API,” said Schwarzkopf.

Products similar to Kushki have been successful in other regions around the world, such as in India with Pine Labs, Africa with Flutterwave and Checkout.com, which now has 15 international offices.

To build all this infrastructure, Kushki, which means “cash” in a native Andes dialect, has raised a total of $100 million from SoftBank and an undisclosed global growth equity firm, as well as previous investors including DILA Capital, Kaszek Ventures, Clocktower Ventures and Magma Partners.

“From now until 2060, people will need servers and ways to move money, and we knew that the existing payment infrastructure couldn’t support that,” said Schwarzkopf.


Read more: feedproxy.google.com

Categories
News

The Station: Rivian rolls towards an IPO and Quantumscape makes a big battery hire

The Station is a weekly newsletter dedicated to all things transportation. Sign up here — just click The Station — to receive it every weekend in your inbox.

Hello and welcome back to The Station, a weekly newsletter dedicated to all the ways people and packages move (today and in the future) from Point A to Point B.

For my American readers, you might be traveling — perhaps for the first time in more than a year — because of the Memorial Day holiday. While Memorial Day is meant to honor members of the U.S. military who died while serving, the three-day weekend has become the unofficial kick off to summer. This year, those traveling by car, truck or SUV will be met by the most expensive Memorial Day weekend gas prices since 2014, according to AAA. The organization also estimates that 37 million Americans will travel by plane and automobile over the holiday — a 60% increase over the same period last year.

Be safe out on these busy roads, frens.

One story to highlight: Mark Harris dug into the contracts for the Las Vegas Loop System. He found that restrictions put in place by Nevada regulators are making it difficult for The Boring Company to meet contractual targets for its LVCC Loop, Elon Musk’s first underground transportation system. Shortly after publication, Steve Hill, president of the Las Vegas Convention and Visitors Authority (LVCVA), tweeted that a Loop test this week, with a few hundred participants, had demonstrated its planned 4,400 passenger per hour capacity, which could release $13 million in construction funds currently being held back. While this bodes well for TBC, the story lays out a number of other issues that could pose a challenge for the company. We will continue to dig into this story of tunnels and transport.

Now a request, dear reader. We’re a bit more than a week away from TC Sessions: Mobility 2021, a one-day virtual event scheduled for June 9 that is bringing together some of the best and brightest minds in transportation, including Mate Rimac of Rimac Automobili, Pam Fletcher of vp of global innovation at GM, Scale AI CEO Alexandr Wang, Joby Aviation founder and CEO JoeBen Bevirt, investor and LinkedIn founder Reid Hoffman, whose special purpose acquisition company just merged with Joby, and investors Clara Brenner of Urban Innovation Fund, Quin Garcia of Autotech Ventures and Rachel Holt of Construct Capital.

I’d love for you to join, and you can do that by clicking here and buying a ticket, which will also give you a months-free subscription to Extra Crunch and access to all the videos of the conference. But, if you can’t come, please reach out anyway and let me know if you have any questions or topics that you want addressed. I will be interviewing many of the folks coming to our virtual stage.

We just announced three more participants from automakers Hyundai, Ford and Toyota who will talk about their respective companies’ increasing interest and investment in robotics. Our three guests are: Max Bajracharya, formerly from Alphabet’s X and now vp of robotics at Toyota Research Institute, Ernestine Fu, director at Hyundai Motor Group who heads development at the new  New Horizons Studio and Mario Santillo, a technical expert at Ford who has been charged with helping lead the company’s efforts at a recently announced $75 million research facility at the University of Michigan, Ann Arbor.

Email me at kirsten.korosec@techcrunch.com to share thoughts, criticisms, offer up opinions or tips. You can also send a direct message to me at Twitter — @kirstenkorosec.

Micromobbin’

Micromobility rivals Bird and Lime have come out with news this week that they’re both marketing as sustainability initiatives. Let’s start with Bird.

Bird has unveiled its next-generation scooter, the Bird Three, that it will unveil in New York and Berlin this summer. It’s got a longer-range battery with 1kWh capacity and an improved diagnostic monitoring system to keep the battery lasting as long as possible. Bird says its better, smarter battery means it’s ultimately a more sustainable scooter because it has a longer life and needs to be charged a lot less.

Ideally, a better battery and better software will also help produce a longer-lasting vehicle so that Bird can cut down on depreciation and maintenance costs, which have really not helped the company in its push for profitability. Last week, Bird announced a SPAC merger with Switchback II. The regulatory filings that accompanied the announcement demonstrate just how difficult it is to turn a profit given the unit economics of shared scooters.

Lime is similarly positioning its updated subscription service, Lime Prime, as a sustainable initiative. With each new Prime member sign up, Lime promises to plant a tree through One Tree Planted. But more importantly, the subscription service helps the regular Lime rider perhaps save a bit of money. Members have access to waived unlock fees on any vehicle, and in markets with no start fees, the benefit will be 25% off the ride price. Additionally, riders can get free 30 minute reservations on any vehicle.

Two-wheel swag news

Zaiser Motors announced the launch of its Wefunder campaign to raise funds for development and production of its Electrocycle. It’s a good-lookin’ vehicle, charcoal-black with a design that breaks away from a super traditional gasoline-era style and looks more like something a small Batman might ride. All of the components are designed to be recyclable within the first 10 years of production, the company says. The Electrocycle has 300 miles of range, swappable batteries and is less than $25,000.

Meanwhile in scooter world, the Scotsman, a Silicon Valley-based electric scooter brand, has unveiled a scooter that’s 3D printed entirely in carbon fiber composite. And I don’t just mean some parts are composite. The whole frame, the handlebars, the stem and the baseboard are all made of this strong, sustainable, lightweight material. It also means the scooters are highly customizable, each frame printed depending on the owner’s height, weight, arm and leg lengths and riding position. At a starting price of $2,999, it’s not cheap, but that might be a signal from the industry that scooters are increasingly become viable transport options and not just toys. You can pre-order here.

— Rebecca Bellan

Deal of the week

money the station

The march of IPOs appears to picking up pace. For instance, Full Truck Alliance, the Chinese digital freight platform known as Manbang Group, filed for an IPO. The filing didn’t specify the exact amount it was aiming to raise. Reuters, citing unnamed sources, reported that the company wants to raise up to $1.5 billion, which would give it a valuation of $20 billion.

Full Truck Alliance’s S-1 provides a number of interesting details, including the how much money can be captured by effectively connecting truckers with shippers. The company reported that about 20% of all China’s heavy-duty and medium-duty truckers fulfilled shipping orders on our platform in 2020. (More than 2.8 million truckers fulfilled shipping orders on its platform last year.) Full Truck Alliance said last year it facilitated 71.7 million fulfilled orders with a gross transaction value of RMB173.8 billion (US$26.6 billion).  The first quarter number show it is growing. In the first quarter, the company had  22.1 million fulfilled orders, a 170.2% increase from the same period.

Full Truck Alliance raised $3.6 billion in private funding, most recently last fall at an $11.7 billion valuation, from firms like SoftBank Vision Fund (22.2% pre-IPO stake), Sequoia Capital China (7.2%), Permira, Tencent, Hillhouse Capital, GGV Capital, Lightspeed China Partners and Baillie Gifford.

The IPO about six months since the company raised $1.7 billion in a funding round that included backing from SoftBank Vision Fund, Sequoia Capital China, Permira, Fidelity, Hillhouse Capital, GGV Capital, Lightspeed China Partners, Tencent and Jack Ma’s YF Capital. A look at the S-1 shows that the principal shareholders are Softbank with a 22.2% stake, followed by 8.9% held by Full Load Logistics, a limited liability company owned by Full Truck Alliance CEO Hui Zhang. Sequoia has a 7.2% stake and Master Quality Group Limited, another organization controlled by Zhang, hold 6.6% of shares.

Other deals that got my attention this week …

E2open Parent Holdings Inc. said it will acquire logistics execution platform BluJay Solution, Freightwaves reported. The deal could be valued at $1.7 billion, consisting of $760 million in cash and 72.4 million shares.

First Move Capital, the Boulder-based venture firm that has invested in used car marketplaces Frontier Auto Group and Vroom as well as mobility-as-a-service startup Via, has closed a new $150 million fund that will focus on the automotive and transportation sectors. Proceeds from the round will be exclusively allocated to new investments; seven have already been made, including into autonomous vehicle startup Gatik, cloud-based automotive retail platform Tekion and e-commerce startup Revolution Parts.

Hydra Energy received CAD$15 million ($12 million) from Just Business to expand beyond pilots and deliver hydrogen-powered trucking, the company announced. This funding is to support the further development of Hydra’s initial waste hydrogen capture plant in British Columbia, its fueling infrastructure and conversion kits. The Canadian company has raised CAD $22 million (USD $17.2 million) to date. One other update worth sharing, Hydra’s flagship hydrogen-as-a-service project, is scheduled to break ground later this year.

Miles, the German car-sharing service has received investment from Delivery Hero CFO Emmanuel Thomassin, HelloFresh CFO Christian Gärtner, Chargepoint CFO Rex Jackson as well as Norwegian top manager Stine Rolstad Brenna. Thomassin has joined the company’s advisory board. The company disclosed to TechCrunch that it generated 20 million euros ($24.39 million) of revenue in 2020, quadruple the amount from the previous year. The results helped the company achieve profitability in October 2020. Miles is now focused on expansion. In the first four months in 2021, the company launched electric vehicles and expanded its car fleet to Munich. Miles intends to grow beyond Germany and is currently examining the best markets to launch in.

MotoRefi raised another $45 million in a round led by Goldman Sachs just five months after investors poured $10 million into the fintech startup to help turbocharge its auto refinancing business. While the company didn’t give me specifics on its revenue — CEO Kevin Bennett cited a 7x growth year-over-year but didn’t provide the baseline — it did disclose it’s on track to issue $1 billion in loans by the end of the year. That’s a fivefold increase from the same period last year.

Smart Eye, the publicly traded Swedish company that supplies driver monitoring systems for a dozen automakers, acquired emotion-detection software startup Affectiva for $73.5 million in a cash-and-stock deal. The startup, which says it developed software that can detect and understand human emotion, spun out of MIT Media Lab in 2009. Since then, it has landed a number of development and proof of concept deals as well as raised capital, but it never quite reached the mass-scale production contracts.

That’s where Smart Eye comes in. Smart Eye, which has won 84 production contracts with 13 OEMs, including BMW and GM, is keen to combine with its own AI-based eye-tracking technology. The companies’ founders see an opportunity to expand beyond driver monitoring systems — tech that is often used in conjunction with advanced driver assistance systems to track and measure awareness — and into the rest of the vehicle. Together, the technology could help them break into the emerging “interior sensing” market, which can be used to monitor the entire cabin of a vehicle and deliver services in response to the occupant’s emotional state.

Tritium, a Brisbane-based developer and producer of direct current fast EV chargers, announced a merger agreement with a special purpose acquisition company Decarbonization Plus Acquisition Corp. II. The deal is expected to value the company at $1.2 billion. The transaction is expected to generate gross proceeds of up to $403 million. Tritium will be listed under the ticker “DCFC.”

This particular SPAC deal is unusual in that it does not include private investment in public equity, or PIPE — a fundraising round that typically occurs at the time of the merger and injects more capital into the company. Tritium CEO Jane Hunter told us that the company didn’t need a PIPE because DCRN is a more than $400 million SPAC and its shareholder group agreed to a minimum cash closing of just $200 million, which significantly reduces redemption risk. “Also, our revenue has grown at a compound annual growth rate (CAGR) of 56% since 2016 as we expand our presence in major markets where we have a significant market share, such as the U.S. and Europe,” Hunter said. “This revenue growth helps to reduce our reliance upon new funds to implement our growth strategy.”

Wejo, the connected vehicle data startup backed by GM and Palantir, plans to go public through a merger with special purpose acquisition company Virtuoso Acquisition Corp. The agreement, announced in a regulator filing, will give the combined company an enterprise valuation of $800 million, which includes debt. There were earlier reports that the SPAC deal was imminent. The filing confirms the news and provides more detail.

The deal raises $330 million in proceeds for Wejo, including a $230 million cash contribution from Virtuoso and a $100 million in private investment in public equity, or PIPE. Previous strategic investors Palantir and GM anchored the transaction, according to Wejo. The company did not disclose the amounts of those investments. Current shareholders will retain 64% ownership of the company, according to its investor deck.

Policy corner

the-station-delivery

Senate Republicans released their response to Joe Biden’s sweeping $2 trillion investment plan, which would earmark $174 billion for electric vehicle investments. Their proposal would shrink it down to $928 billion. And that $174B for EVs? That would be reduced to just $4 billion, under the GOP plan.

It seems that the main point of contention between the President and his GOP colleagues is the definition of the word ‘infrastructure.’ Republicans are sticking to a more traditional definition, so their counterproposal still contains plenty of money for things like roads, the water system, bridges and broadband.

Biden’s plan aimed to provide consumer tax incentives and incentives for EV chargers, incentives to boost domestic manufacturing and enough funds to install at least 500,000 public charging stations across the country by 2030. A memo obtained by The Hill suggests Biden intends to hold firm to his proposal, so expect further negotiations in the coming weeks.

The Senate Finance Committee on May 26 marked up the Clean Energy for America Act, an important step before it hits the Senate floor for a vote. Among other things, the bill would remove 200,000 unit cap on tax credits for consumers buying EVs — that means the tax credit could be used toward buying a Tesla, a manufacturer that hasn’t been eligible for the credit because they’ve sold over 200,000 cars in the United States.

Sen. Debbie Stabenow (D-MI) added an amendment to the bill that would create an additional $2,500 consumer credit for vehicles assembled in the U.S. and another $2,500 for vehicles assembled in a unionized facility. If it passes, the additions would bring the maximum consumer tax credit for EVs to $12,500 — no small sum! The credits would expire in 2025. “Electric vehicles are part of our transportation future,” Sen. Stabenow said. “The question is not when they will be built, it’s where they will be built: in Asia or America?”

U.S. Energy Secretary Jennifer Granholm sold her holdings in electric bus manufacturer Proterra after Republicans criticized her for a potential conflict of interest. The GOP’s complaint arose after Biden made a virtual visit to a Proterra factory in April. The sale provided Granholm with a net gain of $1.6 million, DOE told reporters.

— Aria Alamalhodaei

A little bird

blinky cat bird green

I hear and see things, but we’re not selfish. Let me share.

This week, “a little bird” is all about big employment moves and departures and how one hire is connected to a potentially massive IPO.

Let’s kick things off with Celina Mikolajczak, the now former vice president of battery technology at Panasonic Energy of North America. You might recall that Mikolajczak recently took a board seat at solid state battery company QuantumScape. Welp, she is now taking a job at the company as vice president of manufacturing engineering, beginning in July. She has resigned from the board in connection with accepting the offer. In her new role, Ms. Mikolajczak will lead the transition of the Company’s tools and manufacturing processes from research and development to production, QuantumScape said in a regularly filing.

Mikolajczak has a long history researching and developing better lithium-ion batteries. Her technical consulting practice at Exponent focused on lithium-ion cell and battery safety and quality. She then took a senior management position at Tesla that was focused on cell quality and materials engineering. During her time at Tesla, Mikolajczak developed the battery cells and packs for Tesla’s Model S, Model X, Model 3 and Roadster Refresh.

After leaving Tesla, Mikolajczak went on to serve as director of engineering focused on battery development for rideshare vehicles at Uber Technologies. And in 2019, she joined Panasonic Energy of North America, where she is vice president of battery technology. While at Panasonic, Mikolajczak led a team of more than 200 engineers and other technical staff to improve lithium-ion cell manufacturing and to bring the latest cell technologies to mass production for Tesla at the Gigafactory facility in Sparks, Nevada.

Speaking of Tesla … it looks like Scott Sims, director of engineering, left the company this month. His title doesn’t quite capture his role. Sims was the person leading the design and engineering for vehicle user interfaces, streaming, video games and mobile applications. Importantly, he was responsible for cloud computing as it related to the Tesla mobile app, a critical tool for any owner.

Finally, the big news on Friday (via Bloomberg) is that Rivian has selected underwriters for an initial public offering. The company could seek an eye-popping value of $70 billion. I have confirmed some (but not all) of Bloomberg’s reporting. Obviously big news that I’ll be watching and digging into. I had heard rumbling about a potential Rivian IPO, but Bloomberg put together the critical deets.

To me, the biggest indication that Rivian was getting ready to make a move was Ger Dwyer taking the vp of business finance position at the company, which he posted about on LinkedIn. You might recall, that I scooped the news a couple of weeks ago that Dwyer was leaving his post as CFO at Waymo. I noted at the time that Dwyer’s departure comes at a time when the demand for CFOs has rocketed alongside the continuous string of public offerings, including those done via mergers with special purpose acquisition companies.

Got tips? Send them my way by email or DM me over at Twitter.

Notable reads and other tidbits

Loads and loads of news. Let’s get to it.

Autonomous vehicles

Aurora published a blog post that gives a few new details on its testing and self-driving trucks strategy in Texas. The autonomous vehicle company said its first commercial pilots will move goods on several “middle-mile” routes in Texas. A safety driver will be behind the wheel of these self-driving trucks, which will drive autonomously between hubs. The terminal or hub system is one that other AV companies have adopted — at least for now. The idea is that loads can be consolidated, which would theoretically make operations more efficient. Aurora did add, that “for shippers and carriers with existing hubs and large volumes of freight, we expect to ultimately drive the complete route with no need for an intermediate consolidation point.”

One other item that jumped out to me: the company is expanding into a second office in Texas, suggesting that they’re scaling up, at least in terms of people.

Germany’s lower house of parliament adopted legislation that will allow driverless vehicles on public roads by 2022, laying out a path for companies to deploy robotaxis and delivery services in the country at scale. While autonomous testing is currently permitted in Germany, this would allow operations of driverless vehicles without a human safety operator behind the wheel. The bill still needs to pass through the upper chamber of parliament, or the Bundesrat. Included in the bill are possible initial applications for self-driving cars on German roads, such as public passenger transport, business and supply trips, logistics, company shuttles that handle employee traffic and trips between medical centers and retirement homes.

PAVE, which stands for Partners for Autonomous Vehicle Education, piloted a workshop with local governments earlier this month throughout Ohio. The educational workshop, which was done in partnership with Drive Ohio, wasn’t open to the public. But my Autonocast podcast co-host Ed Niedermeyer, who also happens to be director of communications for PAVE, gave me the inside scoop on what went down.

PAVE says it doesn’t do any kind of policy advocacy; instead the aim is to arm public policymakers with the facts they need to make good policy. This pilot helped PAVE lay a foundation for a curriculum that can be used elsewhere; that might seem trivial, but the complexity of issues around AVs makes these workshops with elected officials potentially powerful tool.

Ed told me that one of the main challenges was educating on potentially controversial topics, like policy and regulation, “where we have to get facts across without imparting biases.” He noted that the organization’s public sector and academic advisory councils were both helpful as neutral authorities. Finally, he said that one of the most practical education PAVE did was around the best practices that its members and advisors have developed in early AV deployments.

Kodiak Robotics, the U.S.-based self-driving truck startup, is partnering with South Korean conglomerate SK Inc. to explore the possibility of deploying its autonomous vehicle technology in Asia. While Kodiak co-founder and CEO Don Burnette couched the initial agreement as a first step toward a commercial enterprise in Asia, the reach of SK shouldn’t be discounted. SK Inc., a holding company of SK Group, has more than 120 operating companies, including ones connected to the logistics industry.

The ultimate aim of the partnership is to sell and distribute Kodiak’s self-driving technology in the region. Kodiak will examine how it can use SK’s products, components and technology for its autonomous system, including artificial intelligence microprocessors and advanced emergency braking systems. Both companies have also agreed to work together to provide fleet management services for customers in Asia.

Electric vehicles

Ford Motor, fresh off its splashy F-150 Lightning electric truck reveal, announced it is pushing its investment in EVs up to $30 billion by 2025, up from a previous spend of $22 billion by 2023. The company announced the fresh cashflow into its EV and battery development strategy, dubbed Ford+, during its investor day.

The company said it expects 40% of its global vehicle volume to be fully electric by 2030. Ford sold 6,614 Mustang Mach-Es in the U.S. in Q1, and since it unveiled its F-150 Lightning last week, the company says it has already amassed 70,000 customer reservations.

Hyundai held the North American reveal of the upcoming all-electric Ioniq 5 crossover. One new detail that I found interesting: Hyundai developed an in-car payment system that will debut in the Ioniq 5. The feature will offer drivers the ability to find and pay for EV charging, food and parking. When the vehicle comes to North America in fall 2021, the payments system will launch with Dominoes, ParkWhiz and Chargehub.

Lordstown Motors’ cash-rich SPAC dreams have turned out to be nothin’ more than wishes, as Alex Wilhelm and Aria Alamalhodaei reported. The upshot: a disappointing first-quarter earnings that was a pile-up of red-ink-stained negativity. The lowlights include higher-than-expected forecasted expenses, a need to raise more capital and lower-than-anticipated production of its Endurance vehicle this year — from around 2,200 vehicles to just 1,000. In short, the company is set to consume more cash than the street expected and is further from mass production of its first vehicle than promised.

Lucid Motors revealed the in-cabin tech of its upcoming electric luxury Air sedan. I spoke to Derek Jenkins, who heads up design at Lucid, and he provided a detailed tour of all the tech in the vehicle. It goes far beyond the curved 34-inch display and second touchscreen, which received much of the attention. The user experience, particularly the underlying software, matters in all cars. But it can be the death of an electric vehicle model if not done properly.

It appears Lucid is on the right track. I won’t really know until I’m able to test the Air. Let’s hope that is soon.

Rivian has delayed deliveries of the R1T Launch Edition, the limited edition release of its first series of “electric adventure vehicles,” by a month. Customers who preordered can now expect to start receiving their pickup trucks in July instead of June, with Launch Edition deliveries to be completed by spring 2022. The one-month delay was due to a combination of small issues, including delays on shipping containers, the ongoing chip shortage as well as ensuring the servicing piece is properly set up. It’s worth noting that Rivian told me that it has been largely unaffected by the chip shortage compared to the rest of the industry because its products don’t require as many as other vehicles on the market today.

Tesla had a number of news items this week, so I’ll just point to the most notable ones. Tesla has established a data center in China to carry out the “localization of data storage,” with plans to add more data facilities in the future, the company announced through its account on microblogging platform Weibo. All data generated by Tesla vehicles sold in mainland China will be kept domestically. The move was in response to new requirements drafted by the Chinese government to regulate how cameras- and sensors-enabled carmakers collect and utilize data. One of the requirements states that “personal or important data should be stored within the [Chinese] territory.”

Finally, two safety-related pieces of Tesla news that seem in opposition to each other.

First, Tesla started delivering Model 3 and Model Y vehicles without radar, fulfilling a vision of CEO Elon Musk to only use cameras combined with machine learning to support its advanced driver assistance system and other active safety features. The decision has prompted blowback though from the National Traffic Highway and Safety Administration, Consumer Reports and IIHS over safety concerns.

Meanwhile, Tesla finally — and after loud and frequent urging from industry and safety advocates, activated the in-cabin camera in new Model Y and Model 3 vehicles. The camera will be used as a driver monitoring system. Tesla has been criticized for not activating the driver monitoring system within its vehicles even as evidence mounted that owners were misusing the system. Owners have posted dozens of videos on YouTube and TikTok abusing its advanced driver assistance system known as Autopilot — some of whom have filmed themselves sitting in the backseat as the vehicle drives along the highway.

Other nugs (no not that kind)

Apex.AI hired Paul Balciunas as its CFO. Balciunas was the former CFO of Canoo. He also was an executive at Deutsche Bank, where he acted as a lead underwriter of the initial public offering for Tesla in 2010, and has since focused on auto tech and new mobility players.

Blyncsy, a Utah-based startup movement and data intelligence company launched an AI-powered technology called Payver, that will use crowdsourced video data to give transport agencies up-to-date information on which roads require maintenance and improvements. Blyncsy is offering this service to governments at a reduced cost and with no long-term commitment. Utah’s DOT will be the first to pilot the program beginning June 1, deploying Payver in the Salt Lake County region, which covers more than 350 road miles. Blyncsy will be announcing other pilots in different states over the next few weeks.

Scale AI hired Mark Valentine to head up its federal-focused division. Valentine comes with experience and connections. He was  a commander in the U.S. Air Force, senior military advisor to FEMA and most recently, GM of national security for Microsoft. He will lead Scale’s government partnership efforts.

Scale has also hired Michael Kratsios, the former CTO of the White House, as managing director and head of strategy. The company said he is focused on accelerating the development of AI across industries. Michael joined at the end of Q1.


Read more: feedproxy.google.com

Categories
Software

SD Times news digest: LogDNA announces Spike Protection, Boomi adds Data Catalog and Preparation service to AtomSphere Platform, and Cloudflare launches new integrations

LogDNA has announced Spike Protection to give companies more control over fluctuations in their data and spend. 

LogDNA Spike Protection gives DevOps teams tools to understand and manage increases through Index Rate Alerting and Usage Quotas to provide additional insight into anomalous spikes. 

The company also today announced its Agent 3.2 release for Kubernetes and OpenShift, which introduces the configuration of log inclusion/exclusion rules, along with log redaction, using regex patterns. 

Additional details are available here

Boomi adds Data Catalog and Preparation service to AtomSphere Platform

Boomi announced the addition of the Data Catalog and Preparation AtomSphere Service to the Boomi AtomSphere Platform along with a new Data operations Professional Services Offering (DataOps PSO). 

Data Cloud Platform is also now available as a fully managed cloud-based service to work with the rest of the Boomi AtomSphere Platform.

“We are leading the evolution of iPaaS to include key aspects of data management that address the common problems of data discovery, preparation, and governance that we often see integration projects suffer from,” said Ed Macosky, head of product at Boomi. “Customers no longer need to integrate multiple point solutions to share data between systems and data repositories – they can simply access the Boomi platform to holistically accelerate data readiness processes across their enterprise.”

Cloudflare launches new integrations with Microsoft, Splunk, Datadog, and Sumo Logic 

The new integrations with analytics partners will make it easier for businesses to connect and analyze key insights across their infrastructure, according to Cloudflare.

“CISOs want their security teams to focus on security, not building clunky and costly integrations just to get insights from all of the different applications and tools in their infrastructure,” said Matthew Prince, co-founder and CEO of Cloudflare. “We saw an opportunity to make that process faster, easier, and cheaper, working with other top analytics platforms to bring added value to our customers.”

Cloudflare is also giving customers the ability to get insights from new datasets, take logs from anywhere with support for any storage destination and easily visualize data in a new user interface. 

Splunk announces $1 billion investment 

Splunk announced a $1 billion investment from Silver Lake that it will use to fund growth initiatives and manage its capital structure. 

In connection with Silver Lake’s investment, Kenneth Hao, the chairman and managing partner of Silver Lake, will be appointed to Splunk’s board of directors.

Under the terms of the investment, Silver Lake will purchase $1 billion in aggregate principal amount of Splunk’s convertible senior notes. 

The post SD Times news digest: LogDNA announces Spike Protection, Boomi adds Data Catalog and Preparation service to AtomSphere Platform, and Cloudflare launches new integrations appeared first on SD Times.

Read more: sdtimes.com

Categories
Apps

Intro to Concurrency in Go

Concurrency boosts performance by taking advantage of multiple processing cores. The API support in Go helps programmers to implement parallel algorithms in a very efficient manner. Most mainstream programming languages have concurrency support as an additional feature but Go has concurrency support built-in. This article provides an introduction to concurrent programming in Go.

Concurrent Programming in Go

Concurrent programming takes full advantage of the underlying multiple processing cores present in most modern computers. The concept has existed for quite some time, even when there was only one core built into the single processor. Using multiple threads was a common practice to achieve some sort of concurrency in many programming languages, including C/C++, Java, and more.

A single thread basically represents a small set of instructions scheduled to be executed independently. You can conceptually visualize it as a small task within a large job. Therefore, multiple threads of execution are grouped to task a complex process and get executed simultaneously. This coherence among multiple tasks gives a sense of concurrent execution. But note that any underlying limited hardware – such as a single-core processor – can only do as much by scheduling jobs in a time-shared fashion.

Today, processing hardware is powered by multiple cores. Because of this, a language that can utilize its full potential is always in demand. Mainstream programming languages are gradually realizing this fact and trying to embrace the idea of concurrency within their core features. However, the designers of Go thought why not build a language ground up with the concept of concurrency within its core features? Go is one such language that offers high-level APIs for writing concurrent programs.

Problems with Multithreading

Multithreaded programs are not only hard to write and maintain but also difficult to debug. Also, it is not always possible to split up just any algorithm using multiple threads to make it efficient as concurrent programming in terms of performance. Multithreading has its own overhead. Much of the responsibilities, such as inter-process communication or shared memory access, are handled by the environment. The developers are simply left to focus on the business at hand rather than get entangled with the nitty-gritty of parallel processing.

Keeping these problems in mind, an alternative solution is to completely rely on the operating system for multiprocessing. In this case, the responsibility lies with the developer to handle the intricacies of interprocess communication or the overhead of shared-memory concurrency. This technique may be highly tweakable in favor of performance but also easy to create a mess out of it.

Go Benefits to Concurrent Programming

Go offers a threefold solution with regard to concurrent programming.

High-level support makes it not only simpler to achieve concurrency but also easier to maintain.
Use of goroutines. Goroutines are much more lightweight than threads.
Go’s automatic garbage collection handles the complexities of memory management without developers’ intervention.

Handling Concurrency Issues in Go

The goroutines make it easy to create concurrency and form the basic primitives. Here the executing activity is called goroutine. Consider a program with two functions that do not call each other. In sequential execution, one function finishes execution, and then another one is called. With Go, however, the function can be active and running at the same time. This is simple to achieve if the functions are unrelated, but problems can occur when functions are intertwined and share one another’s execution timelines. Even with Go’s high-level support for concurrency, these pitfalls cannot be altogether avoided, especially if the main function finishes its execution prior to the functions that depend on it. Therefore, we must be careful to make the main goroutine wait until all the work is done.

Another problem is the deadlock situation, where more than one goroutine locks a certain resource to maintain exclusivity while another tries to acquire the same lock simultaneously. This type of risk is common with concurrent programming but Go has a workaround and can avoid the use of locks by using channels. Typically, a channel is created that signals the completion of execution as the work is done. Another way is to wait for the report using sync.WaitGroup. But in either case, deadlock still may occur and, at best, be avoided with careful design. Go simply provides the tools to scheme the right functioning of concurrency.

goroutine with WaitGroup Example

We can simply create a goroutine by prefixing any function call with the keyword go. The function then behaves like a thread by creating a goroutine containing the call frame to schedule it to run like a thread. Like normal functions, it can access any arguments, globals, and anything accessible within its reach.

Here is a simple code to check the status of any website, whether it is up or down. Next, we apply goroutine on the same code. Observe how the execution becomes faster as we apply concurrency.

package main
import (
“fmt”
“net/http”
“time”
)
func main() {
start := time.Now()
sitelist := []string{
“https://www.google.com//”,
“https://www.duckduckgo.com/”,
“https://www.developer.com/”,
“https://www.codeguru.com/”,
“https://www.nasa.gov/”,
“https://golang.com/”,
}
for _, site := range sitelist {
GetSiteStatus(site)
}
fmt.Printf(“\n\nTime elapsed since %v\n\n”, time.Since(start))

}
func GetSiteStatus(site string) {
if _, err := http.Get(site); err != nil {
fmt.Printf(“%s is down\n”, site)
} else {
fmt.Printf(“%s is up\n”, site)
}
}

The above Go code example will result in the following output:

https://www.google.com// is up
https://www.duckduckgo.com/ is up
https://www.developer.com/ is up
https://www.codeguru.com/ is up
https://www.nasa.gov/ is up
https://golang.com/ is up

Time elapsed since 6.666198944s

Now if we apply concurrency in the above code with the WaitGroup synchronization mechanism the performance is increased manifold.

package main
import (
“fmt”
“net/http”
“sync”
“time”
)
func main() {
var wg sync.WaitGroup
start := time.Now()
sitelist := []string{
“https://www.google.com//”,
“https://www.duckduckgo.com/”,
“https://www.developer.com/”,
“https://www.codeguru.com/”,
“https://www.nasa.gov/”,
“https://golang.com/”,
}
for _, site := range sitelist {
go GetSiteStatus(site, &wg)
wg.Add(1)
}
wg.Wait()
fmt.Printf(“\n\nTime elapsed since %v\n\n”, time.Since(start))
}
func GetSiteStatus(site string, wg *sync.WaitGroup) {
defer wg.Done()
if _, err := http.Get(site); err != nil {
fmt.Println(“%s is down\n”, site)

} else {
fmt.Printf(“%s is up\n”, site)
}
}

Once more, here is the output from our Go program:

https://www.nasa.gov/ is up
https://www.google.com// is up
https://www.developer.com/ is up
https://www.duckduckgo.com/ is up
https://golang.com/ is up
https://www.codeguru.com/ is up

Time elapsed since 1.816887681s

WaitGroup is a synchronization mechanism. Observe that, for every goroutine created, the WaitGroup is incremented using wg.Add(1) and on completion of the routine it is decremented using wg.Done(). The wg.Wait() is a blocking command to make the main goroutine wait for all the goroutine tasks to be completed.

Synchronization with Mutex in Go

Apart from WaitGroup, Go provides other synchronization mechanisms on shared resources such as Mutex. It uses a locking mechanism whenever goroutines simultaneously want to access a shared resource using sync.Mutex.lock(). Similarly, there is a way to unlock using sync.Mutex.Unlock().

The following changes in the above code implements synchronization mechanism with Mutex.

//…
func main() {
var wg sync.WaitGroup
var mut sync.Mutex
//…
for _, site := range sitelist {
go GetSiteStatus(site, &wg, &mut)
wg.Add(1)
}
//…
}
func GetSiteStatus(site string, wg *sync.WaitGroup, mut *sync.WaitGroup) {
defer wg.Done()
if _, err := http.Get(site); err != nil {
fmt.Println(“%s is down\n”, site)

} else {
mut.Lock()
defer mut.Unlock()
fmt.Printf(“%s is up\n”, site)
}
}

Implementing Channels in Golang

The channels are the connection between goroutine activities. They serve as a communication mechanism between one goroutine to another by sending and receiving values much like the UNIX pipe where we can put data at one end and receive at another. A channel therefore has two principle operations, send and receive. Unlike the pipe channel, which has an associated value of a particular type, therefore channels that have an element type must be defined during its creation. For example, a channel whose element type is int is written as:

cha := make(chan int)

The element type determines the type of value that will be passed through the channel. Declaring an empty interface type with the channel enables us to pass values of any type and determine at the receiving end. A channel of the same type can be compared with the equality operator “==” and an empty channel can be compared with nil. A channel supports buffering with configurable buffer size.

Here is a quick example of how to implement a channel in Go:

package main
import “fmt”
func main() {
odd := make(chan int)
oddsquared := make(chan int)
//odd
go func() {
for x := 1; x < 10; x++ {
if x%2 != 0 {
odd <- x
}
}
close(odd)
}()
//oddsquared
go func() {
for x := range odd {
oddsquared <- x * x
}
close(oddsquared)
}()

for x := range oddsquared {
fmt.Println(x)
}
}

The example above is simple where the odd goroutine finishes its loop after 10 elements, it closes the odd channel. This causes oddsquared to finish its loop and close the oddsquared channel. Finally, the main goroutine finishes its loop and the program exits.

Final Thoughts on Programming Go Concurrency

Apart from high-level concurrency support Go also provides the low-level functionality with sync/atomic package. They are not typically used by regular programmers and are primarily designed to support advanced stuff such as thread-safe synchronization and data structure implementation. For concurrent programming high level facilities such as goroutines and channels are used mostly. The extent of high-level support APIs in Go can rarely be matched with any other mainstream programming languages. This clearly indicates that the designers of Go put forth solid effort to imbibe the support of concurrency right into its core facilities.

The post Intro to Concurrency in Go appeared first on Developer.com.

Read more: developer.com